OSDN Git Service

Merge branch 'master' of https://github.com/libgdx/libgdx into new3dapi
[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/utils/arial-15.png"/>\r
46                         <include name="com/badlogic/gdx/utils/arial-15.fnt"/>\r
47                 </fileset>\r
48                 <ant antfile="../build-template.xml" dir="gdx">\r
49                         <property name="jar" value="gdx"/>\r
50                         <reference refid="classpath"/>\r
51                         <reference refid="resourcefiles"/>\r
52                 </ant>\r
53                 <!-- the ndk clean process deletes all shared libs in libs/armeabi(-v7a), need to copy\r
54                 the GLES 2.0 bindings manually... -->\r
55                 <copy tofile="${distDir}/armeabi/libandroidgl20.so" file="gdx/dist/armeabi/libandroidgl20.so"/>\r
56                 <copy tofile="${distDir}/armeabi-v7a/libandroidgl20.so" file="gdx/dist/armeabi/libandroidgl20.so"/>\r
57         </target>\r
58 \r
59         <!-- gdx openal, for all desktop backends -->\r
60         <target name="gdx-openal" depends="gdx-core">\r
61                 <path id="classpath">\r
62                         <pathelement location="${distDir}/gdx.jar"/>\r
63                 </path>\r
64                 <ant antfile="../../build-template.xml" dir="backends/gdx-openal">\r
65                         <property name="jar" value="gdx-openal"/>\r
66                         <reference refid="classpath"/>\r
67                 </ant>\r
68         </target>\r
69 \r
70         <!-- gdx lwjgl backend -->\r
71         <target name="gdx-backend-lwjgl" depends="gdx-core,gdx-openal">\r
72                 <path id="classpath">\r
73                         <pathelement location="${distDir}/gdx.jar"/>\r
74                         <pathelement location="${distDir}/gdx-openal.jar"/>\r
75                 </path>\r
76                 <zipfileset id="jarfiles" src="${distDir}/gdx-openal.jar"/>\r
77                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-lwjgl">\r
78                         <property name="jar" value="gdx-backend-lwjgl"/>\r
79                         <reference refid="classpath"/>\r
80                         <reference refid="jarfiles"/>\r
81                 </ant>\r
82         </target>\r
83 \r
84         <!-- gdx jglfw backend -->\r
85         <target name="gdx-backend-jglfw" depends="gdx-core">\r
86                 <mkdir dir="backends/gdx-backend-jglfw/libs"/>\r
87                 <get src="http://libgdx.badlogicgames.com/jglfw/nightlies/dist/jglfw.jar" dest="backends/gdx-backend-jglfw/libs/jglfw.jar"/>\r
88                 <get src="http://libgdx.badlogicgames.com/jglfw/nightlies/dist/jglfw-natives.jar" dest="backends/gdx-backend-jglfw/libs/gdx-backend-jglfw-natives.jar"/>\r
89                 <path id="classpath">\r
90                         <pathelement location="${distDir}/gdx.jar"/>\r
91                 </path>\r
92                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-jglfw">\r
93                         <property name="jar" value="gdx-backend-jglfw"/>\r
94                         <reference refid="classpath"/>\r
95                 </ant>\r
96         </target>\r
97 \r
98         <!-- gdx android backend -->\r
99         <target name="gdx-backend-android" depends="gdx-core">\r
100                 <path id="classpath">\r
101                         <pathelement location="${distDir}/gdx.jar"/>\r
102                 </path>\r
103                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-android">\r
104                         <property name="jar" value="gdx-backend-android"/>\r
105                         <reference refid="classpath"/>\r
106                 </ant>\r
107         </target>\r
108 \r
109         <!-- gdx gwt backend -->\r
110         <target name="gdx-backend-gwt" depends="gdx-core">\r
111                 <path id="classpath">\r
112                         <pathelement location="${distDir}/gdx.jar"/>\r
113                 </path>\r
114                 <ant antfile="../../build-template.xml" dir="backends/gdx-backends-gwt">\r
115                         <property name="jar" value="gdx-backend-gwt"/>\r
116                         <reference refid="classpath"/>\r
117                 </ant>\r
118         </target>\r
119 \r
120         <!-- gdx ios-monotouch backend -->\r
121         <target name="gdx-backend-iosmonotouch" depends="gdx-core">\r
122                 <path id="classpath">\r
123                         <pathelement location="${distDir}/gdx.jar"/>\r
124                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/monotouch-5.4.0.jar"/>\r
125                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/mscorlib-4.0.jar"/>\r
126                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/opentk-5.4.0.jar"/>\r
127                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-2.1.jar"/>\r
128                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-core-2.1.jar"/>\r
129                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/monotouch-jars/system-data-2.1.jar"/>\r
130                         <pathelement location="${basedir}/backends/gdx-backend-iosmonotouch/libs/objectal/libObjectAL.jar"/>\r
131                 </path>\r
132                 <ant antfile="../../build-template.xml" dir="backends/gdx-backend-iosmonotouch">\r
133                         <property name="jar" value="gdx-backend-iosmonotouch"/>\r
134                         <reference refid="classpath"/>\r
135                 </ant>\r
136         </target>\r
137 \r
138         <!-- build the extensions -->\r
139         <!-- gdx tools -->\r
140         <target name="gdx-tools" depends="gdx-core,gdx-backend-lwjgl,gdx-backend-lwjgl">\r
141                 <path id="classpath">\r
142                         <pathelement location="${distDir}/gdx.jar"/>\r
143                         <pathelement location="${distDir}/gdx-backend-lwjgl.jar"/>\r
144                 </path>\r
145                 <fileset id="resourcefiles" dir="extensions/gdx-tools/assets"/>\r
146                 <ant antfile="../../build-template.xml" dir="extensions/gdx-tools">\r
147                         <property name="distDir" value="${distDir}/extensions/gdx-tools"/>\r
148                         <property name="jar" value="gdx-tools"/>\r
149                         <reference refid="classpath"/>\r
150                         <reference refid="resourcefiles"/>\r
151                 </ant>\r
152         </target>\r
153 \r
154         <!-- gdx tiled preprocessor -->\r
155         <target name="gdx-tiled-preprocessor" depends="gdx-core,gdx-backend-lwjgl,gdx-tools">\r
156                 <path id="classpath">\r
157                         <pathelement location="${distDir}/gdx.jar"/>\r
158                         <pathelement location="${distDir}/gdx-backend-lwjgl.jar"/>\r
159                         <pathelement location="${distDir}/extensions/gdx-tools/gdx-tools.jar"/>\r
160                 </path>\r
161                 <ant antfile="../../build-template.xml" dir="extensions/gdx-tiled-preprocessor">\r
162                         <property name="distDir" value="${distDir}/extensions/gdx-tiled-preprocessor"/>\r
163                         <property name="jar" value="gdx-tiled-preprocessor"/>\r
164                         <reference refid="classpath"/>\r
165                 </ant>\r
166         </target>\r
167 \r
168         <!-- gdx controllers -->\r
169         <target name="gdx-controllers" depends="gdx-core">\r
170                 <path id="classpath">\r
171                         <pathelement location="${distDir}/gdx.jar"/>\r
172                 </path>\r
173                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers">\r
174                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
175                         <property name="jar" value="gdx-controllers"/>\r
176                         <reference refid="classpath"/>\r
177                 </ant>\r
178         </target>\r
179 \r
180         <target name="gdx-controllers-desktop" depends="gdx-core,gdx-jnigen,gdx-controllers">\r
181                 <path id="classpath">\r
182                         <pathelement location="${distDir}/gdx.jar"/>\r
183                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
184                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
185                 </path>\r
186                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-desktop">\r
187                         <property name="distDir" value="${distDir}/extensions/gdx-controllers/"/>\r
188                         <property name="jar" value="gdx-controllers-desktop"/>\r
189                         <reference refid="classpath"/>\r
190                 </ant>\r
191         </target>\r
192 \r
193         <target name="gdx-controllers-android" depends="gdx-core,gdx-backend-android,gdx-controllers">\r
194                 <path id="classpath">\r
195                         <pathelement location="${distDir}/gdx.jar"/>\r
196                         <pathelement location="${distDir}/gdx-backend-android.jar"/>\r
197                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
198                         <pathelement location="${basedir}/backends/gdx-backend-android/libs/android-4.2.jar"/>\r
199                 </path>\r
200                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-android">\r
201                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
202                         <property name="jar" value="gdx-controllers-android"/>\r
203                         <reference refid="classpath"/>\r
204                 </ant>\r
205         </target>\r
206 \r
207         <target name="gdx-controllers-gwt" depends="gdx-core,gdx-backend-gwt,gdx-controllers">\r
208                 <path id="classpath">\r
209                         <pathelement location="${distDir}/gdx.jar"/>\r
210                         <pathelement location="${distDir}/gdx-backend-gwt.jar"/>\r
211                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.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/utils/arial-15.fnt" />\r
305                                 <exclude name="com/badlogic/gdx/utils/arial-15.png" />\r
306                                 <exclude name="com/badlogic/gdx/utils/XmlReader.rl" />\r
307                                 <exclude name="com/badlogic/gdx/utils/JsonReader.rl" />\r
308                         </fileset>\r
309                         <fileset dir="backends" includes="gdx-backend-jglfw/src/com/badlogic/gdx/backends/jglfw/JglfwApplication.java"/>\r
310                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java"/>\r
311                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java"/>\r
312                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplet.java"/>\r
313                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java"/>\r
314                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplicationConfiguration.java"/>\r
315                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplication.java"/>\r
316                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplicationConfiguration.java"/>\r
317                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplication.java"/>\r
318                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplicationConfiguration.java"/>\r
319                 </javadoc>\r
320         </target>\r
321 \r
322         <!-- assumes that all the .dll and .a files have been compiled on a Mac and copied on top\r
323         of the current libgdx folder -->\r
324         <target name="copy-iosfiles">\r
325                 <!-- copy dll and .a files as well as IKVM, monotouch and ObjectAL binaries to ios folder-->\r
326                 <copy todir="${distDir}/ios" flatten="true" failonerror="false">\r
327                         <fileset dir="gdx/libs/ios32/">\r
328                                 <include name="*.a"/>\r
329                                 <include name="*.dll"/>\r
330                                 <include name="*.dll.mdb"/>\r
331                         </fileset>\r
332                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ios32">\r
333                                 <include name="*.dll"/>\r
334                                 <include name="*.dll.mdb"/>\r
335                                 <include name="*.a"/>\r
336                         </fileset>\r
337                 </copy>\r
338                 <copy todir="${distDir}/ios/ikvm" failonerror="false">\r
339                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ikvm"/>\r
340                 </copy>\r
341                 <copy todir="${distDir}/ios/monotouch-jars" failonerror="false">\r
342                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/monotouch-jars"/>\r
343                 </copy>\r
344                 <copy todir="${distDir}/ios/objectal" failonerror="false">\r
345                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/objectal"/>\r
346                 </copy>\r
347 \r
348                 <!-- copy freetype extension dll and .a files -->\r
349                 <copy todir="${distDir}/extensions/gdx-freetype/ios" failonerror="false">\r
350                         <fileset dir="extensions/gdx-freetype/libs/ios32">\r
351                                 <include name="*.a"/>\r
352                                 <include name="*.dll"/>\r
353                                 <include name="*.dll.mdb"/>\r
354                         </fileset>\r
355                 </copy>\r
356 \r
357                 <!-- copy bullet extension dll and .a files -->\r
358                 <copy todir="${distDir}/extensions/gdx-bullet/ios" failonerror="false">\r
359                         <fileset dir="extensions/gdx-bullet/libs/ios32">\r
360                                 <include name="*.a"/>\r
361                                 <include name="*.dll"/>\r
362                                 <include name="*.dll.mdb"/>\r
363                         </fileset>\r
364                 </copy>\r
365         </target>\r
366 \r
367         <target name="jars"\r
368 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"/>\r
369 \r
370         <target name="all" depends="jars,docs,copy-iosfiles">\r
371                 <!-- copy distribution files (licences etc.) -->\r
372                 <copy tofile="${distDir}/README" file="gdx/dist/README"/>\r
373                 <copy tofile="${distDir}/LICENSE" file="gdx/dist/LICENSE"/>\r
374                 <copy tofile="${distDir}/CC-LICENSE" file="gdx/dist/CC-LICENSE"/>\r
375                 <copy tofile="${distDir}/AUTHORS" file="gdx/dist/AUTHORS"/>\r
376                 <copy tofile="${distDir}/CONTRIBUTORS" file="gdx/dist/CONTRIBUTORS"/>\r
377 \r
378                 <!-- zip dist dir -->\r
379                 <zip destfile="libgdx-${version}.zip" basedir="${distDir}"/>\r
380         </target>\r
381 </project>