Skip to content

Commit 28dfe31

Browse files
Oren NovotnyJakeGinnivan
authored andcommitted
Set task.json version during build
1 parent 6ec9f31 commit 28dfe31

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

appveyor.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ build_script:
2424
- cmd: 7z a "GitVersion_%GitVersion_NuGetVersion%.zip" .\build\NuGetCommandLineBuild\Tools\*.*
2525
- cmd: appveyor PushArtifact "GitVersion_%GitVersion_NuGetVersion%.zip"
2626

27+
- ps: .\build\Update-GitVersionVsoTaskVersion.ps1 .\build\GitVersionVsoTaskBuild\task.json $env:GitVersion_Major $env:GitVersion_Minor $env:GitVersion_Patch
2728
- cmd: 7z a "GitVersionVsoBuildStep_%GitVersion_NuGetVersion%.zip" .\build\GitVersionVsoTaskBuild\*.*
2829
- cmd: appveyor PushArtifact "GitVersionVsoBuildStep_%GitVersion_NuGetVersion%.zip"
2930

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
param (
2+
[string] $filePath,
3+
[string] $major,
4+
[string] $minor,
5+
[string] $patch
6+
)
7+
8+
# Get the task.json as a powershell object
9+
$task = Get-Content -Raw -Path $filePath | ConvertFrom-Json
10+
11+
$task.version.Major = $major
12+
$task.version.Minor = $minor
13+
$task.version.Patch = $patch
14+
15+
# get this as a string again
16+
17+
ConvertTo-Json $task | Set-Content -Path $filePath

0 commit comments

Comments
 (0)