File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change 188
188
<Copy SourceFiles =" $(SolutionDir)GitVersionTfsTask\task.json" DestinationFolder =" $(BuildDir)GitVersionTfsTaskBuild\GitVersionTask" />
189
189
<Copy SourceFiles =" $(SolutionDir)GitVersionTfsTask\GitVersion.ps1" DestinationFolder =" $(BuildDir)GitVersionTfsTaskBuild\GitVersionTask" />
190
190
<ReplaceFileText InputFilename =" $(BuildDir)GitVersionTfsTaskBuild\manifest.json" OutputFilename =" $(BuildDir)GitVersionTfsTaskBuild\manifest.json" MatchExpression =" \$version\$" ReplacementText =" $(GitVersion_SemVer)" Condition =" '$(GitVersion_SemVer)' != ''" />
191
- <Exec Command =" powershell -ExecutionPolicy RemoteSigned -NoProfile " $(SolutionDir)GitVersionTfsTask\Update-GitVersionTfsTaskVersion.ps1 $(BuildDir)GitVersionTfsTaskBuild\GitVersionTask\task.json $(GitVersion_Major) $(GitVersion_Minor) $(GitVersion_Patch) " " WorkingDirectory =" $(BuildDir)" Condition =" '$(GitVersion_SemVer )' != ''" />
191
+ <Exec Command =" powershell -ExecutionPolicy RemoteSigned -NoProfile " $(SolutionDir)GitVersionTfsTask\Update-GitVersionTfsTaskVersion.ps1 $(BuildDir)GitVersionTfsTaskBuild\GitVersionTask\task.json $(GitVersion_MajorMinorPatch) " " WorkingDirectory =" $(BuildDir)" Condition =" '$(GitVersion_MajorMinorPatch )' != ''" />
192
192
<Exec Command =" powershell -ExecutionPolicy RemoteSigned -NoProfile " $(SolutionDir)GitVersionTfsTask\Create-Vsix.ps1 $(BuildDir)GitVersionTfsTaskBuild" " Condition =" '$(GitVersion_SemVer)' != ''" />
193
193
194
194
<!-- Gem -->
Original file line number Diff line number Diff line change 1
1
param (
2
2
[string ] $filePath ,
3
- [string ] $major ,
4
- [string ] $minor ,
5
- [string ] $patch
3
+ [string ] $version
6
4
)
7
5
8
6
if ([string ]::IsNullOrWhiteSpace($filePath )) {
9
7
throw " File path needs to be provided."
10
8
}
11
9
12
- if ([string ]::IsNullOrWhiteSpace($major )) {
13
- throw " Major version number needs to be provided."
10
+ if ([string ]::IsNullOrWhiteSpace($version )) {
11
+ throw " Version number needs to be provided."
14
12
}
15
13
16
- if ([string ]::IsNullOrWhiteSpace($minor )) {
17
- throw " Minor version number needs to be provided."
18
- }
19
-
20
- if ([string ]::IsNullOrWhiteSpace($patch )) {
21
- throw " Patch level needs to be provided."
22
- }
14
+ Write-Host " Set version in '$filePath ' to $version "
23
15
24
- Write-Host " Set version in ' $filePath ' to $major . $minor . $patch "
16
+ $ver = [ Version ] $version
25
17
26
18
# Get the task.json as a powershell object
27
19
$task = Get-Content - Raw - Path $filePath | ConvertFrom-Json
28
20
29
- $task.version.Major = $major
30
- $task.version.Minor = $minor
31
- $task.version.Patch = $patch
21
+ $task.version.Major = $ver .Major
22
+ $task.version.Minor = $ver .Minor
23
+ $task.version.Patch = $ver .Build
32
24
33
25
# get this as a string again
34
26
You can’t perform that action at this time.
0 commit comments