@@ -6,59 +6,59 @@ modifying your build process.
6
6
7
7
## TL;DR
8
8
9
- ### Install
9
+ ### Install the MSTask targets
10
10
11
- It works simply by installing the [ GitVersionTask NuGet
12
- Package] ( https://www.nuget.org/packages/GitVersionTask/ ) into the project you
13
- want to have versioned by GitVersion:
11
+ Add the [ GitVersionTask] ( https://www.nuget.org/packages/GitVersionTask/ ) NuGet
12
+ Package into the project you want to be versioned by GitVersion.
14
13
14
+ From the Package Manager Console:
15
15
``` shell
16
16
Install-Package GitVersionTask
17
17
```
18
18
19
- ### Remove attributes
19
+ ### Remove AssemblyInfo attributes
20
20
21
- The next thing you need to do, is remove the ` Assembly*Version ` attributes from
22
- your ` Properties\AssemblyInfo.cs ` files, so GitVersionTask can be in charge of
21
+ The next thing you need to do is to remove the ` Assembly*Version ` attributes from
22
+ your ` Properties\AssemblyInfo.cs ` files. This puts GitVersionTask in charge of
23
23
versioning your assemblies.
24
24
25
25
### Done!
26
26
27
- The TL;DR section is now done and GitVersionTask should be working its magic,
28
- versioning your assemblies like a champ. However, if you're interested in
29
- knowing what more GitVersionTask does, or have any questions, please read on.
27
+ The setup process is now complete and GitVersionTask should be working its magic,
28
+ versioning your assemblies like a champ. However, more can be done to further
29
+ customize the build process. Keep reading to find out how the version variables
30
+ are set and how you can use them in MSBuild tasks.
31
+
32
+ ## How does it work?
30
33
31
34
After being installed into a project, the MSBuild task will wire GitVersion into
32
- the MSBuild pipeline of a project and perform several actions. These actions are
35
+ the MSBuild pipeline and will then perform several actions. These actions are
33
36
described below.
34
37
35
- ## How does it work?
36
-
37
38
### Inject version metadata into the assembly
38
39
39
40
The sub-task named ` GitVersionTask.UpdateAssemblyInfo ` will inject version
40
- metadata into the assembly which GitVersionTask is added to. For each assembly
41
- you want GitVersion to version, you need to install the GitVersionTask into it
42
- via NuGet.
41
+ metadata into the assembly where GitVersionTask has been added to. For each assembly
42
+ you want GitVersion to handle versioning, you will need to install
43
+ [ GitVersionTask] ( https://www.nuget.org/packages/GitVersionTask/ ) into the corresponding
44
+ project via NuGet.
43
45
44
46
#### AssemblyInfo Attributes
45
47
46
- At build time a temporary ` AssemblyInfo.cs ` will be created that contains the
48
+ A temporary ` AssemblyInfo.cs ` will be created at build time. That file will contain the
47
49
appropriate SemVer information. This will be included in the build pipeline.
48
- Sample default:
49
50
51
+ Default sample:
50
52
``` csharp
51
53
[assembly : AssemblyVersion (" 1.0.0.0" )]
52
54
[assembly : AssemblyFileVersion (" 1.0.0.0" )]
53
55
[assembly : AssemblyInformationalVersion (" 1.1.0+Branch.master.Sha.722aad3217bd49a6576b6f82f60884e612f9ba58" )]
54
56
```
55
57
56
- Now when you build:
57
-
58
+ Now, when you build:
58
59
* ` AssemblyVersion ` will be set to the ` AssemblySemVer ` variable.
59
- * ` AssemblyFileVersion ` will be set to the ` MajorMinorPatch ` variable with a
60
- * appended ` .0 ` . ` AssemblyInformationalVersion ` will be set to the
61
- * ` InformationalVersion ` variable.
60
+ * ` AssemblyFileVersion ` will be set to the ` MajorMinorPatch ` variable with ` .0 ` appended to it.
61
+ * ` AssemblyInformationalVersion ` will be set to the ` InformationalVersion ` variable.
62
62
63
63
#### Other injected Variables
64
64
@@ -79,7 +79,7 @@ namespace AssemblyName
79
79
}
80
80
```
81
81
82
- #### Accessing injected Variables
82
+ ### Accessing injected Variables
83
83
84
84
##### All variables
85
85
@@ -114,9 +114,9 @@ However at MSBuild time these properties are mapped to MSBuild properties that
114
114
are prefixed with ` GitVersion_ ` . This prevents conflicts with other properties
115
115
in the pipeline.
116
116
117
- #### Accessing variable in MSBuild
117
+ #### Accessing variables in MSBuild
118
118
119
- After ` GitVersionTask.GetVersion ` has executed, the MSBuild properties can be
119
+ Once ` GitVersionTask.GetVersion ` has been executed, the MSBuild properties can be
120
120
used in the standard way. For example:
121
121
122
122
``` xml
@@ -138,8 +138,8 @@ Build Server log in a format that the current Build Server can consume. See
138
138
Properties ` WriteVersionInfoToBuildLog ` , ` UpdateAssemblyInfo ` and ` GetVersion `
139
139
are checked before running these tasks.
140
140
141
- If you, e.g. want to disable ` GitVersionTask.UpdateAssemblyInfo ` just define
142
- ` UpdateAssemblyInfo ` to something other than ` true ` in your MSBuild script, like
141
+ You can disable ` GitVersionTask.UpdateAssemblyInfo ` by setting
142
+ ` UpdateAssemblyInfo ` to ` false ` in your MSBuild script, like
143
143
this:
144
144
145
145
``` xml
@@ -150,7 +150,7 @@ this:
150
150
</PropertyGroup >
151
151
```
152
152
153
- ## My Git repository requires authentication. What do I do?
153
+ ## My Git repository requires authentication. What should I do?
154
154
155
- Set the environmental variables ` GITVERSION_REMOTE_USERNAME ` and
155
+ Set the environment variables ` GITVERSION_REMOTE_USERNAME ` and
156
156
` GITVERSION_REMOTE_PASSWORD ` before the build is initiated.
0 commit comments