forked from loresoft/msbuildtasks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Master-helper.proj
137 lines (113 loc) · 5.23 KB
/
Master-helper.proj
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Build\MSBuild.Community.Tasks.Targets" />
<PropertyGroup>
<Major>1</Major>
<Minor>4</Minor>
<Build>0</Build>
<Revision>0</Revision>
<BindMinor>4</BindMinor>
<BindBuild>0</BindBuild>
<BindRevision>0</BindRevision>
</PropertyGroup>
<PropertyGroup Condition=" '$(BUILD_NUMBER)' != '' ">
<!-- TeamCity Build Number -->
<Revision>$(BUILD_NUMBER)</Revision>
</PropertyGroup>
<ItemGroup>
<DefaultExclude Include="**\.git\**" />
<DefaultExclude Include="**\.git*" />
<DefaultExclude Include="**\bin\**" />
<DefaultExclude Include="**\Bootstrap\**" />
<DefaultExclude Include="**\obj\**" />
<DefaultExclude Include="**\Release\**" />
<DefaultExclude Include="**\Debug\**" />
<DefaultExclude Include="**\packages\**" />
<DefaultExclude Include="**\Test\**" />
<DefaultExclude Include="**\TestResults\**" />
<DefaultExclude Include="**\doc\**" />
<DefaultExclude Include="**\*.user" />
<DefaultExclude Include="**\*.suo" />
<DefaultExclude Include="**\*.patch" />
<DefaultExclude Include="**\*.resharper" />
<DefaultExclude Include="**\*.cache" />
<DefaultExclude Include="**\_ReSharper*\**" />
<DefaultExclude Include="*.teamcity*" />
<DefaultExclude Include="*.zip" />
</ItemGroup>
<Target Name="VerifyCalledFromMaster">
<Error Text="Do not execute $(MSBuildProjectFile) directly. Build Master.proj instead."
Condition="'$(CalledFromMaster)'!='true'" />
</Target>
<Target Name="Initialize" DependsOnTargets="VerifyCalledFromMaster">
<Message Text="Beginning Build." />
</Target>
<Target Name="Version" DependsOnTargets="Initialize">
<GitVersion LocalPath="$(MSBuildProjectDirectory)">
<Output TaskParameter="CommitHash" PropertyName="CommitHash" />
</GitVersion>
<Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
<Message Text="Commit Hash: $(CommitHash)"/>
<Time>
<Output TaskParameter="Month" PropertyName="Month" />
<Output TaskParameter="Day" PropertyName="Day" />
<Output TaskParameter="Year" PropertyName="Year" />
</Time>
<AssemblyInfo CodeLanguage="CS"
OutputFile="Source\GlobalAssemblyInfo.cs"
GenerateClass="true"
AssemblyCompany="https://github.com/loresoft/msbuildtasks/"
AssemblyProduct="MSBuild.Community.Tasks"
AssemblyCopyright="Copyright © $(Year) MSBuild Community Tasks Project"
AssemblyConfiguration="Commit $(CommitHash)"
ComVisible="false"
CLSCompliant="false"
AssemblyVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyFileVersion="$(Major).$(Minor).$(Build).$(Revision)"
AssemblyInformationalVersion="$(Major).$(Minor).$(Build).$(Revision)" />
</Target>
<Target Name="Compile" DependsOnTargets="Version">
<MSBuild Projects="Source\MSBuild.Community.Tasks.sln"
Properties="Configuration=Release" />
</Target>
<Target Name="Merge" DependsOnTargets="Compile">
<Copy SourceFiles="Build\MSBuild.Community.Tasks.dll"
DestinationFiles="Build\MSBuild.Temp.dll" />
<!-- Merge together files -->
<ILMerge InputAssemblies="Build\MSBuild.Temp.dll;Build\Ionic.Zip.Reduced.dll"
Internalize="true"
OutputFile="Build\MSBuild.Community.Tasks.dll"
KeyFile="Source\MSBuild.Community.Tasks\MSBuild.Community.Tasks.snk" />
<!-- Cleanup unneed files -->
<CreateItem Include="Build\*.dll;Build\*.x*l" Exclude="Build\MSBuild.Community.Tasks.*" >
<Output TaskParameter="Include" ItemName="PurgeBuildFiles" />
</CreateItem>
<Delete Files="@(PurgeBuildFiles)" />
</Target>
<Target Name="Documentation" DependsOnTargets="Compile">
<TaskSchema Assemblies="Build\MSBuild.Community.Tasks.dll"
OutputPath="Build"
CreateTaskList="false"
IgnoreMsBuildSchema="true"
Includes="Microsoft.Build.Commontypes.xsd"/>
</Target>
<Target Name="Zip" DependsOnTargets="Documentation;Merge">
<CreateItem Include="**\*.*" Exclude="@(DefaultExclude)" >
<Output TaskParameter="Include" ItemName="ZipFiles" />
</CreateItem>
<Zip Files="@(ZipFiles)"
ZipFileName="MSBuild.Community.Tasks.v$(Major).$(Minor).$(Build).$(Revision).zip" />
</Target>
<Target Name="Installer" DependsOnTargets="Compile;Documentation;Merge">
<MSBuild Projects="Source\MSBuild.Community.Tasks.Setup\MSBuildTasks.wixproj"
Properties="Configuration=Release;Major=$(Major);Minor=$(Minor);Build=$(Build);Revision=$(Revision)" />
<Copy SourceFiles="Source\MSBuild.Community.Tasks.Setup\bin\Release\MSBuild.Community.Tasks.msi"
DestinationFiles="MSBuild.Community.Tasks.v$(Major).$(Minor).$(Build).$(Revision).msi" />
</Target>
<Target Name="Build" DependsOnTargets="Zip;Installer">
<Message Text="Build Complete"/>
</Target>
<Target Name="Nightly" DependsOnTargets="Build">
<Message Text="Build Committed Revision: $(Revision)" />
</Target>
</Project>