-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.xml
274 lines (230 loc) · 11.1 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="zombietime" default="run">
<property file="build.properties"/>
<!-- Uncomment the following property if no tests compilation is needed -->
<!--
<property name="skip.tests" value="true"/>
-->
<!-- 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="700m"/>
<patternset id="ignored.files">
<exclude name="**/*.hprof/**"/>
<exclude name="**/*.pyc/**"/>
<exclude name="**/*.pyo/**"/>
<exclude name="**/*.rbc/**"/>
<exclude name="**/*~/**"/>
<exclude name="**/.DS_Store/**"/>
<exclude name="**/.bundle/**"/>
<exclude name="**/.git/**"/>
<exclude name="**/.hg/**"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.tox/**"/>
<exclude name="**/CVS/**"/>
<exclude name="**/RCS/**"/>
<exclude name="**/SCCS/**"/>
<exclude name="**/__pycache__/**"/>
<exclude name="**/_svn/**"/>
<exclude name="**/rcs/**"/>
<exclude name="**/vssver.scc/**"/>
<exclude name="**/vssver2.scc/**"/>
</patternset>
<patternset id="library.patterns">
<include name="*.war"/>
<include name="*.ear"/>
<include name="*.apk"/>
<include name="*.zip"/>
<include name="*.swc"/>
<include name="*.ane"/>
<include name="*.egg"/>
<include name="*.jar"/>
</patternset>
<patternset id="compiler.resources">
<exclude name="**/?*.java"/>
<exclude name="**/?*.form"/>
<exclude name="**/?*.class"/>
<exclude name="**/?*.groovy"/>
<exclude name="**/?*.scala"/>
<exclude name="**/?*.flex"/>
<exclude name="**/?*.kt"/>
<exclude name="**/?*.clj"/>
</patternset>
<!-- JDK definitions -->
<property name="jdk.bin.1.8" value="${jdk.home.1.8}/bin"/>
<path id="jdk.classpath.1.8">
<fileset dir="${jdk.home.1.8}">
<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/jfr.jar"/>
<include name="jre/lib/jfxswt.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/access-bridge-64.jar"/>
<include name="jre/lib/ext/cldrdata.jar"/>
<include name="jre/lib/ext/dnsns.jar"/>
<include name="jre/lib/ext/jaccess.jar"/>
<include name="jre/lib/ext/jfxrt.jar"/>
<include name="jre/lib/ext/localedata.jar"/>
<include name="jre/lib/ext/nashorn.jar"/>
<include name="jre/lib/ext/sunec.jar"/>
<include name="jre/lib/ext/sunjce_provider.jar"/>
<include name="jre/lib/ext/sunmscapi.jar"/>
<include name="jre/lib/ext/sunpkcs11.jar"/>
<include name="jre/lib/ext/zipfs.jar"/>
</fileset>
</path>
<property name="project.jdk.home" value="${jdk.home.1.8}"/>
<property name="project.jdk.bin" value="${jdk.bin.1.8}"/>
<property name="project.jdk.classpath" value="jdk.classpath.1.8"/>
<!-- Project Libraries -->
<path id="library.log4j-2.6.2.classpath">
<pathelement location="${basedir}/lib/log4j-api-2.6.2.jar"/>
<pathelement location="${basedir}/lib/log4j-core-2.6.2.jar"/>
</path>
<path id="library.pi4j-core.classpath">
<pathelement location="${basedir}/lib/pi4j-core.jar"/>
<pathelement location="${basedir}/lib/pi4j-device.jar"/>
<pathelement location="${basedir}/lib/pi4j-gpio-extension.jar"/>
</path>
<!-- Modules -->
<!-- Module ZombieTime -->
<dirname property="module.zombietime.basedir" file="${ant.file}"/>
<property name="module.jdk.home.zombietime" value="${project.jdk.home}"/>
<property name="module.jdk.bin.zombietime" value="${project.jdk.bin}"/>
<property name="module.jdk.classpath.zombietime" value="${project.jdk.classpath}"/>
<property name="compiler.args.zombietime" value="-encoding UTF-8 -source 8 ${compiler.args}"/>
<property name="zombietime.output.dir" value="${module.zombietime.basedir}/out/production/ZombieTime"/>
<property name="zombietime.testoutput.dir" value="${module.zombietime.basedir}/out/test/ZombieTime"/>
<path id="zombietime.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="zombietime.module.production.classpath">
<path refid="${module.jdk.classpath.zombietime}"/>
<path refid="library.pi4j-core.classpath"/>
<path refid="library.log4j-2.6.2.classpath"/>
</path>
<path id="zombietime.runtime.production.module.classpath">
<pathelement location="${zombietime.output.dir}"/>
<path refid="library.pi4j-core.classpath"/>
<path refid="library.log4j-2.6.2.classpath"/>
</path>
<path id="zombietime.module.classpath">
<path refid="${module.jdk.classpath.zombietime}"/>
<pathelement location="${zombietime.output.dir}"/>
<path refid="library.pi4j-core.classpath"/>
<path refid="library.log4j-2.6.2.classpath"/>
</path>
<path id="zombietime.runtime.module.classpath">
<pathelement location="${zombietime.testoutput.dir}"/>
<pathelement location="${zombietime.output.dir}"/>
<path refid="library.pi4j-core.classpath"/>
<path refid="library.log4j-2.6.2.classpath"/>
</path>
<patternset id="excluded.from.module.zombietime">
<patternset refid="ignored.files"/>
</patternset>
<patternset id="excluded.from.compilation.zombietime">
<patternset refid="excluded.from.module.zombietime"/>
</patternset>
<path id="zombietime.module.sourcepath">
<dirset dir="${module.zombietime.basedir}">
<include name="src"/>
</dirset>
</path>
<target name="compile.module.zombietime" depends="compile.module.zombietime.production,compile.module.zombietime.tests" description="Compile module ZombieTime"/>
<target name="compile.module.zombietime.production" description="Compile module ZombieTime; production classes">
<mkdir dir="${zombietime.output.dir}"/>
<javac destdir="${zombietime.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true" executable="${module.jdk.bin.zombietime}/javac">
<compilerarg line="${compiler.args.zombietime}"/>
<bootclasspath refid="zombietime.module.bootclasspath"/>
<classpath refid="zombietime.module.production.classpath"/>
<src refid="zombietime.module.sourcepath"/>
<patternset refid="excluded.from.compilation.zombietime"/>
</javac>
<copy todir="${zombietime.output.dir}">
<fileset dir="${module.zombietime.basedir}/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile.module.zombietime.tests" depends="compile.module.zombietime.production" description="compile module ZombieTime; test classes" unless="skip.tests"/>
<target name="clean.module.zombietime" description="cleanup module">
<delete dir="${zombietime.output.dir}"/>
<delete dir="${zombietime.testoutput.dir}"/>
</target>
<target name="init" description="Build initialization">
<!-- Perform any build initialization in this target -->
</target>
<target name="clean" depends="clean.module.zombietime, clean.artifact.javafxapp" description="cleanup all"/>
<target name="build.modules" depends="init, clean, compile.module.zombietime" description="build all modules"/>
<target name="init.artifacts">
<property name="artifacts.temp.dir" value="${basedir}/__artifacts_temp"/>
<property name="artifact.output.javafxapp" value="${basedir}/out/artifacts/JavaFXApp"/>
<mkdir dir="${artifacts.temp.dir}"/>
<property name="artifact.temp.output.JavaFXApp" value="${artifacts.temp.dir}/JavaFXApp.jar"/>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpath="${jdk.home.1.8}/lib/ant-javafx.jar"/>
</target>
<target name="clean.artifact.javafxapp" description="clean JavaFXApp artifact output">
<delete dir="${artifact.output.javafxapp}"/>
</target>
<target name="artifact.javafxapp" depends="init.artifacts, compile.module.zombietime" description="Build 'JavaFXApp' artifact" xmlns:fx="javafx:com.sun.javafx.tools.ant">
<mkdir dir="${artifact.output.javafxapp}"/>
<copy todir="${artifact.temp.output.JavaFXApp}">
<fileset dir="${zombietime.output.dir}"/>
</copy>
<copy file="${basedir}/lib/log4j-api-2.6.2.jar" tofile="${artifact.temp.output.JavaFXApp}/log4j-api-2.6.2.jar"/>
<copy file="${basedir}/lib/log4j-core-2.6.2.jar" tofile="${artifact.temp.output.JavaFXApp}/log4j-core-2.6.2.jar"/>
<copy file="${basedir}/lib/pi4j-core.jar" tofile="${artifact.temp.output.JavaFXApp}/pi4j-core.jar"/>
<copy file="${basedir}/lib/pi4j-gpio-extension.jar" tofile="${artifact.temp.output.JavaFXApp}/pi4j-gpio-extension.jar"/>
<copy file="${basedir}/lib/pi4j-device.jar" tofile="${artifact.temp.output.JavaFXApp}/pi4j-device.jar"/>
<mkdir dir="${artifact.temp.output.JavaFXApp}/META-INF"/>
<copy file="${basedir}/META-INF/MANIFEST.MF" tofile="${artifact.temp.output.JavaFXApp}/META-INF/MANIFEST.MF"/>
<fx:fileset id="all_but_JavaFXApp" dir="${artifact.temp.output.JavaFXApp}" includes="**/*.jar">
<exclude name="JavaFXApp.jar"/>
</fx:fileset>
<fx:fileset id="all_JavaFXApp" dir="${artifact.temp.output.JavaFXApp}" includes="**/*.jar"/>
<fx:application id="JavaFXApp_id" name="JavaFXApp" mainClass="sample.Main"/>
<fx:jar destfile="${artifact.temp.output.JavaFXApp}\JavaFXApp.jar">
<fx:application refid="JavaFXApp_id"/>
<fileset dir="${artifact.temp.output.JavaFXApp}" excludes="**/*.jar"/>
<fx:resources>
<fx:fileset refid="all_but_JavaFXApp"/>
</fx:resources>
<manifest/>
</fx:jar>
<mkdir dir="${artifact.temp.output.JavaFXApp}\deploy"/>
<fx:deploy width="600" height="400" updatemode="background" outdir="${artifact.temp.output.JavaFXApp}\deploy" outfile="JavaFXApp">
<fx:application refid="JavaFXApp_id"/>
<fx:resources>
<fx:fileset refid="all_JavaFXApp"/>
</fx:resources>
</fx:deploy>
<copy todir="${artifact.output.javafxapp}">
<fileset dir="${artifact.temp.output.JavaFXApp}/deploy"/>
</copy>
<delete includeemptydirs="true">
<fileset dir="${artifact.temp.output.JavaFXApp}"/>
</delete>
</target>
<target name="build.all.artifacts" depends="artifact.javafxapp" description="Build all artifacts">
<!-- Delete temporary files -->
<delete dir="${artifacts.temp.dir}"/>
</target>
<target name="all" depends="build.modules, build.all.artifacts" description="build all"/>
<target name="run" description="Runs the Zombie Time" depends="compile.module.zombietime.production">
<java classname="sample.Main" fork="true">
<classpath>
<path refid="zombietime.module.production.classpath"/>
<pathelement location="${zombietime.output.dir}"/>
</classpath>
</java>
</target>
</project>