forked from flixel-gdx/flixel-gdx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
301 lines (233 loc) · 9.47 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<?xml version="1.0" ?>
<project name="flixel" default="build" basedir=".">
<!--
Author: Emanuel Herrera
Base on:
https://github.com/jruby/joni/blob/master/build.xml
-->
<!-- Global variables -->
<property name="dist.dir" value="dist/" />
<property name="spec.title" value="flixel-gdx" />
<property name="spec.version" value="0.6-SNAPSHOT" />
<property name="spec.vendor" value="flixel-gdx team (https://github.com/flixel-gdx)" />
<property name="impl.title" value="org.flixel" />
<property environment="env"/>
<!-- clean distribution/output directory -->
<target name="clean">
<delete dir="${dist.dir}"/>
</target>
<target name="build">
<echo>
####### # # # # ###### # #### ##### # #
# # # # # # # # # # # # #
# # # ## ##### # ##### # # # ##
#### # # ## # # # ### # # ##
# # # # # # # # # # # # #
# ###### # # # ###### ###### #### ##### # #
</echo>
<echo message="version ${spec.version}" />
<antcall target="clean" />
<!-- Compile the core -->
<antcall target="compile-core" />
<!-- Compile the desktop -->
<antcall target="compile-other">
<param name="project" value="desktop"/>
</antcall>
<!-- Compile the android version -->
<antcall target="compile-other">
<param name="project" value="android"/>
</antcall>
<!-- Compile the gwt version -->
<antcall target="compile-other">
<param name="project" value="html5"/>
</antcall>
<!-- Generate javadoc -->
<antcall target="generate-doc" />
<!-- Save all in the single zip file -->
<antcall target="compress-dist" />
</target>
<target name="compile-core">
<echo message="---------------------------------------------"/>
<echo message="Start Compile: Core"/>
<echo message="---------------------------------------------"/>
<property name="src.dir" value="${ant.project.name}-core/src/" />
<property name="bin.dir" value="${ant.project.name}-core/bin/" />
<property name="bin.lib" value="${ant.project.name}-core/libs" />
<!-- Clean old build -->
<delete dir="${bin.dir}" />
<!-- Get dependency from the libs directory -->
<path id="classpath">
<fileset dir="${bin.lib}">
<include name="**/*.jar" />
</fileset>
</path>
<!-- Create the directory for the .class files -->
<mkdir dir="${bin.dir}" />
<!-- COMPILE!!!!!! -->
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${bin.dir}" classpathref="classpath" target="1.6" source="1.6"/>
<!-- Copy resources -->
<copy toDir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
<echo message="---------------------------------------------"/>
<echo message="End Compile: Core"/>
<echo message="---------------------------------------------"/>
<!-- Save .class in a jar file -->
<antcall target="packaging">
<param name="project" value="core"/>
</antcall>
</target>
<target name="compile-other">
<echo message="---------------------------------------------"/>
<echo message="Start Compile: ${project}"/>
<echo message="---------------------------------------------"/>
<property name="src.dir" value="${ant.project.name}-${project}/src/" />
<property name="bin.dir" value="${ant.project.name}-${project}/bin/" />
<property name="bin.lib" value="${ant.project.name}-${project}/libs" />
<!-- Clean old build -->
<delete dir="${bin.dir}" />
<!-- Get dependency from the libs directory -->
<path id="classpath">
<fileset dir="${bin.lib}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${ant.project.name}-core/libs">
<include name="**/*.jar" />
</fileset>
<!--<pathelement path="android.jar" />-->
<fileset dir=".">
<include name="*.jar"/>
</fileset>
<pathelement path="${dist.dir}/${ant.project.name}-core.jar" />
</path>
<!-- Crate the directory for the .class files -->
<mkdir dir="${bin.dir}" />
<!-- Copy resources -->
<copy toDir="${bin.dir}">
<fileset dir="${src.dir}">
<exclude name="**/*.java" />
</fileset>
</copy>
<!-- COMPILE!!!!!! -->
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${bin.dir}" classpathref="classpath" target="1.6" source="1.6"/>
<echo message="---------------------------------------------"/>
<echo message="End Compile: ${project}"/>
<echo message="---------------------------------------------"/>
<antcall target="packaging">
<param name="project" value="${project}"/>
</antcall>
</target>
<target name="packaging">
<!-- The project name: core, desktop, android -->
<echo message="---------------------------------------------"/>
<echo message="Start packaging: ${project}"/>
<echo message="---------------------------------------------"/>
<property name="src.dir" value="${ant.project.name}-${project}/src/" />
<property name="bin.dir" value="${ant.project.name}-${project}/bin/" />
<property name="bin.lib" value="${ant.project.name}-${project}/libs" />
<property name="jar.name" value="${ant.project.name}-${project}.jar" />
<property name="jar.name.source" value="${ant.project.name}-${project}-sources.jar" />
<tstamp>
<format property="buildDate" pattern="yyyy-MM-dd" />
<format property="buildTime" pattern="HH:mm:ss" />
</tstamp>
<!-- Create bin jar -->
<jar destfile="${dist.dir}/${jar.name}">
<fileset dir="${bin.dir}" />
<manifest>
<attribute name="Specification-Title" value="${spec.title}" />
<attribute name="Specification-Version" value="${spec.version}" />
<attribute name="Specification-Vendor" value="${spec.vendor}" />
<attribute name="Implementation-Vendor" value="${impl.title}" />
<attribute name="Built-Date" value="${buildDate}" />
<attribute name="Built-Time" value="${buildTime}" />
</manifest>
</jar>
<!-- Create source jar -->
<jar destfile="${dist.dir}/${jar.name.source}">
<fileset dir="${src.dir}" includes="**/*.java"/>
<!-- <zipgroupfileset file="${bin.lib}/*.jar">
<exclude name="*-natives.jar"/>
<exclude name="*-debug.jar"/>
<exclude name="android-*.jar"/>
<exclude name="gwt*.jar"/>
</zipgroupfileset>-->
</jar>
<echo message="---------------------------------------------"/>
<echo message="End packaging: ${project}"/>
<echo message="---------------------------------------------"/>
</target>
<!-- -->
<target name="generate-doc">
<javadoc destdir="${dist.dir}/docs"
sourcepath="${ant.project.name}-core/src/"
author="true"
version="true"
use="true"
windowtitle="flixel-gdx API"
doctitle="flixel-gdx API"
footer="flixel-gdx API"
useexternalfile="true">
<header><![CDATA[
flixel-gdx 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 © 2011-2014 Ka Wing Chin, Thomas Weston
</i></div>
]]></bottom>
<classpath>
<fileset dir="${ant.project.name}-core/libs" />
</classpath>
</javadoc>
</target>
<!-- =================================
target: compress-dist
Create zip file with the library
================================= -->
<target name="compress-dist">
<echo message="---------------------------------------------"/>
<echo message="Start Compress"/>
<echo message="---------------------------------------------"/>
<property name="licences" value="${dist.dir}/licences" />
<property name="compress" value="${dist.dir}/compress" />
<mkdir dir="${licences}" />
<mkdir dir="${compress}" />
<copy file="CC-LICENSE.md" todir="${licences}"/>
<copy file="LICENSE.md" todir="${licences}"/>
<copy file="README.md" todir="${licences}"/>
<!-- Compress javadoc in a zip file -->
<!-- <zip destfile="${dist.dir}/flixel-gdx-javadoc.zip" >
<fileset dir="${dist.dir}/docs" />
</zip>-->
<!-- Generate the final zip with the library, javadoc and licences -->
<zip destfile="${compress}/flixel-gdx-nightly.zip" >
<fileset dir="${dist.dir}">
<include name="**/*.jar" />
</fileset>
<!-- <fileset dir="${dist.dir}">
<include name="docs/**/**.*" />
</fileset>-->
<fileset dir="${licences}" />
</zip>
<delete dir="${licences}" />
<echo message="---------------------------------------------"/>
<echo message="End Compress"/>
<echo message="---------------------------------------------"/>
</target>
</project>