Skip to content

Commit dd37f07

Browse files
Oren NovotnyJakeGinnivan
authored andcommitted
Initial stab at VSO build step
1 parent ba7d3cd commit dd37f07

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

GitVersionVsoTask/Run-GitVersion.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
param (
2+
[string] [Parameter(Mandatory = $false)]
3+
$updateAssemblyInfo,
4+
[string] [Parameter(Mandatory = $false)]
5+
$additionalArguments
6+
)
7+
8+
Write-Verbose 'Entering Run-GitVersion.ps1'
9+
10+
# Import the Task.Common dll that has all the cmdlets we need for Build
11+
import-module "Microsoft.TeamFoundation.DistributedTask.Task.Common"
12+
13+
# Returns a path to GitVersion.exe
14+
function Get-PathToGitVersionExe() {
15+
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.ScriptBlock.File
16+
$targetPath = Join-Path -Path $PSScriptRoot -ChildPath "GitVersion.exe"
17+
return $targetPath
18+
}
19+
20+
21+
## Execution starts here
22+
23+
24+
$updateAssms = Convert-String $updateAssemblyInfo Boolean
25+
26+
# Call GitVersion.exe
27+
$gvPath = Get-PathToGitVersionExe
28+
Write-Output "Path to GitVersion.exe = $gvPath"
29+
Invoke-Tool -Path $gvPath -Arguments "/output buildserver /updateAssemblyInfo $updateAssms $additionalArguments"
30+
31+

GitVersionVsoTask/icon.png

1.16 KB
Loading

GitVersionVsoTask/task.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"id": "e5983830-3f75-11e5-82ed-81492570a08e",
3+
"name": "GitVersion",
4+
"friendlyName": "GitVersion Task",
5+
"description": "Easy Semantic Versioning (http://semver.org) for projects using Git",
6+
"author": "GitTools and Contributors",
7+
"helpMarkDown": "See the [documentation](http://gitversion.readthedocs.org/en/latest/) for help",
8+
"category": "Build",
9+
"visibility": [
10+
"Build",
11+
"Release"
12+
],
13+
"demands": [],
14+
"version": {
15+
"Major": "0",
16+
"Minor": "1",
17+
"Patch": "0"
18+
},
19+
"minimumAgentVersion": "1.83.0",
20+
"groups": [
21+
{
22+
"name": "additional",
23+
"displayName": "Additional Options"
24+
"isExpanded": false
25+
}
26+
],
27+
"instanceNameFormat": "GitVersion $(message)",
28+
"inputs": [
29+
30+
{
31+
"name": "updateAssemblyInfo",
32+
"type": "boolean",
33+
"label": "Update AssemblyInfo's",
34+
"defaultValue": "false",
35+
"required": false,
36+
"helpMarkDown": "Whether to update versions in the AssemblyInfo files"
37+
},
38+
{
39+
"name": "additionalArguments",
40+
"type": "string",
41+
"label": "Additional GitVersion.exe arguments",
42+
"defaultValue": "",
43+
"required": false,
44+
"helpMarkDown": "Additional arguments to send to GitVersion.exe",
45+
"groupName": "additional"
46+
}
47+
],
48+
"execution": {
49+
"PowerShell": {
50+
"target": "$(currentDirectory)\\Run-GitVersion.ps1",
51+
"argumentFormat": "",
52+
"workingDirectory": "$(currentDirectory)"
53+
}
54+
}
55+
}

0 commit comments

Comments
 (0)