-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Directory.Build.targets
33 lines (29 loc) · 1.66 KB
/
Directory.Build.targets
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
<Project>
<!--
Directory.Build.targets is automatically picked up and imported by
Microsoft.Common.targets. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
instead. The import fairly late and most other props/targets will have been
imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
<!--
Manually set the version if null. This is copied from Microsoft.NET.DefaultAssemblyInfo.targets and is needed
for cases where that target is not being automatically imported (which happens because MSBuild is used instead
of dotnet build for some cases, due to the solution having some UWP and WinUI 3 projects, and non SDK-style too).
The lines setting the prefix have been omitted, as that is already handled in the root .props file.
-->
<PropertyGroup Condition="'$(Version)' == ''">
<Version Condition="'$(VersionSuffix)' != ''">$(VersionPrefix)-$(VersionSuffix)</Version>
<Version Condition="'$(Version)' == ''">$(VersionPrefix)</Version>
</PropertyGroup>
<!-- Set the base package version (this applies to all build types) -->
<PropertyGroup>
<PackageVersion>$(Version)</PackageVersion>
</PropertyGroup>
<!-- Settings that are only set for CI builds -->
<PropertyGroup Condition="'$(GITHUB_RUN_ID)' != ''">
<PackageVersion Condition="'$(IsCommitOnReleaseBranch)' != true">$(VersionPrefix)-$(VersionSuffix).$(GITHUB_RUN_ID)</PackageVersion>
<PackageVersion Condition="'$(GITHUB_SHA)' != ''">$(PackageVersion)+$(GITHUB_SHA)</PackageVersion>
</PropertyGroup>
</Project>