forked from microsoft/dotnet-apiport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dir.targets
56 lines (50 loc) · 2.79 KB
/
dir.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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- When building from a dev machine, the BuildNumber won't be set, so set it to 0.1 to indicate this is a private build -->
<BuildVersion>0</BuildVersion>
<!-- Get build number from TFS if in automated build -->
<!-- Use TF_BUILD_BUILDNUMBER for old XAML style builds -->
<BuildVersion Condition=" '$(BUILD_BUILDNUMBER)' != '' ">$(BUILD_BUILDNUMBER.Split('.')[1].TrimStart('0'))</BuildVersion>
<BuildVersion>$(BuildVersion.PadLeft(5,"0"))</BuildVersion>
<!-- Get version info from file -->
<VersionFile>$(MSBuildProjectDirectory)\Properties\version.txt</VersionFile>
<VersionData>1.0.0</VersionData>
<VersionData Condition="Exists('$(VersionFile)')">$([System.IO.File]::ReadAllText($(VersionFile)).Trim())</VersionData>
<!-- Set informational version -->
<InformationVersion>$(VersionData)</InformationVersion>
<InformationVersion Condition=" '$(VersionSuffix)' != '' ">$(InformationVersion)-$(VersionSuffix)-$(BuildVersion)</InformationVersion>
</PropertyGroup>
<ItemGroup>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyVersionAttribute">
<_Parameter1>$(VersionData)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyFileVersionAttribute">
<_Parameter1>$(VersionData)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyInformationalVersionAttribute">
<_Parameter1>$(InformationVersion)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyTitle">
<_Parameter1>$(AssemblyName)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyProduct">
<_Parameter1>$(AssemblyName)</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCopyright">
<_Parameter1>Copyright 2016</_Parameter1>
</AssemblyVersionAttribute>
<AssemblyVersionAttribute Include="System.Reflection.AssemblyCompany">
<_Parameter1>Microsoft</_Parameter1>
</AssemblyVersionAttribute>
</ItemGroup>
<Target Name="GenerateAssemblyInfoFile">
<WriteCodeFragment AssemblyAttributes="@(AssemblyVersionAttribute)" Language="C#" OutputFile="$(IntermediateOutputPath)\_GlobalAssemblyInfo.g.cs">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
<PropertyGroup>
<CompileDependsOn>GenerateAssemblyInfoFile;$(CompileDependsOn)</CompileDependsOn>
</PropertyGroup>
</Project>