forked from mookid8000/Cirqus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.proj
110 lines (87 loc) · 6.06 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
<Project DefaultTargets="build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.Build.Tasks.XmlPoke" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<PropertyGroup>
<Root>.</Root>
<BuildOutputFolder>$(Root)\deploy</BuildOutputFolder>
<NuSpecFolder>$(Root)\nuspec</NuSpecFolder>
<ToolsFolder>$(Root)\tools</ToolsFolder>
<NuGetFolder>$(ToolsFolder)\NuGet</NuGetFolder>
<ReleaseMaster>$(ToolsFolder)\ReleaseMaster\ReleaseMaster.exe</ReleaseMaster>
<IlMerge>$(ToolsFolder)\IlMerge\ilmerge.exe</IlMerge>
</PropertyGroup>
<ItemGroup>
<NuSpecFiles Include="$(NuSpecFolder)\*.nuspec" />
<DependantNuSpecFiles Include="$(NuSpecFolder)\*.nuspec" Exclude="$(NuSpecFolder)\d60.Cirqus.nuspec" />
</ItemGroup>
<Target Name="PrintNuSpec">
<Message Text="NuSpecFiles: @(NuSpecFiles)"/>
<Message Text="DepNuSpecFiles: @(DependantNuSpecFiles)"/>
</Target>
<Target Name="release">
<Exec Command="$(ReleaseMaster) "$(Root)" "msbuild" "build.proj /t:release_packages /p:Version={version}""/>
</Target>
<Target Name="release_packages" DependsOnTargets="validate_version_is_present">
<Error Condition="'$(NuggieRepoPath)' == ''" Text="Cannot publish packages because the NuggieRepoPath environment variable has not been set."/>
<CallTarget Targets="publish_packages"/>
</Target>
<Target Name="build" DependsOnTargets="clean_output_folder; build_solution" />
<Target Name="clean_output_folder">
<Message Text="Removing old output folder"/>
<RemoveDir Directories="$(BuildOutputFolder)" ContinueOnError="true"/>
</Target>
<Target Name="build_solution">
<!--<ItemGroup>
<DllsToBeMerged Include="$(Root)\d60.Cirqus\bin\Release\d60.Cirqus.dll"/>
<DllsToBeMerged Include="$(Root)\d60.Cirqus.TsClient\bin\Release\d60.Cirqus.TsClient.exe"/>
<DllsToBeMerged Include="$(Root)\d60.Cirqus.MongoDb\bin\Release\d60.Cirqus.MongoDb.dll"/>
</ItemGroup>-->
<PropertyGroup>
<CoreBuildOutputDirectory>$(Root)\d60.Cirqus\bin\Release</CoreBuildOutputDirectory>
<CoreDestinationForMergedFile>$(CoreBuildOutputDirectory)\merged</CoreDestinationForMergedFile>
<MongoDbBuildOutputDirectory>$(Root)\d60.Cirqus.MongoDb\bin\Release</MongoDbBuildOutputDirectory>
<MongoDbDestinationForMergedFile>$(MongoDbBuildOutputDirectory)\merged</MongoDbDestinationForMergedFile>
<TsClientBuildOutputDirectory>$(Root)\d60.Cirqus.TsClient\bin\Release</TsClientBuildOutputDirectory>
<TsClientDestinationForMergedFile>$(TsClientBuildOutputDirectory)\merged</TsClientDestinationForMergedFile>
<IdentityBuildOutputDirectory>$(Root)\d60.Cirqus.Identity\bin\Release</IdentityBuildOutputDirectory>
<IdentityDestinationForMergedFile>$(IdentityBuildOutputDirectory)\merged</IdentityDestinationForMergedFile>
<ReferenceAssemblies>$(ProgramFiles)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5</ReferenceAssemblies>
</PropertyGroup>
<Message Text="Building everything"/>
<MSBuild Projects="Cirqus.sln" Targets="rebuild" StopOnFirstFailure="true" Properties="Configuration=Release">
<Output TaskParameter="TargetOutputs" ItemName="AssembliesBuilt" />
</MSBuild>
<MakeDir Directories="$(CoreDestinationForMergedFile)"/>
<MakeDir Directories="$(MongoDbDestinationForMergedFile)"/>
<MakeDir Directories="$(TsClientDestinationForMergedFile)"/>
<MakeDir Directories="$(IdentityDestinationForMergedFile)"/>
<Exec Command="$(IlMerge) /out:$(CoreDestinationForMergedFile)\d60.Cirqus.dll $(CoreBuildOutputDirectory)\d60.Cirqus.dll $(CoreBuildOutputDirectory)\Newtonsoft.Json.dll /targetplatform:"v4,$(ReferenceAssemblies)" /internalize" />
<Exec Command="$(IlMerge) /out:$(MongoDbDestinationForMergedFile)\d60.Cirqus.MongoDb.dll $(MongoDbBuildOutputDirectory)\d60.Cirqus.MongoDb.dll $(MongoDbBuildOutputDirectory)\Newtonsoft.Json.dll /targetplatform:"v4,$(ReferenceAssemblies)" /internalize" />
<Exec Command="$(IlMerge) /out:$(TsClientDestinationForMergedFile)\d60.Cirqus.TsClient.exe $(TsClientBuildOutputDirectory)\d60.Cirqus.TsClient.exe $(TsClientBuildOutputDirectory)\Newtonsoft.Json.dll /targetplatform:"v4,$(ReferenceAssemblies)" /internalize" />
<Exec Command="$(IlMerge) /out:$(IdentityDestinationForMergedFile)\d60.Cirqus.Identity.dll $(IdentityBuildOutputDirectory)\d60.Cirqus.Identity.dll $(IdentityBuildOutputDirectory)\Sprache.dll /targetplatform:"v4,$(ReferenceAssemblies)" /internalize" />
</Target>
<Target Name="validate_version_is_present">
<Error Condition="'$(Version)' == ''" Text="No version specified! The version parameter must be specified in order to build & release NuGet packages"/>
</Target>
<Target Name="create_packages" DependsOnTargets="validate_version_is_present; build">
<PropertyGroup>
<PackagesOutputFolder>$(BuildOutputFolder)\publish</PackagesOutputFolder>
</PropertyGroup>
<ItemGroup>
<NuSpecs Include="$(Root)\**\*.nuspec"/>
</ItemGroup>
<Message Text="NUSPECS: %(NuSpecs.FullPath)"/>
<MakeDir Directories="$(PackagesOutputFolder)"/>
<Exec Command="$(NuGetFolder)\nuget.exe pack %(NuSpecs.FullPath) -OutputDirectory $(PackagesOutputFolder) -Version $(Version)"/>
</Target>
<Target Name="publish_packages" DependsOnTargets="validate_nuget_environment_variable; create_packages">
<ItemGroup>
<GeneratedPackages Include="$(BuildOutputFolder)/publish/*.nupkg"/>
</ItemGroup>
<Message Text="Pushing NuGet packages to d60 Nuggie Repo..." Condition="'$(NuggieRepoPath)' != ''"/>
<Copy SourceFiles="@(GeneratedPackages)" DestinationFolder="$(NuggieRepoPath)" Condition="'$(NuggieRepoPath)' != ''"/>
</Target>
<Target Name="validate_nuget_environment_variable">
<Error Condition="'$(NuggieRepoPath)' == ''"
Text="In order to publish NuGet packages you need to define an environment variable NuggieRepoPath to point to our NuGet repository in Dropbox"/>
</Target>
</Project>