-
Notifications
You must be signed in to change notification settings - Fork 6
/
Build.proj
221 lines (191 loc) · 14.1 KB
/
Build.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildProjectDirectory)\BlueCollar.targets"/>
<UsingTask TaskName="FxCop" AssemblyFile="Tools\FxCopTask\FxCopTask.dll"/>
<PropertyGroup>
<ArtifactDir>$(MSBuildProjectDirectory)\Artifacts</ArtifactDir>
<AssemblyOriginatorKeyFile>$(MSBuildProjectDirectory)\BlueCollar.snk</AssemblyOriginatorKeyFile>
<BuildDir>$(MSBuildProjectDirectory)\Build</BuildDir>
<CompressAssets>true</CompressAssets>
<Configuration>Release</Configuration>
<ExamplesDir>$(MSBuildProjectDirectory)\Examples</ExamplesDir>
<InstallerDir>$(MSBuildProjectDirectory)\Source\Installer</InstallerDir>
<LibDir>$(MSBuildProjectDirectory)\Lib</LibDir>
<MsTestPath>$(MSBuildProgramFiles32)\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe</MsTestPath>
<SourceDir>$(MSBuildProjectDirectory)\Source</SourceDir>
<TempDir>$(MSBuildProjectDirectory)\Temp</TempDir>
<ToolsDir>$(MSBuildProjectDirectory)\Tools</ToolsDir>
<WixDir>$(MSBuildProgramFiles32)\Windows Installer XML v3.5\bin</WixDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' != 'Release'">
<CompressAssets>false</CompressAssets>
</PropertyGroup>
<PropertyGroup Condition="Exists('$(AssemblyOriginatorKeyFile)') And '$(Configuration)' == 'Release'">
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<ItemGroup>
<SolutionProjects Include="$(SourceDir)\BlueCollar\BlueCollar.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar\BlueCollar.Net35.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.Net35.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Dashboard\BlueCollar.Dashboard.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Examples\BlueCollar.Examples.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Examples\BlueCollar.Examples.Net35.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Service\BlueCollar.Service.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Service\BlueCollar.Service.Net35.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.SQLiteRepository\BlueCollar.SQLiteRepository.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.SQLiteRepository\BlueCollar.SQLiteRepository.Net35.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Test\BlueCollar.Test.csproj"/>
<SolutionProjects Include="$(SourceDir)\BlueCollar.Test\BlueCollar.Test.Net35.csproj"/>
</ItemGroup>
<Target Name="Build">
<MakeDir Directories="$(BuildDir)"/>
<MakeDir Directories="$(BuildDir)\Reference Assemblies"/>
<!-- .NET 4.0 reference assemblies. -->
<MakeDir Directories="$(BuildDir)\Reference Assemblies\Net40"/>
<MSBuild Projects="$(SourceDir)\BlueCollar\BlueCollar.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);CompressAssets=$(CompressAssets);MergedLibraryOutputPath=$(BuildDir)\Reference Assemblies\Net40"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.SQLiteRepository\BlueCollar.SQLiteRepository.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedSQLiteRepositoryOutputPath=$(BuildDir)\Reference Assemblies\Net40"/>
<!-- .NET 3.5 reference assemblies. -->
<MakeDir Directories="$(BuildDir)\Reference Assemblies\Net35"/>
<MSBuild Projects="$(SourceDir)\BlueCollar\BlueCollar.Net35.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);CompressAssets=$(CompressAssets);MergedLibraryOutputPath=$(BuildDir)\Reference Assemblies\Net35"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.SQLiteRepository\BlueCollar.SQLiteRepository.Net35.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedSQLiteRepositoryOutputPath=$(BuildDir)\Reference Assemblies\Net35"/>
<!-- Root service. -->
<MakeDir Directories="$(BuildDir)\Service"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Service\BlueCollar.Service.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedServiceOutputPath=$(BuildDir)\Service"/>
<ItemGroup>
<ExampleReferenceNet40 Include="$(BuildDir)\Reference Assemblies\Net40\BlueCollar.*"/>
<ExampleReferenceNet35 Include="$(BuildDir)\Reference Assemblies\Net35\BlueCollar.*"/>
<ReferenceNet40 Include="$(BuildDir)\Reference Assemblies\Net40\BlueCollar.dll"/>
<ReferenceNet35 Include="$(BuildDir)\Reference Assemblies\Net35\BlueCollar.dll"/>
</ItemGroup>
<!-- Console AnyCPU. -->
<MakeDir Directories="$(BuildDir)\Service\AnyCPU"/>
<MakeDir Directories="$(BuildDir)\Service\AnyCPU\Net40"/>
<MakeDir Directories="$(BuildDir)\Service\AnyCPU\Net35"/>
<Copy SourceFiles="@(ReferenceNet40)" DestinationFolder="$(BuildDir)\Service\AnyCPU\Net40"/>
<Copy SourceFiles="@(ReferenceNet35)" DestinationFolder="$(BuildDir)\Service\AnyCPU\Net35"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedConsoleOutputPath=$(BuildDir)\Service\AnyCPU\Net40"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.Net35.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedConsoleOutputPath=$(BuildDir)\Service\AnyCPU\Net35"/>
<!-- Console x86. -->
<MakeDir Directories="$(BuildDir)\Service\x86"/>
<MakeDir Directories="$(BuildDir)\Service\x86\Net40"/>
<MakeDir Directories="$(BuildDir)\Service\x86\Net35"/>
<Copy SourceFiles="@(ReferenceNet40)" DestinationFolder="$(BuildDir)\Service\x86\Net40"/>
<Copy SourceFiles="@(ReferenceNet35)" DestinationFolder="$(BuildDir)\Service\x86\Net35"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);Platform=x86;SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedConsoleOutputPath=$(BuildDir)\Service\x86\Net40"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Console\BlueCollar.Console.Net35.csproj" Targets="Clean;Build" Properties="Configuration=$(Configuration);Platform=x86;SignAssembly=$(SignAssembly);AssemblyOriginatorKeyFile=$(AssemblyOriginatorKeyFile);MergedConsoleOutputPath=$(BuildDir)\Service\x86\Net35"/>
<!-- SQL scripts. -->
<MakeDir Directories="$(BuildDir)\Schemas"/>
<ItemGroup>
<Schemas Include="$(SourceDir)\BlueCollar\SqlServer.Schema.sql"/>
<Schemas Include="$(SourceDir)\BlueCollar.SQLiteRepository\SQLite.Schema.sql"/>
</ItemGroup>
<Copy SourceFiles="@(Schemas)" DestinationFolder="$(BuildDir)\Schemas"/>
<!-- .NET 4.0 examples. -->
<MSBuild Projects="$(SourceDir)\BlueCollar.Examples\BlueCollar.Examples.csproj" Properties="Configuration=Debug"/>
<ItemGroup>
<ExamplesNet40 Include="$(SourceDir)\BlueCollar.Examples\bin\Debug\BlueCollar.Examples.*"/>
</ItemGroup>
<Copy SourceFiles="@(ExampleReferenceNet40)" DestinationFolder="$(ExamplesDir)\Mvc\BlueCollar.Examples.Mvc\bin"/>
<Copy SourceFiles="@(ExamplesNet40)" DestinationFolder="$(ExamplesDir)\Mvc\BlueCollar.Examples.Mvc\bin"/>
<!-- .NET 3.5 examples. -->
<MSBuild Projects="$(SourceDir)\BlueCollar.Examples\BlueCollar.Examples.Net35.csproj" Properties="Configuration=Debug"/>
<ItemGroup>
<ExamplesNet35 Include="$(SourceDir)\BlueCollar.Examples\bin\Debug\BlueCollar.Examples.*"/>
</ItemGroup>
<Copy SourceFiles="@(ExampleReferenceNet35)" DestinationFolder="$(ExamplesDir)\Webpages\BlueCollar.Examples.Webpages\bin"/>
<Copy SourceFiles="@(ExamplesNet35)" DestinationFolder="$(ExamplesDir)\Webpages\BlueCollar.Examples.Webpages\bin"/>
<!-- Package the example projects. -->
<CallTarget Targets="PackageExamples"/>
<!-- Copy over the README and LICENSE. -->
<Copy SourceFiles="$(RootDir)\README.md" DestinationFiles="$(BuildDir)\README.txt"/>
<Copy SourceFiles="$(RootDir)\LICENSE.txt" DestinationFolder="$(BuildDir)"/>
</Target>
<Target Name="Clean">
<ItemGroup>
<CleanFiles Include="$(ArtifactDir)\**\*"/>
<CleanFiles Include="$(BuildDir)\**\*"/>
<CleanFiles Include="$(TempDir)\**\*"/>
</ItemGroup>
<Delete Files="@(CleanFiles)"/>
<RemoveDir Directories="$(ArtifactDir)"/>
<RemoveDir Directories="$(BuildDir)"/>
<RemoveDir Directories="$(TempDir)"/>
<MSBuild Projects="@(SolutionProjects)" Targets="Clean" Properties="Configuration=$(Configuration)"/>
</Target>
<Target Name="FxCop">
<MSBuild Projects="@(SolutionProjects)" Targets="Clean;Build" Properties="Configuration=Debug"/>
<ItemGroup>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar\bin\Debug\BlueCollar.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.Console\bin\Debug\BlueCollar.Console.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.Dashboard\bin\Debug\BlueCollar.Dashboard.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.Examples\bin\Debug\BlueCollar.Examples.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.Service\bin\Debug\BlueCollar.Service.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.SQLiteRepository\bin\Debug\BlueCollar.SQLiteRepository.dll"/>
<FxCopAssemblies Include="$(SourceDir)\BlueCollar.Test\bin\Debug\BlueCollar.Test.dll"/>
</ItemGroup>
<MakeDir Directories="$(ArtifactDir)"/>
<FxCop Assemblies="@(FxCopAssemblies)" Output="$(ArtifactDir)\FxCop.xml"/>
</Target>
<Target Name="Help">
<MSBuild Projects="$(SourceDir)\BlueCollar\BlueCollar.csproj" Properties="Configuration=$(Configuration)"/>
<MakeDir Directories="$(BuildDir)"/>
<PropertyGroup>
<DocsInputAssemblyPath>$(SourceDir)\BlueCollar\bin\$(Configuration)\BlueCollar.dll</DocsInputAssemblyPath>
<DocsInputCommentsPath>$(SourceDir)\BlueCollar\bin\$(Configuration)\BlueCollar.xml</DocsInputCommentsPath>
<DocsOutputPath>$(BuildDir)\BlueCollar.chm</DocsOutputPath>
<DocsProjectName>BlueCollar</DocsProjectName>
<DocsStagingDir>$(ArtifactDir)\Docs</DocsStagingDir>
</PropertyGroup>
<MSBuild Projects="BlueCollar.targets" Targets="GenerateDocs" Properties="DocsInputAssemblyPath=$(DocsInputAssemblyPath);DocsInputCommentsPath=$(DocsInputCommentsPath);DocsOutputPath=$(DocsOutputPath);DocsProjectName=$(DocsProjectName);DocsStagingDir=$(DocsStagingDir)"/>
<RemoveDir Directories="$(DocsStagingDir)"/>
</Target>
<Target Name="NuGet" DependsOnTargets="GetVersion">
<Exec Command='"$(ToolsDir)\NuGet\nuget.exe" Pack BlueCollar.nuspec'/>
<Copy SourceFiles="$(RootDir)\BlueCollar.$(Major).$(Minor).$(Build).nupkg" DestinationFolder="$(BuildDir)"/>
<Delete Files="$(RootDir)\BlueCollar.$(Major).$(Minor).$(Build).nupkg"/>
</Target>
<Target Name="Package" DependsOnTargets="Clean;Build;SetPackageVersion">
<ItemGroup>
<BuildFiles Include="$(BuildDir)\**\*"/>
<BuildFiles Remove="$(BuildDir)\Examples.zip"/>
<InstallerFiles Include="$(SourceDir)\Installer\**\*"/>
</ItemGroup>
<MakeDir Directories="$(TempDir)"/>
<Copy SourceFiles="@(BuildFiles)" DestinationFiles="@(BuildFiles->'$(TempDir)\%(RecursiveDir)%(Filename)%(Extension)')"/>
<Copy SourceFiles="@(InstallerFiles)" DestinationFolder="$(TempDir)"/>
<Exec Command='"$(WixDir)\candle.exe" "$(TempDir)\BlueCollar.wxs"' WorkingDirectory="$(TempDir)"/>
<Exec Command='"$(WixDir)\light.exe" -ext WixUIExtension -ext WiXNetFxExtension -out BlueCollar.msi "$(TempDir)\BlueCollar.wixobj"' WorkingDirectory="$(TempDir)"/>
<Zip Files="@(BuildFiles)" ZipFileName="$(TempDir)\BlueCollar-$(Major).$(Minor).$(Build).zip" WorkingDirectory="$(BuildDir)"/>
<Copy SourceFiles="$(TempDir)\BlueCollar-$(Major).$(Minor).$(Build).zip" DestinationFolder="$(BuildDir)"/>
<Copy SourceFiles="$(TempDir)\BlueCollar.msi" DestinationFolder="$(BuildDir)"/>
<RemoveDir Directories="$(TempDir)"/>
<CallTarget Targets="NuGet"/>
</Target>
<Target Name="PackageExamples">
<MakeDir Directories="$(BuildDir)\Examples"/>
<ItemGroup>
<ExamplesFiles Include="$(ExamplesDir)\**\*"/>
</ItemGroup>
<Copy SourceFiles="@(ExamplesFiles)" DestinationFiles="@(ExamplesFiles->'$(BuildDir)\Examples\%(RecursiveDir)%(Filename)%(Extension)')"/>
<ItemGroup>
<ExamplesCleanFiles Include="$(BuildDir)\Examples\**\*.suo"/>
<ExamplesCleanFiles Include="$(BuildDir)\Examples\**\*.csproj.user"/>
<ExamplesCleanFiles Include="$(BuildDir)\Examples\**\App_Data\**\*"/>
<ExamplesCleanFiles Include="$(BuildDir)\Examples\**\bin\System.Data.SQLite.*"/>
<ExamplesCleanFiles Include="$(BuildDir)\Examples\**\obj\**\*"/>
</ItemGroup>
<Delete Files="@(ExamplesCleanFiles)"/>
<ItemGroup>
<ExamplePackageFiles Include="$(BuildDir)\Examples\**\*"/>
</ItemGroup>
<Zip Files="@(ExamplePackageFiles)" ZipFileName="$(BuildDir)\Examples.zip" WorkingDirectory="$(BuildDir)\Examples"/>
<RemoveDir Directories="$(BuildDir)\Examples"/>
</Target>
<Target Name="Test" Condition="Exists('$(MsTestPath)')">
<MakeDir Directories="$(ArtifactDir)"/>
<Delete Files="$(ArtifactDir)\Tests.trx"/>
<MSBuild Projects="$(SourceDir)\BlueCollar.Test\BlueCollar.Test.csproj" Properties="Configuration=Debug"/>
<Exec Command='"$(MsTestPath)" /testcontainer:"$(SourceDir)\BlueCollar.Test\bin\Debug\BlueCollar.Test.dll" /runconfig:"$(SourceDir)\Local.testsettings" /resultsfile:"$(ArtifactDir)\Tests.trx"'/>
<RemoveDir Directories='$([System.IO.Directory]::GetDirectories("$(ArtifactDir)"))'/>
</Target>
</Project>