-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathMonoGame.build
225 lines (199 loc) · 12.3 KB
/
MonoGame.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
<?xml version="1.0"?>
<project name="MonoGame Build Script" default="build" basedir=".">
<description>Default MonoGame 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="psmtooldir" value="C:\Program Files (x86)\SCE\PSM\tools\PsmStudio\bin" />
<property name="msbuild12dir" value="C:\Program Files (x86)\MSBuild\12.0\Bin" />
<property name="msbuild14dir" value="C:\Program Files (x86)\MSBuild\14.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">
<delete dir="${project::get-base-directory()}\MonoGame.Framework\obj" verbose="true"/>
<delete dir="${project::get-base-directory()}\MonoGame.Framework.Content.Pipeline\obj" />
</target>
<target name="build_code" description="Build all the projects." depends="checkos">
<call target="buildwindows"/>
<call target="buildwindows8" />
<call target="buildwindowsphone" />
<call target="buildwindowsphone81" />
<call target="buildlinux"/>
<call target="buildandroid" />
<call target="buildios" />
<!--
<call target="buildwindows10" />
<call target="buildmac" />
<call target="buildpsm" />
<call target="buildcontentprocessor"/>
<call target="build_web" />
-->
</target>
<target name="build-windows" description="Build MonoGame Release" depends="checkos">
<call target="buildwindows"/>
</target>
<target name="build-windows8" description="Build MonoGame Release" depends="checkos">
<call target="buildwindows8" />
<call target="buildwindowsphone" />
</target>
<target name="build-android" description="Build MonoGame Release" depends="checkos">
<call target="buildandroid" />
</target>
<target name="build-mac" description="Build MonoGame Release" depends="checkos">
<call target="buildmac" />
<call target="buildios" />
</target>
<target name="build-linux" description="Build MonoGame Release" depends="checkos">
<call target="buildlinux"/>
</target>
<target name="build-psm" description="Build MonoGame Release" depends="checkos">
<call target="buildpsm" />
</target>
<target name="build-tools" description="Build MonoGame Release" depends="checkos">
<call target="buildtools"/>
<call target="buildcontentprocessor"/>
</target>
<target name="build" description="Build MonoGame Release" depends="build_code">
</target>
<target name="buildwindows" description="Build Windows" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="MonoGame.Framework.Windows.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows.sln /t:Build /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.WindowsGL.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.WindowsGL.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Windows.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Windows.sln" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.WindowsGL.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.WindowsGL.sln" />
</if>
</target>
<target name="buildlinux" description="Build Linux" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="MonoGame.Framework.Linux.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Linux.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Linux.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Linux.sln" />
</if>
<if test="${os == 'MacOS'}">
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Linux.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Linux.sln" />
</if>
</target>
<target name="buildweb" description="Build Web JSIL" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="Protobuild" commandline="-generate Web">
<environment>
<variable name="JSIL_DIRECTORY" value="C:\JSIL" />
</environment>
</exec>
<exec program="msbuild " commandline="MonoGame.Framework.Web.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Web.sln /t:Build /p:Configuration=Release" />
</if>
<if test="${os == 'Unix'}">
<exec program="mono" commandline="Protobuild.exe -generate Web" />
<exec program="xbuild" commandline="/t:Clean /p:Configuration=Release MonoGame.Framework.Web.sln" />
<exec program="xbuild" commandline="/t:Build /p:Configuration=Release MonoGame.Framework.Web.sln" />
</if>
</target>
<target name="buildmac" description="Build MacOS" depends="clean">
<if test="${os == 'MacOS'}">
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.MacOS.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.MacOS.sln" />
</if>
<if test="${os == 'Win32NT'}">
<exec program="Protobuild.exe" commandline="-generate MacOS" />
<exec program="msbuild " commandline="MonoGame.Framework.MacOS.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.MacOS.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="buildios" description="Build iOS" depends="clean">
<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:Release MonoGame.Framework.iOS.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.iOS.sln" />
</if>
</if>
<if test="${os == 'Win32NT'}">
<exec program="Protobuild.exe" commandline="-generate iOS" />
<exec program="msbuild " commandline="MonoGame.Framework.iOS.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.iOS.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="buildandroid" description="Build Android" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('C:\Program Files (x86)\MSBuild\Novell\Novell.MonoDroid.CSharp.targets') or file::exists('C:\Program Files\MSBuild\Novell\Novell.MonoDroid.CSharp.targets')}">
<exec program="msbuild " commandline="MonoGame.Framework.Android.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Android.sln /t:Build /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Ouya.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Ouya.sln /t:Build /p:Configuration=Release" />
</if>
</if>
<if test="${os == 'MacOS'}">
<if test="${file::exists('/Developer/MonoAndroid/usr/bin/mandroid')}">
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.Android.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.Android.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Clean -c:Release MonoGame.Framework.Ouya.sln" />
<exec program="mdtool" basedir="${mdtooldir}" commandline="build -t:Build -c:Release MonoGame.Framework.Ouya.sln" />
</if>
</if>
</target>
<target name="buildwindows8" description="Build Windows 8" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="MonoGame.Framework.Windows8.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.Framework.Windows8.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="buildwindowsphone" description="Build Windows Phone" 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')}">
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Clean /p:Configuration=Release /p:Platform="ARM"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Build /p:Configuration=Release /p:Platform="ARM"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Clean /p:Configuration=Release /p:Platform="x86"' />
<exec program="msbuild " commandline='MonoGame.Framework.WindowsPhone.sln /t:Build /p:Configuration=Release /p:Platform="x86"' />
</if>
</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')}">
<exec program="${msbuild12dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsPhone81.sln /t:Clean /p:Configuration=Release /p:Platform="Any CPU"' />
<exec program="${msbuild12dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsPhone81.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU"' />
</if>
</if>
</target>
<target name="buildwindows10" description="Build Windows 10 UAP" depends="clean">
<if test="${os == 'Win32NT'}">
<if test="${file::exists('c:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v14.0\Microsoft.Windows.UI.Xaml.CSharp.targets')}">
<exec program="${msbuild14dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsUniversal.sln /t:Clean /p:Configuration=Release /p:Platform="Any CPU"' />
<exec program="${msbuild14dir}\msbuild.exe " commandline='MonoGame.Framework.WindowsUniversal.sln /t:Build /p:Configuration=Release /p:Platform="Any CPU"' />
</if>
</if>
</target>
<target name="buildtools" description="Build Tools" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="Tools\2MGFX\2MGFX.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="Tools\2MGFX\2MGFX.sln /t:Build /p:Configuration=Release" />
<exec program="msbuild " commandline="Tools\MGCB\MGCB.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="Tools\MGCB\MGCB.sln /t:Build /p:Configuration=Release" />
</if>
</target>
<target name="buildcontentprocessor" description="Build Content Processor" depends="clean">
<if test="${os == 'Win32NT'}">
<exec program="msbuild " commandline="MonoGame.ContentPipeline\ContentProcessors\MonoGameContentProcessors.sln /t:Clean /p:Configuration=Release" />
<exec program="msbuild " commandline="MonoGame.ContentPipeline\ContentProcessors\MonoGameContentProcessors.sln /t:Build /p:Configuration=Release" />
</if>
</target>
</project>