OSDN Git Service

Merge pull request #508 from xoppa/misc
[mikumikustudio/libgdx-mikumikustudio.git] / build.xml
1 <project name="gdx" default="all" basedir=".">\r
2         <description>libgdx distribution build file</description>\r
3         <property environment="env" />\r
4 \r
5         <!-- ndk directory -->\r
6         <property name="env.NDK_HOME" value="/home/mzechner/android-ndk-r5"/>\r
7 \r
8         <!-- library version -->\r
9         <property name="version" value="0.9.9-SNAPSHOT"/>\r
10 \r
11         <!-- define distribution/output directory -->\r
12         <property name="distDir" value="${basedir}/dist"/>\r
13 \r
14         <!-- should we build natives? -->\r
15         <property name="build-natives" value="false"/>\r
16 \r
17         <!-- clean distribution/output directory -->\r
18         <target name="clean">\r
19                 <delete dir="${distDir}"/>\r
20         </target>\r
21 \r
22         <!-- build the core of the library plus all backends -->\r
23         <!-- gdx jnigen -->\r
24         <target name="gdx-jnigen">\r
25                 <ant antfile="../../build-template.xml" dir="extensions/gdx-jnigen">\r
26                         <property name="distDir" value="${distDir}/extensions/gdx-jnigen"/>\r
27                         <property name="jar" value="gdx-jnigen"/>\r
28                         <!-- we shouldn't build any natives -->\r
29                         <property name="build-natives" value="false"/>\r
30                 </ant>\r
31         </target>\r
32 \r
33         <!-- gdx setup ui, custom target -->\r
34         <target name="gdx-setup-ui">\r
35                 <ant antfile="build.xml" dir="extensions/gdx-setup-ui/"/>\r
36                 <copy tofile="${distDir}/gdx-setup-ui.jar" file="extensions/gdx-setup-ui/gdx-setup-ui.jar"/>\r
37         </target>\r
38 \r
39         <!-- gdx core -->\r
40         <target name="gdx-core" depends="gdx-jnigen">\r
41                 <path id="classpath">\r
42                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
43                 </path>\r
44                 <fileset id="resourcefiles" dir="gdx/src">\r
45                         <include name="com/badlogic/gdx/graphics/g3d/shaders/default.fragment.glsl"/>\r
46                         <include name="com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl"/>\r
47                         <include name="com/badlogic/gdx/utils/arial-15.png"/>\r
48                         <include name="com/badlogic/gdx/utils/arial-15.fnt"/>\r
49                 </fileset>\r
50                 <ant antfile="../build-template.xml" dir="gdx">\r
51                         <property name="jar" value="gdx"/>\r
52                         <reference refid="classpath"/>\r
53                         <reference refid="resourcefiles"/>\r
54                 </ant>\r
55         </target>\r
56 \r
57         <!-- gdx openal, for all desktop backends -->\r
58         <target name="gdx-openal" depends="gdx-core">\r
59                 <path id="classpath">\r
60                         <pathelement location="${distDir}/gdx.jar"/>\r
61                 </path>\r
62                 <ant antfile="../../build-template.xml" dir="backends/gdx-openal">\r
63                         <property name="jar" value="gdx-openal"/>\r
64                         <reference refid="classpath"/>\r
65                 </ant>\r
66         </target>\r
67 \r
68         <!-- gdx lwjgl backend -->\r
69         <target name="gdx-backend-lwjgl" depends="gdx-core,gdx-openal">\r
70                 <path id="classpath">\r
71                         <pathelement location="${distDir}/gdx.jar"/>\r
72                         <pathelement location="${distDir}/gdx-openal.jar"/>\r
73                 </path>\r
74                 <zipfileset id="jarfiles" src="${distDir}/gdx-openal.jar"/>\r
75                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-lwjgl">\r
76                         <property name="jar" value="gdx-backend-lwjgl"/>\r
77                         <reference refid="classpath"/>\r
78                         <reference refid="jarfiles"/>\r
79                 </ant>\r
80         </target>\r
81 \r
82         <!-- gdx jglfw backend -->\r
83         <target name="gdx-backend-jglfw" depends="gdx-core">\r
84                 <mkdir dir="backends/gdx-backend-jglfw/libs"/>\r
85                 <get src="http://libgdx.badlogicgames.com/jglfw/nightlies/dist/jglfw.jar" dest="backends/gdx-backend-jglfw/libs/jglfw.jar"/>\r
86                 <get src="http://libgdx.badlogicgames.com/jglfw/nightlies/dist/jglfw-natives.jar" dest="backends/gdx-backend-jglfw/libs/gdx-backend-jglfw-natives.jar"/>\r
87                 <path id="classpath">\r
88                         <pathelement location="${distDir}/gdx.jar"/>\r
89                 </path>\r
90                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-jglfw">\r
91                         <property name="jar" value="gdx-backend-jglfw"/>\r
92                         <reference refid="classpath"/>\r
93                 </ant>\r
94         </target>\r
95 \r
96         <!-- gdx android backend -->\r
97         <target name="gdx-backend-android" depends="gdx-core">\r
98                 <path id="classpath">\r
99                         <pathelement location="${distDir}/gdx.jar"/>\r
100                 </path>\r
101                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-android">\r
102                         <property name="jar" value="gdx-backend-android"/>\r
103                         <reference refid="classpath"/>\r
104                 </ant>\r
105         </target>\r
106 \r
107         <!-- gdx gwt backend -->\r
108         <target name="gdx-backend-gwt" depends="gdx-core">\r
109                 <path id="classpath">\r
110                         <pathelement location="${distDir}/gdx.jar"/>\r
111                 </path>\r
112                 <ant antfile="../../build-template.xml" dir="backends/gdx-backends-gwt">\r
113                         <property name="jar" value="gdx-backend-gwt"/>\r
114                         <reference refid="classpath"/>\r
115                 </ant>\r
116         </target>\r
117 \r
118         <!-- gdx ios-monotouch backend -->\r
119         <target name="gdx-backend-iosmonotouch" depends="gdx-core">\r
120                 <path id="classpath">\r
121                         <pathelement location="${distDir}/gdx.jar"/>\r
122                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/monotouch-5.4.0.jar"/>\r
123                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/mscorlib-4.0.jar"/>\r
124                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/opentk-5.4.0.jar"/>\r
125                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-2.1.jar"/>\r
126                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-core-2.1.jar"/>\r
127                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-data-2.1.jar"/>\r
128                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/objectal/libObjectAL.jar"/>\r
129                 </path>\r
130                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-iosmonotouch">\r
131                         <property name="jar" value="gdx-backend-iosmonotouch"/>\r
132                         <reference refid="classpath"/>\r
133                 </ant>\r
134         </target>\r
135 \r
136         <!-- build the extensions -->\r
137         <!-- gdx tools -->\r
138         <target name="gdx-tools" depends="gdx-core,gdx-backend-lwjgl,gdx-backend-lwjgl">\r
139                 <path id="classpath">\r
140                         <pathelement location="${distDir}/gdx.jar"/>\r
141                         <pathelement location="${distDir}/gdx-backend-lwjgl.jar"/>\r
142                 </path>\r
143                 <fileset id="resourcefiles" dir="extensions/gdx-tools/assets"/>\r
144                 <ant antfile="../../build-template.xml" dir="extensions/gdx-tools">\r
145                         <property name="distDir" value="${distDir}/extensions/gdx-tools"/>\r
146                         <property name="jar" value="gdx-tools"/>\r
147                         <reference refid="classpath"/>\r
148                         <reference refid="resourcefiles"/>\r
149                 </ant>\r
150         </target>\r
151 \r
152         <!-- gdx tiled preprocessor -->\r
153         <target name="gdx-tiled-preprocessor" depends="gdx-core,gdx-backend-lwjgl,gdx-tools">\r
154                 <path id="classpath">\r
155                         <pathelement location="${distDir}/gdx.jar"/>\r
156                         <pathelement location="${distDir}/gdx-backend-lwjgl.jar"/>\r
157                         <pathelement location="${distDir}/extensions/gdx-tools/gdx-tools.jar"/>\r
158                 </path>\r
159                 <ant antfile="../../build-template.xml" dir="extensions/gdx-tiled-preprocessor">\r
160                         <property name="distDir" value="${distDir}/extensions/gdx-tiled-preprocessor"/>\r
161                         <property name="jar" value="gdx-tiled-preprocessor"/>\r
162                         <reference refid="classpath"/>\r
163                 </ant>\r
164         </target>\r
165 \r
166         <!-- gdx controllers -->\r
167         <target name="gdx-controllers" depends="gdx-core">\r
168                 <path id="classpath">\r
169                         <pathelement location="${distDir}/gdx.jar"/>\r
170                 </path>\r
171                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers">\r
172                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
173                         <property name="jar" value="gdx-controllers"/>\r
174                         <reference refid="classpath"/>\r
175                 </ant>\r
176         </target>\r
177 \r
178         <target name="gdx-controllers-desktop" depends="gdx-core,gdx-jnigen,gdx-controllers">\r
179                 <path id="classpath">\r
180                         <pathelement location="${distDir}/gdx.jar"/>\r
181                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
182                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
183                 </path>\r
184                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-desktop">\r
185                         <property name="distDir" value="${distDir}/extensions/gdx-controllers/"/>\r
186                         <property name="jar" value="gdx-controllers-desktop"/>\r
187                         <reference refid="classpath"/>\r
188                 </ant>\r
189         </target>\r
190 \r
191         <target name="gdx-controllers-android" depends="gdx-core,gdx-backend-android,gdx-controllers">\r
192                 <path id="classpath">\r
193                         <pathelement location="${distDir}/gdx.jar"/>\r
194                         <pathelement location="${distDir}/gdx-backend-android.jar"/>\r
195                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
196                         <pathelement location="${basedir}/backends/gdx-backend-android/libs/android-4.2.jar"/>\r
197                 </path>\r
198                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-android">\r
199                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
200                         <property name="jar" value="gdx-controllers-android"/>\r
201                         <reference refid="classpath"/>\r
202                 </ant>\r
203         </target>\r
204 \r
205         <target name="gdx-controllers-gwt" depends="gdx-core,gdx-backend-gwt,gdx-controllers">\r
206                 <path id="classpath">\r
207                         <pathelement location="${distDir}/gdx.jar"/>\r
208                         <pathelement location="${distDir}/gdx-backend-gwt.jar"/>\r
209                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
210                         <pathelement location="${basedir}/backends/gdx-backends-gwt/libs/gwt-dev.jar"/>\r
211                         <pathelement location="${basedir}/backends/gdx-backends-gwt/libs/gwt-user.jar"/>\r
212                 </path>\r
213                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-gwt">\r
214                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
215                         <property name="jar" value="gdx-controllers-gwt"/>\r
216                         <reference refid="classpath"/>\r
217                 </ant>\r
218         </target>\r
219 \r
220         <!-- gdx image -->\r
221         <target name="gdx-image" depends="gdx-core">\r
222                 <path id="classpath">\r
223                         <pathelement location="${distDir}/gdx.jar"/>\r
224                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
225                 </path>\r
226                 <ant antfile="../../build-template.xml" dir="extensions/gdx-image">\r
227                         <property name="distDir" value="${distDir}/extensions/gdx-image"/>\r
228                         <property name="jar" value="gdx-image"/>\r
229                         <reference refid="classpath"/>\r
230                 </ant>\r
231         </target>\r
232 \r
233         <!-- gdx audio -->\r
234         <target name="gdx-audio" depends="gdx-core">\r
235                 <path id="classpath">\r
236                         <pathelement location="${distDir}/gdx.jar"/>\r
237                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
238                 </path>\r
239                 <ant antfile="../../build-template.xml" dir="extensions/gdx-audio">\r
240                         <property name="distDir" value="${distDir}/extensions/gdx-audio"/>\r
241                         <property name="jar" value="gdx-audio"/>\r
242                         <reference refid="classpath"/>\r
243                 </ant>\r
244         </target>\r
245 \r
246         <!-- gdx freetype -->\r
247         <target name="gdx-freetype" depends="gdx-core">\r
248                 <path id="classpath">\r
249                         <pathelement location="${distDir}/gdx.jar"/>\r
250                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
251                 </path>\r
252                 <ant antfile="../../build-template.xml" dir="extensions/gdx-freetype">\r
253                         <property name="distDir" value="${distDir}/extensions/gdx-freetype"/>\r
254                         <property name="jar" value="gdx-freetype"/>\r
255                         <reference refid="classpath"/>\r
256                 </ant>\r
257         </target>\r
258 \r
259         <!-- gdx bullet -->\r
260         <target name="gdx-bullet" depends="gdx-core">\r
261                 <path id="classpath">\r
262                         <pathelement location="${distDir}/gdx.jar"/>\r
263                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
264                 </path>\r
265                 <path id="src">\r
266                                 <pathelement location="extensions/gdx-bullet/src"/>\r
267                                 <pathelement location="extensions/gdx-bullet/jni/swig-src"/>\r
268                 </path>\r
269                 <ant antfile="../../build-template.xml" dir="extensions/gdx-bullet">\r
270                         <property name="distDir" value="${distDir}/extensions/gdx-bullet"/>\r
271                         <property name="jar" value="gdx-bullet"/>\r
272                         <reference refid="classpath"/>\r
273                         <reference refid="src"/>\r
274                 </ant>\r
275         </target>\r
276 \r
277         <!-- generates the javadoc for the core api and the application implementations -->\r
278         <target name="docs" depends="clean">\r
279                 <javadoc destdir="${distDir}/docs/api" author="true" version="true" use="true"\r
280                 windowtitle="libgdx API" doctitle="libgdx API" footer="libgdx API" useexternalfile="true">\r
281                         <header><![CDATA[\r
282                                 libgdx API\r
283                                 <style>\r
284                                 body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }\r
285                                 pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }\r
286                                 h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%;  font-weight:bold }\r
287                                 .TableHeadingColor { background:#EEEEFF; }\r
288                                 a { text-decoration:none }\r
289                                 a:hover { text-decoration:underline }\r
290                                 a:link, a:visited { color:blue }\r
291                                 table { border:0px }\r
292                                 .TableRowColor td:first-child { border-left:1px solid black }\r
293                                 .TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }\r
294                                 hr { border:0px; border-bottom:1px solid #333366; }\r
295                                 </style>\r
296                         ]]></header>\r
297                         <bottom><![CDATA[\r
298                                 <div style="font-size:9pt"><i>\r
299                                 Copyright &copy; 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)\r
300                                 </i></div>\r
301                         ]]></bottom>\r
302                         <fileset dir="gdx/src" defaultexcludes="yes">\r
303                                 <include name="com/badlogic/gdx/**" />\r
304                                 <exclude name="com/badlogic/gdx/**/*.glsl"/>\r
305                                 <exclude name="com/badlogic/gdx/utils/arial-15.fnt" />\r
306                                 <exclude name="com/badlogic/gdx/utils/arial-15.png" />\r
307                                 <exclude name="com/badlogic/gdx/utils/XmlReader.rl" />\r
308                                 <exclude name="com/badlogic/gdx/utils/JsonReader.rl" />\r
309                         </fileset>\r
310                         <fileset dir="backends" includes="gdx-backend-jglfw/src/com/badlogic/gdx/backends/jglfw/JglfwApplication.java"/>\r
311                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java"/>\r
312                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java"/>\r
313                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplet.java"/>\r
314                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java"/>\r
315                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplicationConfiguration.java"/>\r
316                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplication.java"/>\r
317                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplicationConfiguration.java"/>\r
318                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplication.java"/>\r
319                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplicationConfiguration.java"/>\r
320                 </javadoc>\r
321         </target>\r
322 \r
323         <!-- assumes that all the .dll and .a files have been compiled on a Mac and copied on top\r
324         of the current libgdx folder -->\r
325         <target name="copy-iosfiles">\r
326                 <!-- copy dll and .a files as well as IKVM, monotouch and ObjectAL binaries to ios folder-->\r
327                 <copy todir="${distDir}/ios" flatten="true" failonerror="false">\r
328                         <fileset dir="gdx/libs/ios32/">\r
329                                 <include name="*.a"/>\r
330                                 <include name="*.dll"/>\r
331                                 <include name="*.dll.mdb"/>\r
332                         </fileset>\r
333                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ios32">\r
334                                 <include name="*.dll"/>\r
335                                 <include name="*.dll.mdb"/>\r
336                                 <include name="*.a"/>\r
337                         </fileset>\r
338                 </copy>\r
339                 <copy todir="${distDir}/ios/ikvm" failonerror="false">\r
340                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ikvm"/>\r
341                 </copy>\r
342                 <copy todir="${distDir}/ios/monotouch-jars" failonerror="false">\r
343                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/monotouch-jars"/>\r
344                 </copy>\r
345                 <copy todir="${distDir}/ios/objectal" failonerror="false">\r
346                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/objectal"/>\r
347                 </copy>\r
348 \r
349                 <!-- copy freetype extension dll and .a files -->\r
350                 <copy todir="${distDir}/extensions/gdx-freetype/ios" failonerror="false">\r
351                         <fileset dir="extensions/gdx-freetype/libs/ios32">\r
352                                 <include name="*.a"/>\r
353                                 <include name="*.dll"/>\r
354                                 <include name="*.dll.mdb"/>\r
355                         </fileset>\r
356                 </copy>\r
357 \r
358                 <!-- copy bullet extension dll and .a files -->\r
359                 <copy todir="${distDir}/extensions/gdx-bullet/ios" failonerror="false">\r
360                         <fileset dir="extensions/gdx-bullet/libs/ios32">\r
361                                 <include name="*.a"/>\r
362                                 <include name="*.dll"/>\r
363                                 <include name="*.dll.mdb"/>\r
364                         </fileset>\r
365                 </copy>\r
366         </target>\r
367 \r
368         <target name="jars"\r
369 depends="clean,gdx-setup-ui,gdx-core,gdx-openal,gdx-backend-lwjgl,gdx-backend-jglfw,gdx-backend-android,gdx-backend-gwt,gdx-backend-iosmonotouch,gdx-tools,gdx-controllers,gdx-controllers-desktop,gdx-controllers-android,gdx-controllers-gwt,gdx-image,gdx-audio,gdx-freetype,gdx-bullet,gdx-tiled-preprocessor"/>\r
370 \r
371         <target name="all" depends="jars,docs,copy-iosfiles">\r
372                 <!-- copy distribution files (licences etc.) -->\r
373                 <copy tofile="${distDir}/README" file="README.md"/>\r
374                 <copy tofile="${distDir}/LICENSE" file="LICENSE"/>\r
375                 <copy tofile="${distDir}/CC-LICENSE" file="CC-LICENSE"/>\r
376                 <copy tofile="${distDir}/AUTHORS" file="AUTHORS"/>\r
377                 <copy tofile="${distDir}/CONTRIBUTORS" file="CONTRIBUTORS"/>\r
378 \r
379                 <!-- zip dist dir -->\r
380                 <zip destfile="libgdx-${version}.zip" basedir="${distDir}"/>\r
381         </target>\r
382 </project>\r