-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathbuild.xml
289 lines (228 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
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE project [
<!ENTITY releases SYSTEM "releases/build-releases.xml">
]>
<project name="jes" basedir="." default="build"
xmlns:if="ant:if" xmlns:unless="ant:unless">
<!-- Load a property file -->
<condition property="build.properties.exists">
<resourceexists>
<file file="${basedir}/build.properties" />
</resourceexists>
</condition>
<loadproperties srcFile="${basedir}/build.properties"
if:set="build.properties.exists" />
<!-- Project metadata -->
<property name="release" value="-snapshot" unless:set="release" />
<!-- The name -->
<property name="jes.title" value="JES" />
<property name="jes.basename" value="jes" />
<!-- <condition property="jes.name.original-jes">
<equals arg1="${jes.title}" arg2="JES" />
</condition> -->
<!-- <property name="jes.fulltitle" value="JES - Jython Environment for Students" if:set="jes.name.original-jes" />
<property name="jes.fulltitle" value="${jes.title}" unless:set="jes.name.original-jes" /> -->
<property name="jes.fulltitle" value="JES - Jython Environment for Students" />
<!-- <property name="jes.fulltitle" value="JES" /> -->
<!-- <condition property="jes.name.contain-jes">
<and>
<contains string="${jes.fulltitle}" substring="JES" />
<contains string="${jes.basename}" substring="jes" />
</and>
</condition>
<fail unless:set="jes.name.contain-jes">Your build's name should include the name "JES."</fail> -->
<!-- Other metadata -->
<property name="jes.vendor" value="Georgia Institute of Technology" />
<property name="jes.copyright" value="© 2019 Matthew Frazier, Mark Guzdial, and others" />
<property name="jes.version" value="6.0" />
<property name="jes.release" value="${jes.version}${release}" />
<tstamp>
<format property="jes.release.date" pattern="MMMMM d, yyyy" />
<format property="jes.release.year" pattern="yyyy" />
</tstamp>
<!-- Websites -->
<property name="jes.homepage" value="https://github.com/gatech-csl/jes" />
<property name="jes.homepage.host" value="GitHub" />
<property name="jes.issues" value="https://github.com/gatech-csl/jes/issues" />
<property name="jes.issues.host" value="GitHub" />
<!-- Filter tokens -->
<filter token="basename" value="jes" />
<filter token="title" value="JES" />
<filter token="fulltitle" value="JES" />
<filter token="copyright" value="${jes.copyright}" />
<filter token="vendor" value="${jes.vendor}" />
<filter token="version" value="${jes.version}" />
<filter token="release" value="${jes.release}" />
<filter token="releasesuffix" value="${release}" />
<filter token="releasedate" value="${jes.release.date}" />
<filter token="releaseyear" value="${jes.release.year}" />
<filter token="homepage" value="${jes.homepage}" />
<filter token="homepagehost" value="${jes.homepage.host}" />
<filter token="issues" value="${jes.issues}" />
<filter token="issueshost" value="${jes.issues.host}" />
<!-- Source code properties -->
<property name="jes.target-java" value="1.8" />
<!-- Paths to things in the repository -->
<property name="jes.home" location="jes" />
<property name="jes.encoding" value="UTF-8" />
<property name="jes.python.src" location="${jes.home}/python" />
<property name="jes.java.src" location="${jes.home}/java" />
<property name="jes.java.class" location="${jes.home}/classes" />
<property name="jes.java.jar" location="${jes.home}/classes.jar" />
<property name="jes.javadoc" location="${jes.home}/javadoc" />
<property name="jes.main" value="JESstartup" />
<property name="jes.configfile.name" value="JESConfig.properties" />
<property name="jes.deps" location="dependencies" />
<property name="jes.deps.python" location="${jes.deps}/python" />
<property name="jes.deps.jardir" location="${jes.deps}/jars" />
<property name="jes.deps.jmusic.jar" location="${jes.deps.jardir}/jMusic1.7.jar" />
<property name="jes.instruments" location="${jes.deps}/jmusic-instruments" />
<property name="jes.instruments.src" location="${jes.instruments}/java" />
<property name="jes.instruments.class" location="${jes.instruments}/classes" />
<property name="jes.instruments.jar" location="${jes.deps.jardir}/jmusic-instruments.jar" />
<property name="python.home" location="${jes.deps}/jython" />
<property name="python.main" value="org.python.util.jython" />
<property name="jes.tests" location="tests" />
<property name="jes.tests.script" location="${jes.tests}/TestExecute.py" />
<property name="jes.tests.output" location="${jes.tests}/test-output" />
<property name="jes.release.dir" location="releases" />
<property name="jes.help" location="${jes.home}/help" />
<property name="jes.help.copyright" location="${jes.help}/JESCopyright.txt" />
<property name="jes.launcher.sh" location="jes.sh" />
<property name="jes.launcher.bat" location="jes.bat" />
<property name="jes.launcher.bat.embedded-jre" value="dependencies/jre-win32" />
<!-- Detecting our OS -->
<condition property="windows">
<os family="windows" />
</condition>
<property name="jes.launcher.current" value="${jes.launcher.bat}"
if:set="windows" />
<property name="jes.launcher.current" value="${jes.launcher.sh}"
unless:set="windows" />
<target name="go">
<exec dir="${basedir}" executable="${basedir}/dpior.bat" osfamily="windows" />
</target>
<!-- JES classpath -->
<fileset id="jes.deps.jars" dir="${jes.deps.jardir}">
<include name="*.jar" />
</fileset>
<path id="jes.classpath">
<pathelement path="${jes.java.jar}" />
<pathelement path="${jes.instruments.jar}" />
<fileset refid="jes.deps.jars" />
</path>
<!-- Building the instruments -->
<path id="jes.instruments.classpath">
<pathelement path="${jes.deps.jmusic.jar}" />
</path>
<target name="instruments"
description="Assemble the JAR of jMusic instruments.">
<mkdir dir="${jes.instruments.class}" />
<javac srcdir="${jes.instruments.src}" destdir="${jes.instruments.class}"
source="${jes.target-java}" target="${jes.target-java}"
debug="on"
includeantruntime="false">
<classpath refid="jes.instruments.classpath" />
</javac>
<jar destfile="${jes.instruments.jar}" basedir="${jes.instruments.class}" />
</target>
<!-- Building JES -->
<target name="build" depends="compile, javadoc"
description="Build everything that needs to be built." />
<target name="version" depends="scminfo">
<copy file="${jes.java.src}/JESVersion.java.in"
tofile="${jes.java.src}/JESVersion.java"
filtering="on" overwrite="true" />
</target>
<target name="scminfo">
<exec executable="git"
outputproperty="jes.scminfo"
failifexecutionfails="false"
logError="true">
<arg value="log" />
<arg value="-n1" />
<arg value="--format=Git commit %h (%cD)" />
</exec>
<property name="jes.scminfo" value="Unknown" unless:set="jes.scminfo" />
<filter token="scminfo" value="${jes.scminfo}" />
</target>
<!-- The Java code -->
<target name="compile" depends="version, instruments"
description="Build the Java class files and JAR.">
<mkdir dir="${jes.java.class}" />
<javac srcdir="${jes.java.src}" destdir="${jes.java.class}"
source="${jes.target-java}" target="${jes.target-java}"
debug="on" encoding="${jes.encoding}"
includeantruntime="false">
<classpath refid="jes.classpath" />
</javac>
<jar destfile="${jes.java.jar}" basedir="${jes.java.class}" />
</target>
<!-- The Javadocs -->
<uptodate property="jes.javadoc.uptodate" targetfile="${jes.javadoc}/index-all.html">
<srcfiles dir="${jes.java.src}" includes="**/*.java" />
</uptodate>
<target name="javadoc" unless="jes.javadoc.uptodate"
description="Build the Javadocs for the Java classes.">
<javadoc destdir="${jes.javadoc}">
<!-- We have to use a fileset because JES doesn't use packages. -->
<fileset dir="${jes.java.src}">
<include name="**/*.java" />
</fileset>
<classpath refid="jes.classpath" />
<arg value="-quiet" />
</javadoc>
</target>
<!-- Testing JES -->
<target name="test" depends="compile"
description="Run the JES regression test suite.">
<exec executable="${jes.launcher.current}">
<arg value="--jython" />
<arg file="${jes.tests.script}" />
</exec>
</target>
<!-- Cleaning up after JES -->
<target name="clean" depends="clean-java, clean-python, clean-test, clean-release-stage"
description="CLEAN ALL THE THINGS! (Except release packages.)" />
<target name="clean-java" depends="clean-java-classes, clean-instruments, clean-javadoc"
description="Remove the built classes and Javadoc." />
<target name="clean-java-classes"
description="Remove the compiled Java classes.">
<delete file="${jes.java.jar}" />
<delete includeemptydirs="true">
<fileset dir="${jes.java.class}" includes="**/*" />
</delete>
</target>
<target name="clean-instruments"
description="Remove the compiled instrument classes.">
<delete file="${jes.instruments.jar}" />
<delete includeemptydirs="true">
<fileset dir="${jes.instruments.class}" includes="**/*" />
</delete>
</target>
<target name="clean-javadoc"
description="Remove the built Javadocs.">
<delete includeemptydirs="true">
<fileset dir="${jes.javadoc}" includes="**/*" />
</delete>
</target>
<target name="clean-python"
description="Remove the cached Python bytecode.">
<delete>
<fileset dir="${jes.python.src}" includes="**/*$py.class" />
<fileset dir="${jes.deps.python}" includes="**/*$py.class" />
</delete>
</target>
<target name="clean-test"
description="Remove files generated by the test suite.">
<delete>
<fileset dir="${jes.tests.output}" includes="**/*" excludes="README" />
</delete>
</target>
&releases;
<!-- Debugging the build file -->
<target name="antprops" depends="scminfo"
description="Print Ant properties (for working on the build script).">
<echoproperties />
</target>
</project>