This repository was archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
/
Copy pathdefault.build
286 lines (248 loc) · 18.2 KB
/
default.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
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<?xml version="1.0"?>
<project name="CococsSharp Build Script" default="build" basedir=".">
<description>Default CocosSharp Automated Build script</description>
<property name="os" value="${operating-system::get-platform(environment::get-operating-system())}" />
<property name="mdtooldir" value="/Applications/Xamarin\ Studio.app/Contents/MacOS"/>
<property name="configuration" value="Release" unless="${property::exists('configuration')}" />
<property name="msbuild12dir" value="C:\Program Files (x86)\MSBuild\12.0\Bin" />
<target name="checkos" description="check the operating system">
<property name="os" value="${operating-system::get-platform(environment::get-operating-system())}"/>
<if test="${os == 'Unix'}">
<if test="${directory::exists('/Applications') and directory::exists('/Library')}">
<property name="os" value="MacOS"/>
<if test="${not directory::exists(mdtooldir)}">
<property name="mdtooldir" value="${path::get-full-path('/Applications/Xamarin Studio.app/Contents/MacOS')}"/>
</if>
</if>
</if>
<echo message="Detected : ${os}"/>
</target>
<target name="clean" depends="checkos">
<delete dir="${project::get-base-directory()}\CocosSharp\obj" verbose="true">
</delete>
</target>
<target name="build" description="Build MonoGame Release" depends="monogame">
<call target="buildphysics"/>
<call target="buildPCL"/>
<!--call target="buildwindows"/-->
<call target="buildpipeline"/>
<!--call target="buildwindowsphone8"/-->
<call target="buildwindowsphone81"/>
<call target="buildios"/>
<!--call target="buildmac"/-->
<call target="buildandroid"/>
<!--call target="buildwindows8"/-->
<!--call target="buildwindows81"/-->
<call target="buildforms" />
<call target="buildnugets"/>
<call target="buildXStemplates" />
<!--call target="buildtemplates"/-->
</target>
<target name="monogame" description="Build MonoGame Release" depends="checkos">
<if test="${os == 'Win32NT'}">
<copy file="MonoGame.build" tofile="MonoGame/default.build" overwrite="true"/>
<!--nant buildfile="MonoGame/default.build" target="build" /-->
</if>
</target>
<target name="buildPCL" description="Build CocosSharp Portable project" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline=".\PCL\CocosSharp.PCL.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline=".\PCL\CocosSharp.PCL.sln /t:Build /p:Configuration=${configuration}" />
</if>
<if test="${os == 'MacOS'}">
<exec program="xbuild" commandline="/t:Clean /p:Configuration=${configuration} ./PCL/CocosSharp.PCL.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=${configuration} ./PCL/CocosSharp.PCL.sln" />
</if>
</target>
<target name="buildwindows" description="Build Windows" depends="clean">
<if test="${os == 'Win32NT'}">
<!--exec program="msbuild " commandline="CocosSharp.Windows.sln /t:Clean /p:Configuration=${configuration}" /-->
<!--exec program="msbuild " commandline="CocosSharp.Windows.sln /t:Build /p:Configuration=${configuration}" /-->
<nant buildfile="MonoGame/default.build" target="buildwindows" />
<!--exec program="msbuild " commandline="CocosSharp.WindowsGL.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.WindowsGL.sln /t:Build /p:Configuration=${configuration}" /-->
<exec program="msbuild " commandline="CocosSharp.WindowsDX.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.WindowsDX.sln /t:Build /p:Configuration=${configuration}" />
</if>
<if test="${os == 'Unix'}">
<exec program="xbuild" commandline="/t:Clean /p:Configuration=${configuration} CocosSharp.Windows.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=${configuration} CocosSharp.Windows.sln" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=${configuration} CocosSharp.WindowsGL.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=${configuration} CocosSharp.WindowsGL.sln" />
</if>
</target>
<target name="buildpipeline" description="Build Windows" depends="clean">
<if test="${os == 'Win32NT'}">
<nant buildfile="CocosSharp.Content.Pipeline.Importers/default.build" target="build" />
</if>
<if test="${os == 'MacOS'}">
<nant buildfile="CocosSharp.Content.Pipeline.Importers/default.build" target="build" />
</if>
</target>
<target name="buildwindowsphone8" description="Build Windows Phone 8" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('c:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.0\Microsoft.Cpp.WindowsPhone.8.0.targets') or file::exists('c:\Program Files\MSBuild\Microsoft\WindowsPhone\v8.0\Microsoft.Cpp.WindowsPhone.8.0.targets')}">
<nant buildfile="MonoGame/default.build" target="buildwindowsphone" />
<exec program="msbuild " commandline='CocosSharp.WindowsPhone.sln /t:Clean /p:Configuration=${configuration} /p:Platform="ARM"' />
<exec program="msbuild " commandline='CocosSharp.WindowsPhone.sln /t:Build /p:Configuration=${configuration} /p:Platform="ARM"' />
<exec program="msbuild " commandline='CocosSharp.WindowsPhone.sln /t:Clean /p:Configuration=${configuration} /p:Platform="x86"' />
<exec program="msbuild " commandline='CocosSharp.WindowsPhone.sln /t:Build /p:Configuration=${configuration} /p:Platform="x86"' />
</if>
</if>
</target>
<target name="buildwindows8" description="Build Windows 8" depends="clean">
<if test="${os == 'Win32NT'}">
<nant buildfile="MonoGame/default.build" target="buildwindows8" />
<exec program="msbuild " commandline="CocosSharp.Windows8.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.Windows8.sln /t:Rebuild /p:Configuration=${configuration}" />
</if>
</target>
<target name="buildwindows81" description="Build Windows 8.1" depends="clean">
<if test="${os == 'Win32NT'}">
<nant buildfile="MonoGame/default.build" target="buildwindows81" />
<exec program="msbuild " commandline="CocosSharp.Windows81.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.Windows81.sln /t:Rebuild /p:Configuration=${configuration}" />
</if>
</target>
<target name="buildwindowsphone81" description="Build Windows Phone 8.1" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('c:\Program Files (x86)\MSBuild\Microsoft\WindowsPhone\v8.1\Microsoft.Cpp.WindowsPhone.8.1.targets')}">
<nant buildfile="MonoGame/default.build" target="buildwindowsphone81" />
<exec program="${msbuild12dir}\msbuild.exe " commandline='CocosSharp.WindowsPhone81.sln /t:Clean /p:Configuration=${configuration} /p:Platform="Any CPU"' />
<exec program="${msbuild12dir}\msbuild.exe " commandline='CocosSharp.WindowsPhone81.sln /t:Rebuild /p:Configuration=${configuration} /p:Platform="Any CPU"' />
</if>
</if>
</target>
<target name="buildios" description="Build iOS" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets')}">
<nant buildfile="MonoGame/default.build" target="buildios" />
<exec program="msbuild " commandline="CocosSharp.iOS.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.iOS.sln /t:Build /p:Configuration=${configuration}" />
</if>
</if>
<if test="${os == 'MacOS'}">
<!--if test="${file::exists('/Developer/MonoTouch/MSBuild/Xamarin.ObjcBinding.CSharp.targets')}"-->
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:${configuration}|iPhone CocosSharp.iOS.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:${configuration}|iPhone CocosSharp.iOS.sln" />
<!--/if-->
</if>
</target>
<target name="buildandroid" description="Build Android" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets')}">
<exec program="msbuild " commandline="CocosSharp.Android.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.Android.sln /t:Build /p:Configuration=${configuration}" />
</if>
</if>
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoAndroid/bin/mandroid')}">
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:${configuration} CocosSharp.Android.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:${configuration} CocosSharp.Android.sln" />
</if>
</if>
</target>
<target name="buildouya" description="Build Android" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets')}">
<!--exec program="msbuild " commandline="CocosSharp.Ouya.sln /t:Clean /p:Configuration=${configuration}" />
<exec program="msbuild " commandline="CocosSharp.Ouya.sln /t:Build /p:Configuration=${configuration}" /-->
</if>
</if>
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoAndroid/bin/mandroid')}">
<!--exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:${configuration} CocosSharp.ouya.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:${configuration} CocosSharp.ouya.sln" /-->
</if>
</if>
</target>
<target name="buildmac" description="Build Mac OSX" depends="clean">
<if test="${os == 'MacOS'}">
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:${configuration} CocosSharp.macos.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:${configuration} CocosSharp.macos.sln" />
</if>
</target>
<target name="buildforms" description="Build for Xamarin.Forms" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild" commandline='CocosSharp.Forms/CocosSharp.Forms.sln /t:Clean /p:Configuration=${configuration} /p:Platform="Any CPU"' />
<exec program="msbuild" commandline='CocosSharp.Forms/CocosSharp.Forms.sln /t:Build /p:Configuration=${configuration} /p:Platform="Any CPU"' />
</if>
</target>
<target name="buildphysics" description="Build Physics solution" depends="checkos" >
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline='"src/external lib/ChipmunkSharp/src/ChipmunkSharp/ChipmunkSharp.Windows.sln" /t:Clean /p:Configuration=${configuration}' />
<exec program="msbuild " commandline='"src/external lib/ChipmunkSharp/src/ChipmunkSharp/ChipmunkSharp.Windows.sln" /t:Build /p:Configuration=${configuration}' />
</if>
<if test="${os == 'MacOS'}">
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:${configuration} 'src/external lib/ChipmunkSharp/src/ChipmunkSharp/ChipmunkSharp.Mac.sln'" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:${configuration} 'src/external lib/ChipmunkSharp/src/ChipmunkSharp/ChipmunkSharp.Mac.sln'" />
</if>
</target>
<target name="buildnugets" description="Build NuGet Packages" depends="checkos">
<if test="${os == 'Win32NT'}">
<property name="nuget.cmd.dir.path" value='./Tools/NuGet/NuGet.exe' overwrite="true" />
<property name="nuspec.file.dir.path" value="${project::get-base-directory()}\ProjectTemplates\NuGet\" overwrite="true" />
<property name="nuspec.physics.file.dir.path" value="${project::get-base-directory()}/src/external lib/ChipmunkSharp/NuGet/" overwrite="true" />
<property name="packages.dir.path" value="${nuspec.file.dir.path}bin" overwrite="true" />
<echo message="" />
<echo message="" />
<echo message="NuGet Command directory: ${nuget.cmd.dir.path}" />
<echo message="Base directory: ${nuspec.file.dir.path}" />
<echo message="Output directory: ${packages.dir.path}" />
<echo message="" />
<mkdir dir="${packages.dir.path}" />
<exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.Forms.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' />
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.PCL.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.PCL.DX.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.PCL.GL.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.PCL.Wrench.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' />
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.WindowsDX.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.WindowsGL.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.Windows81.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.WindowsPhone81.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.iOS.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.Android.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' /-->
<exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.file.dir.path}CocosSharp.ContentBuild.Windows.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath .\' />
<!--exec program="${nuget.cmd.dir.path} " commandline='pack "${nuspec.physics.file.dir.path}ChipmunkSharp.Windows.nuspec" -OutputDirectory "${packages.dir.path}"' /-->
</if>
<if test="${os == 'MacOS'}">
<property name="nuget.cmd.dir.path" value="./tools/NuGet/NuGet.exe" overwrite="true" />
<property name="nuspec.file.dir.path" value="${project::get-base-directory()}/ProjectTemplates/NuGet/" overwrite="true" />
<property name="nuspec.physics.file.dir.path" value="${project::get-base-directory()}/src/external lib/ChipmunkSharp/NuGet/" overwrite="true" />
<property name="packages.dir.path" value="${nuspec.file.dir.path}bin" overwrite="true" />
<property name="monodir" value="/Library/Frameworks/Mono.framework/Commands"/>
<echo message="" />
<echo message="" />
<echo message="NuGet Command directory: ${nuget.cmd.dir.path}" />
<echo message="Base directory: ${nuspec.file.dir.path}" />
<echo message="Output directory: ${packages.dir.path}" />
<echo message="" />
<mkdir dir="${packages.dir.path}" />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.PCL.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.MacOS.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.iOS.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.Android.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.tvOS.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.file.dir.path}CocosSharp.ContentBuild.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath ./' />
<exec program="mono" basedir="${monodir}" commandline=' "${nuget.cmd.dir.path}" pack "${nuspec.physics.file.dir.path}ChipmunkSharp.Mac.nuspec" -OutputDirectory "${packages.dir.path}" -BasePath "./src/external lib/ChipmunkSharp/"' />
</if>
</target>
<target name="buildtemplates" description="Build CocosSharp templates" depends="checkos">
<if test="${os == 'Win32NT'}">
<!--nant buildfile="ProjectTemplates/Templates/ContentBuilder/default.build" target="build" /-->
<nant buildfile="ProjectTemplates/Templates/StarterTemplates/default.build" target="build" />
</if>
</target>
<target name="buildXStemplates" description="Build CocosSharp XS project templates" depends="checkos">
<if test="${os == 'MacOS'}">
<delete dir="${project::get-base-directory()}/ProjectTemplates/XamarinStudio/Packages" />
<copy todir="${project::get-base-directory()}/ProjectTemplates/XamarinStudio/Packages" >
<fileset basedir="${project::get-base-directory()}/ProjectTemplates/NuGet/bin">
<include name="CocosSharp.*.nupkg" />
<include name="CocosSharp.Forms.*.nupkg" />
</fileset>
</copy>
<exec program="mdtool" basedir="${mdtooldir}" workingdir="${project::get-base-directory()}/ProjectTemplates/XamarinStudio/" commandline="setup pack MonoDevelop.CocosSharp.addin.xml" />
</if>
</target>
</project>