You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [Visual Studio Online](https://www.visualstudio.com/) build vNext (the web based build system) you can add GitVersion as a Build Step. This requires a one-time setup to import the GitVersion task into your VSO instance.
3
+
In [Visual Studio Online](https://www.visualstudio.com/) build vNext (the web based build system) you can call GitVersion either using the Command Line build step or install a custom build step. This requires a one-time setup to import the GitVersion task into your VSO instance.
4
4
5
-
## Installing/updating the VSO Build Step
5
+
## Using GiVersion with the MSBuild Task NuGet Package
6
+
1. Add the [GitVersionTask](https://www.nuget.org/packages/GitVersionTask/) NuGet Package to your projects.
7
+
8
+
See [MSBuild Task](http://gitversion.readthedocs.org/en/latest/usage/#msbuild-task) for further instructions how to use the MS Build Task.
9
+
10
+
## Using the GitVersion with the Command Line build step
11
+
1. Make sure to have GitVersion.exe under version control. There exists also a [Chocolatey package](https://chocolatey.org/packages/GitVersion.Portable) for installing GitVersion.exe on build agents.
12
+
2. Add a Command Line build step to your build definition. You'll probably want to drag the task to be at or near the top to ensure it executes before your other build steps.
13
+
3. Set the Tool parameter to `<pathToGitVersion>\GitVersion.exe`
14
+
4. Set the Arguments parameter to `/output buildserver /nofetch`
15
+
5. If you want the GitVersionTask to update AssemblyInfo files add `updateAssemblyInfo true` to the Arguments parameter.
16
+
17
+
## Using the GitVersion with the custom build step
18
+
### Installing/updating the VSO Build Step
6
19
1. Install the `tfx` command line tool as shown [here](https://github.com/Microsoft/tfs-cli/blob/master/docs/buildtasks.md)
7
-
2. Download the GitVersion VSO extension from the latest release on the [GitVersion releases page](https://github.com/GitTools/GitVersion/releases) and unzip.
8
-
3. Run `tfx login` if you haven't yet, make sure to use `https://<server>.visualstudio.com/DefaultCollection` as the URL and provide a Personal Access Token
20
+
2. Download the GitVersion VSO build task from the latest release on the [GitVersion releases page](https://github.com/GitTools/GitVersion/releases) and unzip.
21
+
3. Run `tfx login` if you haven't yet, make sure to use `https://<server>.visualstudio.com/DefaultCollection` as the URL and provide a personal access token
9
22
4. From the directory outside of where you unzipped the task, run `tfx build tasks upload .\GitVersionVsoTask` where GitVersionVsoTask is the directory containing the files.
10
23
5. It should successfully install
11
24
12
-
## Using the GitVersion VSO Build Step
13
-
From a VSO vNext Build Definition, select "Add a Step" and then in the Build category, choose GitVersion and Click Add. You'll probably want to drag the task to be at or near the top to ensure it executes before your other build steps.
25
+
###Using the GitVersion VSO Build Step
26
+
From a VSO vNext build definition, select "Add a Step" and then in the Build category, choose GitVersion and click Add. You'll probably want to drag the task to be at or near the top to ensure it executes before your other build steps.
14
27
15
28
If you want the GitVersionTask to update AssemblyInfo files, check the box in the task configuration. For advanced usage, you can pass additional options to the GitVersion exe in the Additional arguments section.
16
29
@@ -22,5 +35,5 @@ Note that due to [current limitations in VSO](https://github.com/Microsoft/vso-a
22
35
## Running inside Visual Studio Online
23
36
* We output the individual values of the GitVersion version as the build parameter: `GitVersion.*` (Eg: `GitVersion.Major`) if you need access to them in your build script
24
37
25
-
### NuGet in VSO
26
-
* If you use a command script to build your NuPkg, use `%GITVERSION_NUGETVERSION%` as the version parameter: `nuget.exe pack path\to\my.nuspec -version %GITVERSION_NUGETVERSION%`
38
+
### Create a NuGet package in VSO
39
+
* If you use a command script to build your NuPkg, use `%GITVERSION_NUGETVERSION%` as the version parameter: `nuget.exe pack path\to\my.nuspec -version %GITVERSION_NUGETVERSION%`
0 commit comments