forked from chadly/Geocoding.net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.targets
50 lines (41 loc) · 2.17 KB
/
common.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
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)packages\MSBuildTasks.1.4.0.65\tools\</MSBuildCommunityTasksPath>
<major Condition="'$(major)'==''">1</major>
<minor Condition="'$(minor)'==''">0</minor>
<patch Condition="'$(patch)'==''">0</patch>
<build Condition="'$(build)'==''">0</build>
<version>$(major).$(minor).$(patch)</version>
<fileVersion>$(major).$(minor).$(patch).$(build)</fileVersion>
<nugetVersion Condition="$(prerelease) == ''">$(major).$(minor).$(patch)</nugetVersion>
<nugetVersion Condition="$(prerelease) != ''">$(major).$(minor).$(patch)-$(prerelease)</nugetVersion>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets" Condition="exists('$(MSBuildCommunityTasksPath)MSBuild.Community.Tasks.Targets')" />
<Target Name="CopyTemplateFiles" BeforeTargets="BeforeBuild">
<CreateItem Include="$(MSBuildProjectDirectory)\**\*.config.temp">
<Output TaskParameter="Include" ItemName="templateFiles" />
</CreateItem>
<Copy SourceFiles="@(templateFiles -> '%(FullPath)')"
DestinationFiles="@(templateFiles -> '%(RootDir)%(Directory)%(Filename)')"
Condition="!Exists('%(templateFiles.RootDir)%(templateFiles.Directory)%(templateFiles.Filename)')" />
</Target>
<Target Name="CleanTemplateFiles" AfterTargets="Clean">
<CreateItem Include="$(MSBuildProjectDirectory)\**\*.config.temp">
<Output TaskParameter="Include" ItemName="templateFiles" />
</CreateItem>
<Delete Files="@(templateFiles -> '%(RootDir)%(Directory)%(Filename)')" />
</Target>
<Target Name="Version" Condition="!Exists('Properties\AssemblyVersion.cs')" BeforeTargets="BeforeBuild">
<AssemblyInfo
CodeLanguage="CS"
OutputFile="Properties\AssemblyVersion.cs"
AssemblyConfiguration="$(configuration)"
AssemblyVersion="$(version)"
AssemblyFileVersion="$(fileVersion)"
AssemblyInformationalVersion="$(nugetVersion)" />
</Target>
<Target Name="CleanVersionFiles" AfterTargets="Clean">
<Delete Files="Properties\AssemblyVersion.cs" />
</Target>
</Project>