forked from davidc/gootool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
398 lines (330 loc) · 15.7 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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--$Id$-->
<project name="gootool" default="recompile">
<!--
ant.properties must contain:
launch4j.dir
jdk.home
svn.base (if tag-release task is needed)
nsis.dir (directory of makensis, for dist-win32)
-->
<property file="ant.properties"/>
<!-- Libraries required only for building are in lib/build/ -->
<path id="build.classpath">
<fileset dir="lib/build" includes="*.jar"/>
</path>
<!-- Definitions of new tasks -->
<taskdef name="javac2" classname="com.intellij.ant.Javac2" classpathref="build.classpath"/>
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"/>
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="build.classpath"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="build.classpath"/>
<taskdef name="jarbundler"
classpathref="build.classpath"
classname="net.sourceforge.jarbundler.JarBundler"/>
<taskdef name="nsis"
classpathref="build.classpath"
classname="net.sf.nsisant.Task"/>
<taskdef name="deb"
classpathref="build.classpath"
classname="com.googlecode.ant_deb_task.Deb"/>
<!-- Version numbers -->
<property name="release.properties" value="resources/release.properties"/>
<property file="${release.properties}"/>
<property name="gootool.version" value="${release.major}.${release.minor}.${release.micro}.${release.revision}"/>
<condition property="gootool.version.full"
value="${gootool.version}"
else="${gootool.version}-${release.type}">
<equals arg1="${release.type}" arg2=""/>
</condition>
<!-- Compiler options -->
<property name="compiler.debug" value="on"/>
<property name="compiler.generate.no.warnings" value="off"/>
<property name="compiler.args" value=""/>
<property name="compiler.max.memory" value="128m"/>
<patternset id="ignored.files">
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.svn/**"/>
</patternset>
<!-- JDK definitions -->
<property name="jdk.bin" value="${jdk.home}/bin"/>
<path id="jdk.classpath">
<fileset dir="${jdk.home}">
<include name="jre/lib/charsets.jar"/>
<include name="jre/lib/deploy.jar"/>
<include name="jre/lib/javaws.jar"/>
<include name="jre/lib/jce.jar"/>
<include name="jre/lib/jsse.jar"/>
<include name="jre/lib/management-agent.jar"/>
<include name="jre/lib/plugin.jar"/>
<include name="jre/lib/resources.jar"/>
<include name="jre/lib/rt.jar"/>
<include name="jre/lib/ext/dnsns.jar"/>
<include name="jre/lib/ext/localedata.jar"/>
<include name="jre/lib/ext/sunjce_provider.jar"/>
<include name="jre/lib/ext/sunmscapi.jar"/>
<include name="jre/lib/ext/sunpkcs11.jar"/>
</fileset>
</path>
<property name="project.jdk.home" value="${jdk.home}"/>
<property name="project.jdk.bin" value="${jdk.bin}"/>
<property name="project.jdk.classpath" value="${jre.classes}"/>
<!-- Module gootool -->
<dirname property="basedir" file="${ant.file}"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="output.dir" value="${build.dir}/compiled"/>
<property name="output.jar" value="${build.dir}/gootool.jar"/>
<property name="build.properties" value="${output.dir}/build.properties"/>
<path id="gootool.module.runtime.classpath">
<fileset file="${project.jdk.classpath}"/>
<!--<pathelement location="${output.dir}"/>-->
<pathelement location="${basedir}/resources"/>
<fileset dir="${basedir}/dist_src/common/lib/"/>
</path>
<path id="gootool.module.build.classpath">
<path refid="gootool.module.runtime.classpath"/>
<path refid="build.classpath"/>
</path>
<path id="gootool.module.sourcepath">
<dirset dir="${basedir}">
<include name="resources"/>
<include name="src"/>
</dirset>
</path>
<!-- build properties -->
<target name="-update-build-properties">
<mkdir dir="${build.dir}"/>
<mkdir dir="${output.dir}"/>
<propertyfile file="${build.properties}" comment="AUTOGENERATED. DO NOT EDIT!">
<entry key="build.date" type="date" value="now" pattern="dd/MM/yyyy HH:mm"/>
<entry key="build.os" type="string" value="${os.name} ${os.arch} ${os.version}"/>
<entry key="build.user" type="string" value="${user.name}"/>
<entry key="build.java" type="string" value="${java.version}"/>
</propertyfile>
</target>
<target name="compile" depends="-update-build-properties" description="Compile module gootool">
<mkdir dir="${output.dir}"/>
<javac2 destdir="${output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}"
fork="true" executable="${project.jdk.bin}/javac" source="1.8" target="1.8">
<compilerarg line="${compiler.args}"/>
<!--<bootclasspath refid="gootool.module.bootclasspath"/>-->
<classpath refid="gootool.module.build.classpath"/>
<src refid="gootool.module.sourcepath"/>
<patternset refid="ignored.files"/>
</javac2>
<copy todir="${output.dir}">
<fileset dir="${basedir}/resources">
<patternset refid="ignored.files"/>
<type type="file"/>
</fileset>
</copy>
</target>
<property name="dist.dir" value="dist"/>
<property name="dist.win32" value="${dist.dir}/win32"/>
<property name="dist.linux" value="${dist.dir}/linux"/>
<property name="dist.macosx" value="${dist.dir}/macosx"/>
<target name="clean" description="cleanup all">
<delete dir="${dist.dir}"/>
<delete dir="${build.dir}"/>
</target>
<target name="recompile" depends="clean, compile" description="build all"/>
<target name="jar" depends="compile">
<jar jarfile="${output.jar}">
<fileset dir="${output.dir}" excludes="com/goofans/gootoolsp/**,com/goofans/datamining/**,gootoolsp/**"/>
</jar>
</target>
<target name="launcher-win32" description="builds the launcher" depends="clean, jar">
<mkdir dir="${dist.win32}"/>
<mkdir dir="${dist.win32}/bin"/>
<launch4j configFile="launcher/launch4j.xml"
jar="${output.jar}"
outfile="${dist.win32}/bin/gootool.exe"
fileversion="${gootool.version}"
txtfileversion="${gootool.version.full}"
productversion="${gootool.version}"
txtproductversion="${gootool.version.full}"
/>
<launch4j configFile="launcher/launch4j-info.xml"
jar="${output.jar}"
outfile="${dist.win32}/bin/gooinfo.exe"
fileversion="${gootool.version}"
txtfileversion="${gootool.version.full}"
productversion="${gootool.version}"
txtproductversion="${gootool.version.full}"
/>
</target>
<target name="dist-win32" description="Build the Win32 distribution" depends="launcher-win32">
<copy todir="${dist.win32}">
<fileset dir="dist_src/common">
<patternset refid="ignored.files"/>
<type type="file"/>
</fileset>
</copy>
<copy todir="${dist.win32}">
<fileset dir="dist_src/win32">
<patternset refid="ignored.files"/>
<type type="file"/>
</fileset>
</copy>
<copy todir="${dist.win32}/doc">
<fileset file="doc/CHANGELOG.txt"/>
</copy>
<copy file="lib/build/AppleJavaExtensions.jar" todir="${dist.win32}/lib"/>
<!--<zip destfile="${dist.dir}/GooTool-${gootool.version.full}-Windows.zip">-->
<!--<zipfileset dir="${dist.win32}" prefix="GooTool-${gootool.version.full}"/>-->
<!--</zip>-->
<nsis script="installer/installer.nsi" verbosity="2" path="${nsis.dir}" nocd="true">
<define name="gootool.version" value="${gootool.version}"/>
<define name="gootool.version.full" value="${gootool.version.full}"/>
</nsis>
</target>
<target name="dist-macosx" description="Build the Mac OS X distribution" depends="clean, jar">
<mkdir dir="${dist.macosx}"/>
<copy file="${output.jar}" tofile="${dist.macosx}/gootool.jar"/>
<jarbundler dir="${dist.macosx}" verbose="false" showPlist="false"
name="GooTool"
mainclass="com.goofans.gootool.GooTool"
icon="dist_src/macosx/gootool.icns"
version="${gootool.version.full}"
jvmversion="1.5+"
workingdirectory="$APP_PACKAGE/Contents/Resources"
stubfile="dist_src/macosx/JavaApplicationStub"
>
<jarfileset dir="dist_src/common/lib/">
<include name="*.jar"/>
</jarfileset>
<jarfileset dir="${dist.macosx}">
<include name="gootool.jar"/>
</jarfileset>
<!--<extraclasspathfilelist files="gootool.jar"/>-->
<javaproperty name="java.util.logging.config.file" value="$APP_PACKAGE/Contents/Resources/logger_properties.txt"/>
<javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
<documenttype name="World of Goo addin"
extensions="goomod"
mimetypes="application/x-world-of-goo-addin"
role="Viewer"
iconfile="dist_src/macosx/goomod.icns"/>
</jarbundler>
<delete file="${dist.macosx}/gootool.jar"/>
<mkdir dir="${dist.macosx}/GooTool.app/Contents/Resources/Licenses"/>
<copy todir="${dist.macosx}/GooTool.app/Contents/Resources/Licenses">
<fileset dir="dist_src/common/doc/" includes="*"/>
</copy>
<copy todir="${dist.macosx}/GooTool.app/Contents/Resources/">
<fileset dir="dist_src/common/etc" includes="*"/>
</copy>
<zip destfile="${dist.dir}/GooTool-${gootool.version.full}-MacOSX.zip">
<zipfileset dir="${dist.macosx}" prefix="">
<exclude name="GooTool.app/Contents/MacOS/JavaApplicationStub"/>
</zipfileset>
<zipfileset filemode="755" dir="${dist.macosx}" prefix="">
<filename name="GooTool.app/Contents/MacOS/JavaApplicationStub"/>
</zipfileset>
</zip>
</target>
<target name="dist-linux" description="Build the Linux distribution" depends="clean, jar">
<copy todir="${dist.linux}">
<fileset dir="dist_src/common">
<patternset refid="ignored.files"/>
<type type="file"/>
</fileset>
</copy>
<copy todir="${dist.linux}">
<fileset dir="dist_src/linux">
<patternset refid="ignored.files"/>
<type type="file"/>
</fileset>
</copy>
<copy todir="${dist.linux}/doc">
<fileset file="doc/CHANGELOG.txt"/>
</copy>
<copy file="${output.jar}" tofile="${dist.linux}/lib/gootool.jar"/>
<copy file="lib/build/AppleJavaExtensions.jar" todir="${dist.linux}/lib"/>
<tar destfile="${dist.dir}/gootool-${gootool.version.full}-linux.tar.bz2" compression="bzip2">
<tarfileset dir="${dist.linux}" prefix="gootool-${gootool.version.full}" mode="755" username="root" group="root">
<include name="bin/"/>
</tarfileset>
<tarfileset dir="${dist.linux}" prefix="gootool-${gootool.version.full}" username="root" group="root">
<exclude name="bin/"/>
</tarfileset>
</tar>
<deb todir="${dist.dir}" package="gootool" section="contrib/games" depends="java5-runtime" suggests="WorldOfGoo"
postinst="dist_src/linux_debian/postinst"
postrm="dist_src/linux_debian/postrm">
<version upstream="${gootool.version.full}"/>
<maintainer name="David Croft" email="[email protected]"/>
<description synopsis="World of Goo modding tool">
GooTool is a utility to enhance your World of Goo experience and enable you to install new levels and mods to provide further gameplay.
</description>
<tarfileset dir="${dist.dir}/linux/bin" prefix="usr/bin" includes="*" filemode="755" username="root" group="root"/>
<tarfileset dir="${dist.dir}/linux/doc" prefix="usr/share/doc/gootool" includes="*" username="root" group="root"/>
<tarfileset dir="${dist.dir}/linux/lib" prefix="usr/share/gootool" includes="*" username="root" group="root"/>
<conffiles dir="${dist.dir}/linux/etc" prefix="etc/gootool" includes="*" username="root" group="root"/>
<tarfileset dir="dist_src/linux_debian" prefix="usr/share/applications" includes="*.desktop" username="root" group="root"/>
<tarfileset dir="resources" prefix="usr/share/gootool" includes="48x48.png" username="root" group="root"/>
</deb>
</target>
<target name="dist" description="Build the distribution" depends="dist-win32, dist-linux, dist-macosx"/>
<property name="svn.trunk" value="${svn.base}/trunk"/>
<property name="svn.tags" value="${svn.base}/tags"/>
<target name="tag-release" description="Tag a new release in Subversion">
<svn javahl="false">
<update file="${release.properties}" revision="HEAD"/>
<wcversion path="."/>
</svn>
<!-- Remove the -dev suffix, set the tag date and revision and commit -->
<propertyfile file="${release.properties}" comment="AUTOGENERATED. DO NOT EDIT!">
<entry key="release.type" type="string" value=""/>
<entry key="release.date" type="date" value="now" pattern="dd/MM/yyyy HH:mm"/>
<entry key="release.revision" value="${revision.max}"/>
</propertyfile>
<var file="${release.properties}"/>
<svn javahl="false">
<commit file="${release.properties}" message="pre-release ${release.major}_${release.minor}_${release.micro}"/>
</svn>
<!-- Tag -->
<svn javahl="false">
<copy srcUrl="${svn.trunk}" destUrl="${svn.tags}/Release_${release.major}_${release.minor}_${release.micro}"
message="Tagging release ${release.major}_${release.minor}_${release.micro}"/>
</svn>
<!-- Increment version, add -dev suffix and commit -->
<propertyfile file="${release.properties}" comment="AUTOGENERATED. DO NOT EDIT!">
<entry key="release.type" type="string" value="dev"/>
<entry key="release.micro" type="int" operation="+" default="0"/>
</propertyfile>
<var file="${release.properties}"/>
<svn javahl="false">
<commit file="${release.properties}" message="post-release bump version to ${release.major}_${release.minor}_${release.micro}-dev"/>
</svn>
</target>
<target name="source" description="Build the source release">
<mkdir dir="${dist.dir}"/>
<tar destfile="dist/gootool-${gootool.version.full}-source.tar.bz2" compression="bzip2" longfile="fail">
<tarfileset dir="dist_src/common/doc/" prefix="gootool-${gootool.version.full}">
<include name="LICENSE.txt"/>
</tarfileset>
<tarfileset dir="." prefix="gootool-${gootool.version.full}">
<include name="dist_src/"/>
<include name="installer/"/>
<include name="launcher/"/>
<include name="lib/"/>
<include name="resources/"/>
<exclude name="resources/gootoolsp/"/>
<include name="src/"/>
<exclude name="src/com/goofans/datamining/"/>
<exclude name="src/com/goofans/gootoolsp/"/>
<exclude name="src/com/goofans/towerbuilder/"/>
<exclude name="src/com/goofans/gootool/iphone/"/>
<include name="ant.properties"/>
<include name="build.xml"/>
<include name="gootool.iml"/>
<include name="gootool.ipr"/>
<include name="logger_dev.properties"/>
<include name="mapping/${gootool.version.full}.mapping"/>
<include name="doc/"/>
<exclude name="doc/private/"/>
</tarfileset>
</tar>
</target>
</project>