OSDN Git Service

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