-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVersion.targets
20 lines (20 loc) · 1.05 KB
/
Version.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="utf-8"?>
<Project
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="GitVersion">
<PropertyGroup>
<!-- Dummy values allow dotnet restore to progress -->
<GitBaseVersionMajor>0</GitBaseVersionMajor>
<GitBaseVersionMinor>1</GitBaseVersionMinor>
<GitBaseVersionPatch>0</GitBaseVersionPatch>
<GitCommits>0</GitCommits>
</PropertyGroup>
</Target>
<Target Name="SetVersion" DependsOnTargets="GitVersion">
<PropertyGroup>
<PackageVersion Condition="'$(GitBranch)' == 'deploy'">$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)</PackageVersion>
<PackageVersion Condition="'$(GitBranch)' != 'deploy'">$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)-$(GitCommits)-$(GitCommit)</PackageVersion>
<AssemblyVersion>$(GitBaseVersionMajor).$(GitBaseVersionMinor).$(GitBaseVersionPatch)</AssemblyVersion>
</PropertyGroup>
</Target>
</Project>