forked from SharpMap/SharpMap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharpMap.targets
59 lines (54 loc) · 2.61 KB
/
SharpMap.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
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
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)BuildTools</MSBuildCommunityTasksPath>
<!-- SharpMap version -->
<Major>1</Major>
<Minor>2</Minor>
<Build>0</Build>
<Revision>0</Revision>
<UseTools35 Condition=" '$(UseTools35)' == '' ">true</UseTools35>
<VersionTargetName Condition=" '$(UseTools35)' == 'true' ">VersionGit</VersionTargetName>
<VersionTargetName Condition=" '$(UseTools35)' == 'false' ">VersionNoTools35</VersionTargetName>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)BuildTools\MSBuild.Community.Tasks.targets"/>
<Target Name="Version">
<Message Text="Running $(VersionTargetName)"/>
<CallTarget Targets="$(VersionTargetName)"/>
</Target>
<Target Name="VersionGit">
<Message Text="Building revision from git..." />
<GitVersion LocalPath="$(MSBuildThisFileDirectory)" ContinueOnError="ErrorAndStop">
<Output TaskParameter="CommitHash" PropertyName="Revision" />
</GitVersion>
<AssemblyInfo
CodeLanguage="CS"
OutputFile="$(MSBuildThisFileDirectory)SharedAssemblyVersion.cs"
AssemblyInformationalVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyVersion="$(Major).$(Minor).$(Build)"
AssemblyFileVersion="$(Major).$(Minor).$(Build)" />
<OnError ExecuteTargets="VersionNoTools35"/>
</Target>
<Target Name="VersionNoTools35">
<Message Text="Building revision from git commit hash failed, or Microsoft.Build.Utilities.v3.5 could not be found." />
<ItemGroup>
<AssemblyAttributes Include="AssemblyVersion">
<_Parameter1>$(Major).$(Minor).$(Build)</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="AssemblyFileVersion">
<_Parameter1>$(Major).$(Minor).$(Build)</_Parameter1>
</AssemblyAttributes>
<AssemblyAttributes Include="AssemblyInformationalVersion">
<_Parameter1>$(Major).$(Minor).$(Build).9999999</_Parameter1>
</AssemblyAttributes>
</ItemGroup>
<WriteCodeFragment Language="C#" OutputFile="$(MSBuildThisFileDirectory)SharedAssemblyVersion.cs" AssemblyAttributes="@(AssemblyAttributes)" />
<!--
<AssemblyInfo
CodeLanguage="CS"
OutputFile="$(MSBuildThisFileDirectory)SharedAssemblyVersion.cs"
AssemblyInformationalVersion="$(Major).$(Minor).$(Build).9999999"
AssemblyVersion="$(Major).$(Minor).$(Build)"
AssemblyFileVersion="$(Major).$(Minor).$(Build)" />
-->
</Target>
</Project>