OSDN Git Service

Merge remote-tracking branch 'origin/master'
[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                 <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 controllers -->\r
134         <target name="gdx-controllers" depends="gdx-core">\r
135                 <path id="classpath">\r
136                         <pathelement location="${distDir}/gdx.jar"/>\r
137                 </path>\r
138                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers">\r
139                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
140                         <property name="jar" value="gdx-controllers"/>\r
141                         <reference refid="classpath"/>\r
142                 </ant>\r
143         </target>\r
144         \r
145         <target name="gdx-controllers-desktop" depends="gdx-core,gdx-backend-lwjgl,gdx-jnigen,gdx-controllers">\r
146                 <path id="classpath">\r
147                         <pathelement location="${distDir}/gdx.jar"/>\r
148                         <pathelement location="${distDir}/gdx-backend-lwjgl.jar"/>\r
149                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
150                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
151                 </path>\r
152                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-desktop">\r
153                         <property name="distDir" value="${distDir}/extensions/gdx-controllers/"/>\r
154                         <property name="jar" value="gdx-controllers-desktop"/>\r
155                         <reference refid="classpath"/>\r
156                 </ant>\r
157         </target>\r
158         \r
159         <target name="gdx-controllers-android" depends="gdx-core,gdx-backend-android,gdx-controllers">\r
160                 <path id="classpath">\r
161                         <pathelement location="${distDir}/gdx.jar"/>\r
162                         <pathelement location="${distDir}/gdx-backend-android.jar"/>\r
163                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
164                         <pathelement location="${basedir}/backends/gdx-backend-android/libs/android-4.2.jar"/>\r
165                 </path>\r
166                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-android">\r
167                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
168                         <property name="jar" value="gdx-controllers-android"/>\r
169                         <reference refid="classpath"/>\r
170                 </ant>\r
171         </target>\r
172         \r
173         <target name="gdx-controllers-gwt" depends="gdx-core,gdx-backend-gwt,gdx-controllers">\r
174                 <path id="classpath">\r
175                         <pathelement location="${distDir}/gdx.jar"/>\r
176                         <pathelement location="${distDir}/gdx-backend-gwt.jar"/>\r
177                         <pathelement location="${distDir}/extensions/gdx-controllers/gdx-controllers.jar"/>\r
178                 </path>\r
179                 <ant antfile="../../../build-template.xml" dir="extensions/gdx-controllers/gdx-controllers-gwt">\r
180                         <property name="distDir" value="${distDir}/extensions/gdx-controllers"/>\r
181                         <property name="jar" value="gdx-controllers-gwt"/>\r
182                         <reference refid="classpath"/>\r
183                 </ant>\r
184         </target>\r
185         \r
186         <!-- gdx image -->\r
187         <target name="gdx-image" depends="gdx-core">\r
188                 <path id="classpath">\r
189                         <pathelement location="${distDir}/gdx.jar"/>\r
190                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
191                 </path>\r
192                 <ant antfile="../../build-template.xml" dir="extensions/gdx-image">\r
193                         <property name="distDir" value="${distDir}/extensions/gdx-image"/>\r
194                         <property name="jar" value="gdx-image"/>\r
195                         <reference refid="classpath"/>\r
196                 </ant>\r
197         </target>\r
198         \r
199         <!-- gdx audio -->\r
200         <target name="gdx-audio" depends="gdx-core">\r
201                 <path id="classpath">\r
202                         <pathelement location="${distDir}/gdx.jar"/>\r
203                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
204                 </path>\r
205                 <ant antfile="../../build-template.xml" dir="extensions/gdx-audio">\r
206                         <property name="distDir" value="${distDir}/extensions/gdx-audio"/>\r
207                         <property name="jar" value="gdx-audio"/>\r
208                         <reference refid="classpath"/>\r
209                 </ant>\r
210         </target>\r
211         \r
212         <!-- gdx freetype -->\r
213         <target name="gdx-freetype" depends="gdx-core">\r
214                 <path id="classpath">\r
215                         <pathelement location="${distDir}/gdx.jar"/>\r
216                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
217                 </path>\r
218                 <ant antfile="../../build-template.xml" dir="extensions/gdx-freetype">\r
219                         <property name="distDir" value="${distDir}/extensions/gdx-freetype"/>\r
220                         <property name="jar" value="gdx-freetype"/>\r
221                         <reference refid="classpath"/>\r
222                 </ant>\r
223         </target>\r
224         \r
225         <!-- gdx bullet -->\r
226         <target name="gdx-bullet" depends="gdx-core">\r
227                 <path id="classpath">\r
228                         <pathelement location="${distDir}/gdx.jar"/>\r
229                         <pathelement location="${distDir}/extensions/gdx-jnigen/gdx-jnigen.jar"/>\r
230                 </path>\r
231                 <path id="src">\r
232                                 <pathelement location="extensions/gdx-bullet/src"/>\r
233                                 <pathelement location="extensions/gdx-bullet/jni/swig-src"/>\r
234                 </path>\r
235                 <ant antfile="../../build-template.xml" dir="extensions/gdx-bullet">\r
236                         <property name="distDir" value="${distDir}/extensions/gdx-bullet"/>\r
237                         <property name="jar" value="gdx-bullet"/>\r
238                         <reference refid="classpath"/>\r
239                         <reference refid="src"/>\r
240                 </ant>\r
241         </target>\r
242         \r
243         <!-- generates the javadoc for the core api and the application implementations -->\r
244         <target name="docs" depends="clean">\r
245                 <javadoc destdir="${distDir}/docs/api" author="true" version="true" use="true"\r
246                 windowtitle="libgdx API" doctitle="libgdx API" footer="libgdx API" useexternalfile="true">\r
247                         <header><![CDATA[\r
248                                 libgdx API\r
249                                 <style>\r
250                                 body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }\r
251                                 pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }\r
252                                 h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%;  font-weight:bold }\r
253                                 .TableHeadingColor { background:#EEEEFF; }\r
254                                 a { text-decoration:none }\r
255                                 a:hover { text-decoration:underline }\r
256                                 a:link, a:visited { color:blue }\r
257                                 table { border:0px }\r
258                                 .TableRowColor td:first-child { border-left:1px solid black }\r
259                                 .TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }\r
260                                 hr { border:0px; border-bottom:1px solid #333366; }\r
261                                 </style>\r
262                         ]]></header>\r
263                         <bottom><![CDATA[\r
264                                 <div style="font-size:9pt"><i>\r
265                                 Copyright &copy; 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)\r
266                                 </i></div>\r
267                         ]]></bottom>\r
268                         <fileset dir="gdx/src" defaultexcludes="yes">\r
269                                 <include name="com/badlogic/gdx/**" />\r
270                                 <exclude name="com/badlogic/gdx/utils/arial-15.fnt" />\r
271                                 <exclude name="com/badlogic/gdx/utils/arial-15.png" />\r
272                                 <exclude name="com/badlogic/gdx/utils/XmlReader.rl" />\r
273                                 <exclude name="com/badlogic/gdx/utils/JsonReader.rl" />\r
274                         </fileset>                      \r
275                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java"/>\r
276                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java"/>\r
277                         <fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplet.java"/>\r
278                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java"/>\r
279                         <fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplicationConfiguration.java"/>\r
280                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplication.java"/>\r
281                         <fileset dir="backends" includes="gdx-backend-iosmonotouch/src/com/badlogic/gdx/backends/ios/IOSApplicationConfiguration.java"/>\r
282                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplication.java"/>\r
283                         <fileset dir="backends" includes="gdx-backends-gwt/src/com/badlogic/gdx/backends/gwt/GwtApplicationConfiguration.java"/>\r
284                 </javadoc>\r
285         </target>\r
286         \r
287         <!-- assumes that all the .dll and .a files have been compiled on a Mac and copied on top \r
288         of the current libgdx folder -->\r
289         <target name="copy-iosfiles">\r
290                 <!-- copy dll and .a files as well as IKVM, monotouch and ObjectAL binaries to ios folder-->\r
291                 <copy todir="${distDir}/ios" flatten="true" failonerror="false">\r
292                         <fileset dir="gdx/libs/ios32/">\r
293                                 <include name="*.a"/>\r
294                                 <include name="*.dll"/>\r
295                                 <include name="*.dll.mdb"/>\r
296                         </fileset>\r
297                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ios32">\r
298                                 <include name="*.dll"/>\r
299                                 <include name="*.dll.mdb"/>\r
300                                 <include name="*.a"/>\r
301                         </fileset>\r
302                 </copy>\r
303                 <copy todir="${distDir}/ios/ikvm" failonerror="false">\r
304                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/ikvm"/>\r
305                 </copy>\r
306                 <copy todir="${distDir}/ios/monotouch-jars" failonerror="false">\r
307                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/monotouch-jars"/>\r
308                 </copy>\r
309                 <copy todir="${distDir}/ios/objectal" failonerror="false">\r
310                         <fileset dir="backends/gdx-backend-iosmonotouch/libs/objectal"/>\r
311                 </copy>         \r
312                 \r
313                 <!-- copy freetype extension dll and .a files -->\r
314                 <copy todir="${distDir}/extensions/gdx-freetype/ios" failonerror="false">\r
315                         <fileset dir="extensions/gdx-freetype/libs/ios32">\r
316                                 <include name="*.a"/>\r
317                                 <include name="*.dll"/>\r
318                                 <include name="*.dll.mdb"/>\r
319                         </fileset>\r
320                 </copy>\r
321                 \r
322                 <!-- copy bullet extension dll and .a files -->\r
323                 <copy todir="${distDir}/extensions/gdx-bullet/ios" failonerror="false">\r
324                         <fileset dir="extensions/gdx-bullet/libs/ios32">\r
325                                 <include name="*.a"/>\r
326                                 <include name="*.dll"/>\r
327                                 <include name="*.dll.mdb"/>\r
328                         </fileset>\r
329                 </copy>\r
330         </target>\r
331 \r
332         <target name="jars" \r
333 depends="clean,gdx-setup-ui,gdx-core,gdx-openal,gdx-backend-lwjgl,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
334 \r
335         <target name="all" depends="jars,docs,copy-iosfiles">\r
336                 <!-- copy distribution files (licences etc.) -->\r
337                 <copy tofile="${distDir}/README" file="gdx/dist/README"/>\r
338                 <copy tofile="${distDir}/LICENSE" file="gdx/dist/LICENSE"/>\r
339                 <copy tofile="${distDir}/CC-LICENSE" file="gdx/dist/CC-LICENSE"/>\r
340                 <copy tofile="${distDir}/AUTHORS" file="gdx/dist/AUTHORS"/>\r
341                 <copy tofile="${distDir}/CONTRIBUTORS" file="gdx/dist/CONTRIBUTORS"/>\r
342                 \r
343                 <!-- zip dist dir -->\r
344                 <zip destfile="libgdx-${version}.zip" basedir="${distDir}"/>\r
345         </target>\r
346 </project>\r