Skip to content

Commit 84c84a2

Browse files
committed
Merge pull request #802 from dcorriveau-omniscient/DocFixMsbuildPage
Updated doc for a better read
2 parents 1d475a8 + eb50f48 commit 84c84a2

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

docs/usage/msbuild-task.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,59 @@ modifying your build process.
66

77
## TL;DR
88

9-
### Install
9+
### Install the MSTask targets
1010

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.
1413

14+
From the Package Manager Console:
1515
```shell
1616
Install-Package GitVersionTask
1717
```
1818

19-
### Remove attributes
19+
### Remove AssemblyInfo attributes
2020

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
2323
versioning your assemblies.
2424

2525
### Done!
2626

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?
3033

3134
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
3336
described below.
3437

35-
## How does it work?
36-
3738
### Inject version metadata into the assembly
3839

3940
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.
4345

4446
#### AssemblyInfo Attributes
4547

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
4749
appropriate SemVer information. This will be included in the build pipeline.
48-
Sample default:
4950

51+
Default sample:
5052
```csharp
5153
[assembly: AssemblyVersion("1.0.0.0")]
5254
[assembly: AssemblyFileVersion("1.0.0.0")]
5355
[assembly: AssemblyInformationalVersion("1.1.0+Branch.master.Sha.722aad3217bd49a6576b6f82f60884e612f9ba58")]
5456
```
5557

56-
Now when you build:
57-
58+
Now, when you build:
5859
* `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.
6262

6363
#### Other injected Variables
6464

@@ -79,7 +79,7 @@ namespace AssemblyName
7979
}
8080
```
8181

82-
#### Accessing injected Variables
82+
### Accessing injected Variables
8383

8484
##### All variables
8585

@@ -114,9 +114,9 @@ However at MSBuild time these properties are mapped to MSBuild properties that
114114
are prefixed with `GitVersion_`. This prevents conflicts with other properties
115115
in the pipeline.
116116

117-
#### Accessing variable in MSBuild
117+
#### Accessing variables in MSBuild
118118

119-
After `GitVersionTask.GetVersion` has executed, the MSBuild properties can be
119+
Once `GitVersionTask.GetVersion` has been executed, the MSBuild properties can be
120120
used in the standard way. For example:
121121

122122
```xml
@@ -138,8 +138,8 @@ Build Server log in a format that the current Build Server can consume. See
138138
Properties `WriteVersionInfoToBuildLog`, `UpdateAssemblyInfo` and `GetVersion`
139139
are checked before running these tasks.
140140

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
143143
this:
144144

145145
```xml
@@ -150,7 +150,7 @@ this:
150150
</PropertyGroup>
151151
```
152152

153-
## My Git repository requires authentication. What do I do?
153+
## My Git repository requires authentication. What should I do?
154154

155-
Set the environmental variables `GITVERSION_REMOTE_USERNAME` and
155+
Set the environment variables `GITVERSION_REMOTE_USERNAME` and
156156
`GITVERSION_REMOTE_PASSWORD` before the build is initiated.

0 commit comments

Comments
 (0)