Repository navigation
Expand file tree
/
Copy pathversion.props
More file actions
65 lines (61 loc) · 3.23 KB
/
Copy pathversion.props
File metadata and controls
65 lines (61 loc) · 3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<Project>
<ItemGroup Condition="$(NBGV_PublicRelease) != 'True' AND '$(CODEQL_RUNNER)' == '' AND '$(Dockerbuild)' != 'true'">
<!-- Note: Versions such as 3.6.146, where known working for 4 digit versioning -->
<PackageReference Include="Nerdbank.GitVersioning">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<!-- set version manually in docker builds -->
<PropertyGroup Condition="'$(Dockerbuild)' == 'true'">
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
</PropertyGroup>
<!-- NBGV_ variables are only available in cloud build -->
<PropertyGroup Condition="'$(NBGV_PublicRelease)' == 'True'">
<!--
NBGV_Version is an assembly/build version and may contain a fourth
git-height component (for example 2.0.0.7). Packages instead use the
canonical SemVer value NBGV_NuGetPackageVersion (2.0.0): patch numbers
are explicit release decisions in version.json, never commit counts.
See docs/ReleaseProcess.md.
-->
<Version>$(NBGV_NuGetPackageVersion)</Version>
<VersionPrefix>$(NBGV_SimpleVersion)</VersionPrefix>
<VersionSuffix>$(NBGV_PrereleaseVersion)</VersionSuffix>
<AssemblyVersion>$(NBGV_SimpleVersion)</AssemblyVersion>
<FileVersion>$(NBGV_Version)</FileVersion>
<PackageVersion>$(NBGV_NuGetPackageVersion)</PackageVersion>
</PropertyGroup>
<!--
Do not let Nerdbank.GitVersioning publish cloud build variables from inside
MSBuild. Its SetCloudBuildVersionVars target runs once per project, and on
GitHub Actions the provider implements "set a variable" as an append to the
file named by $GITHUB_ENV. Builds here are deliberately parallel across
MSBuild nodes (see .github/scripts/run-dotnet-tests.ps1), so
several nodes append GitAssemblyInformationalVersion / GitBuildVersion /
GitBuildVersionSimple to that one file concurrently. Interleaved appends tear
a line, and the runner then rejects the leftover fragment after the compile
has already succeeded:
Build succeeded. 0 Error(s)
##[error]Unable to process file command 'env' successfully.
##[error]Invalid format '7'
('7' being the tail of a torn `GitBuildVersion=2.0.3x7.yyyyy`.) See issue
#4458.
Nothing reads these three variables: every workflow and pipeline that
consumes version information runs .azurepipelines/set-version.ps1 first, and
`nbgv cloud -c -a` there writes the same Git* variables plus the NBGV_* set
that version.props and common.props actually use - once, from a single
process, with no concurrency. This leaves that script as the only writer.
Note this is deliberately an MSBuild property rather than
cloudBuild.setVersionVariables in version.json: the version height is the
number of commits since version.json last changed, so editing that file at
all would reset the height to 0 and drop every produced version from
2.0.<height> to 2.0.0.
-->
<PropertyGroup>
<NBGV_SetCloudBuildVersionVars>false</NBGV_SetCloudBuildVersionVars>
</PropertyGroup>
<PropertyGroup>
<GitVersionBaseDirectory>$(MSBuildThisFileDirectory)</GitVersionBaseDirectory>
</PropertyGroup>
</Project>