forked from sharpdx/SharpDX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSharpDX.build
192 lines (156 loc) · 8.54 KB
/
SharpDX.build
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
<!--
// Copyright (c) 2010-2013 SharpDX - Alexandre Mutel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-->
<!-- Common Settings used by SharpDX projects -->
<Project DefaultTarget="Help" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SharpDXSolution>SharpDX.sln</SharpDXSolution>
<SharpDXSolutionWP8>SharpDXWP8.sln</SharpDXSolutionWP8>
<SamplesDirectory>Samples</SamplesDirectory>
<GitExe>"C:\Program Files (x86)\Git\bin\git.exe"</GitExe>
<SharpDXDevZip>SharpDX-SDK-LatestDev.exe</SharpDXDevZip>
<ExtensionTasksPath>$(MSBuildThisFileDirectory)\External\MSBuildExtensionPack\</ExtensionTasksPath>
<SharpDXNightlyBuildsPath Condition="'$(SharpDXNightlyBuildsPath)' == ''">$(MSBuildThisFileDirectory)..\SharpDXNightlyBuilds\</SharpDXNightlyBuildsPath>
<BuildSignedSharpDX>true</BuildSignedSharpDX>
</PropertyGroup>
<Import Project="$(ExtensionTasksPath)MSBuild.ExtensionPack.tasks"/>
<Target Name="Help">
<Message Importance="high" Text="Use parameter /t:Pre-Build;Build to build SharpDX assemblies for non WP8 platforms. And /t:BuildForVS2012 for WP8"/>
</Target>
<Target Name="Pre-Build">
<CallTarget Targets="GitCheckout"/>
</Target>
<Target Name="Post-Build">
<CallTarget Targets="GitUpdate"/>
<CallTarget Targets="ZipBuild"/>
<CallTarget Targets="FtpZip"/>
</Target>
<Target Name="Build">
<!--Build all targets / platforms-->
<Exec Command="RMDIR /Q /S $(MSBuildThisFileDirectory)\Bin"/>
<CallTarget Targets="BuildSigned" Condition="'$(BuildSignedSharpDX)' == 'true'"/>
<CallTarget Targets="DesktopNet20" />
<CallTarget Targets="DesktopNet40" />
<CallTarget Targets="MetroWin8" />
<CallTarget Targets="DesktopDx112" />
<CallTarget Targets="CopyD3DRedistributionFiles" />
</Target>
<Target Name="BuildForVS2012">
<CallTarget Targets="WP8x86" />
<CallTarget Targets="WP8ARM" />
</Target>
<Target Name="BuildSigned">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Net20Release;Platform=Any CPU;SharpDXSign=true"/>
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Net40Release;Platform=Any CPU;SharpDXSign=true"/>
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Win8Release;Platform=Any CPU;SharpDXSign=true"/>
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=DIRECTX11_2Release;Platform=Any CPU;SharpDXSign=true"/>
</Target>
<Target Name="DesktopNet20">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Net20Release;Platform=Any CPU"/>
</Target>
<Target Name="DesktopNet40">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Net40Release;Platform=Any CPU"/>
</Target>
<Target Name="MetroWin8">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=Win8Release;Platform=Any CPU"/>
</Target>
<Target Name="DesktopDx112">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolution)" Properties="Configuration=DIRECTX11_2Release;Platform=Any CPU"/>
</Target>
<Target Name="WP8x86">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolutionWP8)" Properties="Configuration=WP8Release;Platform=x86"/>
</Target>
<Target Name="WP8ARM">
<MSBuild Targets="Clean;Build" Projects="$(SharpDXSolutionWP8)" Properties="Configuration=WP8Release;Platform=ARM"/>
</Target>
<Target Name="CopyD3DRedistributionFiles">
<!--Copy redistribution D3D files to Bin-->
<ItemGroup>
<RedistFiles Include="External\D3D\**\*.*"/>
</ItemGroup>
<MakeDir Directories="Bin\Redist\D3D"/>
<Copy SourceFiles="@(RedistFiles)" DestinationFiles="@(RedistFiles->'Bin\Redist\D3D\%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
<Target Name="CleanSamples">
<ItemGroup>
<CleanFiles Include="$(SamplesDirectory)\**\Bin\**\*"/>
<CleanFiles Include="$(SamplesDirectory)\**\Obj\**\*"/>
<CleanFiles Include="$(SamplesDirectory)\**\_ReSharper*\**\*" />
<CleanFiles Include="$(SamplesDirectory)\**\AppPackages\**\*" />
<CleanFiles Include="$(SamplesDirectory)\**\*.suo" />
<CleanFiles Include="$(SamplesDirectory)\**\*.bak" />
<CleanFiles Include="$(SamplesDirectory)\**\*.user" />
</ItemGroup>
<Delete Files="@(CleanFiles)" />
</Target>
<Target Name="BuildSamples">
<!-- Build all samples -->
<MSBuild Targets="Clean;Build" Projects="$(MSBuildThisFileDirectory)\Samples\SharpDXSamples.sln"/>
<MSBuild Targets="Clean;Build" Projects="$(MSBuildThisFileDirectory)\Samples\SharpDXToolkitSamples.sln" Properties="Configuration=Debug;Platform=x86"/>
<MSBuild Targets="Clean;Build" Projects="$(MSBuildThisFileDirectory)\Samples\SharpDXWin8Samples.sln" Properties="Configuration=Debug;Platform=Any CPU"/>
<!-- <MSBuild Targets="Clean;Build" Projects="$(MSBuildThisFileDirectory)\Samples\SharpDXWin81Samples.sln" Properties="Configuration=Debug;Platform=Any CPU"/> -->
<MSBuild Targets="Clean;Build" Projects="$(MSBuildThisFileDirectory)\Samples\SharpDXWP8Samples.sln" Properties="Configuration=Debug;Platform=Any CPU"/>
<CallTarget Targets="CleanSamples"/>
</Target>
<Target Name="GitCheckout">
<Exec Command='$(GitExe) checkout --merge "master_integration"'/>
<Exec Command='$(GitExe) pull --rebase origin'/>
</Target>
<Target Name="GitUpdate">
<!-- Update master -->
<Exec Command='$(GitExe) checkout --merge "master"'/>
<Exec Command='$(GitExe) pull --rebase origin'/>
<!-- Merge master into master_integration -->
<Exec Command='$(GitExe) checkout --merge "master_integration"'/>
<Exec Command='$(GitExe) pull --rebase origin'/>
<Exec Command='$(GitExe) merge "master"'/>
<!-- Merge master_integration into master -->
<Exec Command='$(GitExe) checkout --merge "master"'/>
<Exec Command='$(GitExe) merge "master_integration"'/>
<!-- Push master to origin -->
<Exec Command='$(GitExe) push "origin" master:master'/>
<!-- Get logs from latest tags and push tags -->
<Exec Command='$(GitExe) log latest_build.. > CommitLog.txt'/>
<Exec Command='$(GitExe) tag -f latest_build'/>
<Exec Command='$(GitExe) push -f "origin" tag latest_build'/>
<!-- Push master_integration to origin -->
<Exec Command='$(GitExe) checkout --merge "master_integration"'/>
<Exec Command='$(GitExe) pull --rebase origin'/>
<Exec Command='$(GitExe) push "origin" master_integration:master_integration'/>
</Target>
<Target Name="ZipBuild">
<Delete Files="$(SharpDXDevZip)"/>
<Exec Command='External\7-Zip\7z.exe a -r -sfx7z.sfx -xr!External -xr!*.check -xr!*.pdb -xr!*.lib -xr!*.exp $(SharpDXDevZip) Bin\*.* Samples\*.* SharpDX.targets CommitLog.txt License.txt'/>
</Target>
<Target Name="FtpZip">
<!-- Get Last commit log from git -->
<PropertyGroup>
<LastCommitPath>last_commit.txt</LastCommitPath>
</PropertyGroup>
<Exec Command='$(GitExe) log --format=%%H -1 > $(LastCommitPath)'/>
<ItemGroup>
<FilesToUpload Include="$(SharpDXDevZip)" />
<FilesToUpload Include="$(LastCommitPath)" />
</ItemGroup>
<!-- Upload Zip -->
<MSBuild.ExtensionPack.Communication.Ftp TaskAction="UploadFiles" Host="sharpdx.org" RemoteDirectoryName="/sharpdx/upload" FileNames="@(FilesToUpload)" UserName="$(SharpDXFtpUser)" UserPassword="$(SharpDXFtpPassword)" />
</Target>
</Project>