forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
202 lines (184 loc) · 9.09 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
libgdx distribution ant build file. Performs the compilation of the
gdx and backend modules and creates a distribution out of this mess.
-->
<project name="gdx" default="all" basedir=".">
<description>libgdx distribution build file</description>
<!-- property for NDK_HOME, you need to set this to
the root directory of your Android NDK installation,
e.g. c:\android-ndk or /opt/android-ndk -->
<property environment="env" />
<property name="env.NDK_HOME" value="/home/mzechner/android-ndk-r5"/>
<!-- libgdx version -->
<property name="version" value="0.91" />
<!-- output directory for distribution -->
<property name="stable" value="target" />
<target name="ver">
<echo>${version}</echo>
</target>
<!-- clean output directories -->
<target name="clean">
<delete dir="${stable}" />
<delete dir="gdx/bin" />
<delete dir="backends/gdx-openal/bin" />
<delete dir="backends/gdx-backend-jogl/bin" />
<delete dir="backends/gdx-backend-lwjgl/bin" />
<delete dir="backends/gdx-backend-android/bin" />
<delete dir="extensions/twl/gdx-twl/bin"/>
</target>
<!-- init task, creates all necessary directories -->
<target name="init" depends="clean">
<mkdir dir="${stable}" />
<mkdir dir="${stable}/docs/api"/>
<mkdir dir="gdx/bin" />
<mkdir dir="backends/gdx-openal/bin" />
<mkdir dir="backends/gdx-backend-jogl/bin" />
<mkdir dir="backends/gdx-backend-lwjgl/bin" />
<mkdir dir="backends/gdx-backend-android/bin" />
<mkdir dir="extensions/twl/gdx-twl/bin"/>
</target>
<!-- compiles the java code of all modules -->
<target name="compile" depends="init">
<!-- build gdx api -->
<javac debug="on" srcdir="gdx/src" destdir="gdx/bin" />
<copy tofile="gdx/bin/com/badlogic/gdx/utils/arial-15.png" file="gdx/src/com/badlogic/gdx/utils/arial-15.png" />
<copy tofile="gdx/bin/com/badlogic/gdx/utils/arial-15.fnt" file="gdx/src/com/badlogic/gdx/utils/arial-15.fnt" />
<!-- build gdx-openal -->
<javac debug="on" srcdir="backends/gdx-openal/src" destdir="backends/gdx-openal/bin">
<classpath>
<pathelement location="gdx/bin" />
<fileset file="backends/gdx-openal/libs/*.jar" />
</classpath>
</javac>
<!-- build jogl backend -->
<javac debug="on" srcdir="backends/gdx-backend-jogl/src" destdir="backends/gdx-backend-jogl/bin">
<classpath>
<pathelement location="gdx/bin" />
<pathelement location="backends/gdx-openal/bin" />
<fileset file="backends/gdx-backend-jogl/libs/*.jar" />
</classpath>
</javac>
<!-- build lwjgl backend -->
<javac debug="on" srcdir="backends/gdx-backend-lwjgl/src" destdir="backends/gdx-backend-lwjgl/bin">
<classpath>
<pathelement location="gdx/bin" />
<pathelement location="backends/gdx-openal/bin" />
<fileset file="backends/gdx-openal/libs/*.jar" />
<fileset file="backends/gdx-backend-lwjgl/libs/*.jar" />
</classpath>
</javac>
<!-- build android backend -->
<javac debug="on" srcdir="backends/gdx-backend-android/src" destdir="backends/gdx-backend-android/bin">
<classpath>
<pathelement location="gdx/bin" />
<fileset file="backends/gdx-backend-android/libs/*.jar" />
</classpath>
</javac>
<!-- build twl extensions -->
<javac debug="on" srcdir="extensions/twl/gdx-twl/src" destdir="extensions/twl/gdx-twl/bin">
<classpath>
<pathelement location="gdx/bin" />
<fileset file="extensions/twl/gdx-twl/libs/*.jar" />
</classpath>
</javac>
</target>
<!-- generates the javadoc for the core api and the application implementations -->
<target name="docs" depends="init">
<javadoc destdir="${stable}/docs/api" author="true" version="true" use="true"
windowtitle="libgdx API" doctitle="libgdx API" footer="libgdx API">
<header><![CDATA[
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
]]></header>
<bottom><![CDATA[
<div style="font-size:9pt"><i>
Copyright 2010 Mario Zechner ([email protected]), Nathan Sweet ([email protected])
</i></div>
]]></bottom>
<fileset dir="gdx/src" defaultexcludes="yes">
<include name="com/badlogic/gdx/**" />
<exclude name="com/badlogic/gdx/utils/arial-15.fnt" />
<exclude name="com/badlogic/gdx/utils/arial-15.png" />
<exclude name="com/badlogic/gdx/utils/Xml.rl" />
</fileset>
<fileset dir="backends" includes="gdx-backend-jogl/src/com/badlogic/gdx/backends/jogl/JoglApplication.java"/>
<fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java"/>
<fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglCanvas.java"/>
<fileset dir="backends" includes="gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplet.java"/>
<fileset dir="backends" includes="gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidApplication.java"/>
<fileset dir="extensions/twl/" includes="gdx-twl/src/com/badlogic/gdx/twl/TWL.java"/>
</javadoc>
</target>
<target name="compile-natives" depends="init">
<ant antfile="build.xml" target="clean" dir="gdx/jni"/>
<ant antfile="build.xml" target="all" dir="gdx/jni"/>
</target>
<!-- creates jars and places other files in the output dir -->
<target name="package" depends="compile">
<!-- for some reason excludes don't work so we have to delete the ndk directory first... -->
<delete dir="gdx/bin/ndk" />
<jar destfile="${stable}/gdx.jar" basedir="gdx/bin" />
<jar destfile="${stable}/gdx-sources.jar" basedir="gdx/src" />
<jar destfile="${stable}/gdx-backend-android-sources.jar" basedir="backends/gdx-backend-android/src" />
<jar destfile="${stable}/gdx-backend-jogl-sources.jar" basedir="backends/gdx-backend-jogl/src" />
<jar destfile="${stable}/gdx-backend-lwjgl-sources.jar" basedir="backends/gdx-backend-lwjgl/src" />
<jar destfile="${stable}/gdx-backend-jogl.jar">
<fileset dir="backends/gdx-openal/bin" />
<zipgroupfileset file="backends/gdx-openal/libs/*.jar">
<exclude name="lwjgl-debug.jar"/>
</zipgroupfileset>
<fileset dir="backends/gdx-backend-jogl/bin" />
<zipgroupfileset file="backends/gdx-backend-jogl/libs/*.jar">
<exclude name="*-natives.jar"/>
</zipgroupfileset>
</jar>
<jar destfile="${stable}/gdx-backend-lwjgl.jar">
<fileset dir="backends/gdx-openal/bin" />
<zipgroupfileset file="backends/gdx-openal/libs/*.jar">
<exclude name="lwjgl-debug.jar"/>
</zipgroupfileset>
<fileset dir="backends/gdx-backend-lwjgl/bin" />
<zipgroupfileset file="backends/gdx-backend-lwjgl/libs/*.jar">
<exclude name="*-natives.jar"/>
</zipgroupfileset>
</jar>
<jar destfile="${stable}/gdx-backend-android.jar" basedir="backends/gdx-backend-android/bin" />
<jar destfile="${stable}/gdx-twl.jar">
<fileset dir="extensions/twl/gdx-twl/bin" />
<zipgroupfileset file="extensions/twl/gdx-twl/libs/*.jar" />
</jar>
<copy tofile="${stable}/gdx-natives.jar" file="gdx/libs/gdx-natives.jar" />
<copy tofile="${stable}/gdx-backend-jogl-natives.jar" file="backends/gdx-backend-jogl/libs/gdx-backend-jogl-natives.jar" />
<copy tofile="${stable}/gdx-backend-lwjgl-natives.jar" file="backends/gdx-backend-lwjgl/libs/gdx-backend-lwjgl-natives.jar" />
<copy tofile="${stable}/armeabi/libgdx.so" file="gdx/libs/armeabi/libgdx.so" />
<!--<copy tofile="${stable}/armeabi/libmpg123.so" file="gdx/libs/armeabi/libmpg123.so" />-->
<copy tofile="${stable}/armeabi/libandroidgl20.so" file="gdx/dist/armeabi/libandroidgl20.so" />
<copy tofile="${stable}/armeabi-v7a/libgdx.so" file="gdx/libs/armeabi-v7a/libgdx.so" />
<!--<copy tofile="${stable}/armeabi-v7a/libmpg123.so" file="gdx/libs/armeabi-v7a/libmpg123.so" />-->
<copy tofile="${stable}/armeabi-v7a/libandroidgl20.so" file="gdx/dist/armeabi/libandroidgl20.so" />
<copy tofile="${stable}/README" file="gdx/dist/README" />
<copy tofile="${stable}/LICENSE" file="gdx/dist/LICENSE" />
<copy tofile="${stable}/CC-LICENSE" file="gdx/dist/CC-LICENSE" />
<copy tofile="${stable}/AUTHORS" file="gdx/dist/AUTHORS" />
<copy tofile="${stable}/CONTRIBUTORS" file="gdx/dist/CONTRIBUTORS" />
</target>
<!-- builds the distribution zip -->
<target name="dist" depends="docs,compile,compile-natives,package">
<zip destfile="libgdx-${version}.zip" basedir="${stable}"/>
</target>
<target name="all" depends="docs,compile,package">
<zip destfile="libgdx-${version}.zip" basedir="${stable}"/>
</target>
</project>