-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
executable file
·315 lines (281 loc) · 11.6 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
<?xml version="1.0"?>
<project name="C64" default="dist" basedir=".">
<description>
The build/run file for C64
</description>
<!-- set global properties for this build -->
<property name="source" location="source"/>
<property name="build" location="run"/>
<property name="dist" location="jar"/>
<property name="javadocs" location="javadocs"/>
<property name="version.props" location="${source}/version.props"/>
<!-- Load environment variables (for computer name) -->
<property environment="env"/>
<!-- Capture the computer name in a cross-platform manner -->
<property name="env.COMPUTERNAME" value="${env.HOSTNAME}" />
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
</target>
<!--description="Update version only on changes"-->
<target name="version"
depends="build.uptodate?"
unless="build.uptodate"
description="Maintain build-number and build-date properties.">
<propertyfile file="${version.props}"
comment="build number and date">
<entry key="build-number" type="int" operation="+" pattern="0000" default="0000"/>
<entry key="build-date" type="date" value="now" pattern="yyyyMMdd-HHmm" />
<entry key="build.user.name" value="${user.name}"/>
<!-- COMPUTERNAME on windows? -->
<entry key="build.computer" value="${env.COMPUTERNAME}"/>
</propertyfile>
<property file="${source}/version.props"/>
<replaceregexp file="${source}/version.java"
match="programVersion = (.*)"
replace="programVersion = "${major}.${minor}.${rev}_b${build-number}";"
byline="true" />
<echo message="Updated the build number"/>
</target>
<target name="compile" depends="init,version"
description="compile the source " >
<buildnumber file="${source}/build.num"/>
<!-- Compile the java code from ${source} into ${build} and line number debugging!
this wont work because it uses printf!
source="1.4"
target="1.4"
source="1.5" // source is 1.5 - but moving to 1.6 to reduce compiler warnings
target="1.5"
source="1.6"
target="1.6"
-->
<javac includeantruntime="false" srcdir="${source}" destdir="${build}"
debug="true" debuglevel="lines,vars,source"
source="1.6"
target="1.6"
/>
</target>
<!--- depends"compile,javadocs" -->
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<mkdir dir="${build}/images"/>
<copy todir="${build}/images">
<fileset dir="images">
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="**/*.png" />
<exclude name="**/old/" />
<exclude name="**/backgrounds/" />
<exclude name="**/refimages/" />
<exclude name="**/workinprogress/" />
</fileset>
</copy>
<mkdir dir="${build}/basic"/>
<copy todir="${build}/basic">
<fileset dir="basicjar">
<include name="**/*.basic" />
</fileset>
</copy>
<!--echo message="the dist thing is running"/-->
<!-- read in this file-->
<property file="${source}/version.props"/>
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file -->
<!--jar jarfile="${dist}/jar/C64-${DSTAMP}.jar" basedir="${build}" -->
<jar jarfile="${dist}/ijk64.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="C64"/>
<!-- This line puts your username into the manifest.
Maybe you don't want to do that. -->
<!--attribute name="Built-By" value="${build.user.name}"/-->
<attribute name="Built-On" value="${build-date} @${build.computer}"/>
<!-- This property was set by the svn-info task -->
<!--attribute name="Revision" value="${svnrevision}"/-->
<!-- This property comes from the build.properties file -->
<attribute name="Version" value="${major}.${minor}.${rev}_b${build-number}"/>
<attribute name="Implementation-Version" value="${major}.${minor}.${rev}_b${build-number}"/>
</manifest>
</jar>
</target>
<!-- autodoc is no longer used - better done by a conditional javadocs -->
<target name="autodoc" description="Generate javadoc documentation." depends="compile">
<mkdir dir="autodoc"/>
<javadoc destdir="autodoc" private="true" linksource="yes"> <!-- source="1.4"-->
<fileset dir="${source}" includes="*.java"/>
</javadoc>
</target>
<!-- spawn="yes" would be good - but we see no output!-->
<!-- normal "run" is transparent and no frames - this now requires command line options -->
<target name="run128" description="run the program" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" maxmemory="128m" dir="basic">
<arg value="-c"/>
<arg value="-2"/>
</java>
</target>
<target name="run" description="run the program" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" dir="basic">
<arg value="-c"/>
<arg value="-2"/>
</java>
</target>
<target name="runs" description="run the program in server mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" maxmemory="128m" dir="basic">
<jvmarg value="-server"/>
<arg value="-c"/>
<arg value="-2"/>
</java>
</target>
<target name="runz" description="run the program in server mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" maxmemory="128m" dir="basic">
<jvmarg value="-server"/>
<arg value="-c"/>
<arg value="-2"/>
<arg value="-z"/>
</java>
</target>
<target name="freerunz" description="run the program in server mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" dir="basic">
<jvmarg value="-server"/>
<arg value="-c"/>
<arg value="-2"/>
<arg value="-z"/>
</java>
</target>
<target name="frun" description="run the program in server mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" dir="basic">
<arg value="-c"/>
<arg value="-2"/>
<arg value="-z"/>
</java>
</target>
<!-- spawn="yes" would be good - but we see no output!-->
<!-- normal "run" is transparent and no frames - this now requires command line options -->
<target name="runclear" description="run the program" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" maxmemory="128m" dir="basic">
<arg value="-t"/>
<arg value="-n"/>
<arg value="-b"/>
<arg value="-c"/>
<arg value="-3"/>
</java>
</target>
<!-- spawn="yes" would be good - but we see no output!-->
<!-- normal "run" is transparent and no frames - this now requires command line options -->
<target name="runnormal" description="run the program in normal mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" maxmemory="128m" dir="basic">
</java>
</target>
<!-- spawn="yes" would be good - but we see no output!-->
<!-- normal "run" is transparent and no frames - this now requires command line options -->
<target name="runfree" description="run the program in normal mode" depends="dist">
<java jar="${dist}/ijk64.jar" fork="true" dir="basic">
</java>
</target>
<target name="timingjar" description="timing test the program using the jar (no profiling)" depends="dist">
<java jar="${dist}/ijk64.jar" dir="basic" fork="true"
maxmemory="128m"
>
<arg value="../basic/tests/mp2.basic"/>
<arg value="-r"/>
<arg value="-x"/>
</java>
</target>
<target name="timingjar_profile" description="timing test the program using the jar with profiling" depends="dist">
<java jar="${dist}/ijk64.jar" dir="basic" fork="true"
maxmemory="128m"
>
<jvmarg value="-Xrunhprof:cpu=samples,interval=1,depth=10,thread=y" />
<arg value="../basic/tests/mp2.basic"/>
<arg value="-r"/>
<arg value="-x"/>
</java>
</target>
<target name="timingjar_profile_2" description="timing test the program using the jar with profiling" depends="dist">
<java jar="${dist}/ijk64.jar" dir="basic" fork="true"
maxmemory="128m"
>
<jvmarg value="-Xrunhprof:cpu=samples,interval=1,depth=10,thread=n" />
<arg value="../basic/tests/mp2.basic"/>
<arg value="-r"/>
<arg value="-x"/>
</java>
</target>
<target name="timing" description="timing test the program (no profiling)" depends="dist">
<java dir="${build}" fork="true" classname="C64"
maxmemory="128m"
>
<arg value="../basic/tests/mp2.basic"/>
<arg value="-r"/>
<arg value="-x"/>
<!-- (cd ../run && java -Xmx128m -Xrunhprof:cpu=samples,interval=1,depth=10 C64 /media/disk/JEBI/basic/tests/mp2.basic -r -x ) -->
</java>
</target>
<target name="timing_profile" description="timing test the program with profiling" depends="dist">
<java dir="${build}" fork="true" classname="C64"
maxmemory="128m"
>
<jvmarg value="-Xrunhprof:cpu=samples,interval=1,depth=10,thread=y" />
<arg value="../basic/tests/mp2.basic"/>
<arg value="-r"/>
<arg value="-x"/>
<!-- (cd ../run && java -Xmx128m -Xrunhprof:cpu=samples,interval=1,depth=10 C64 /media/disk/JEBI/basic/tests/mp2.basic -r -x ) -->
</java>
</target>
<target name="test" description="test the program" depends="dist">
<java dir="${build}" fork="true" classname="ev" />
</target>
<target name="clean"
description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="autodoc"/>
<delete dir="${javadocs}"/>
</target>
<!-- This is a dodgy way to update the build version only on
sourcecode change -->
<target name="build.uptodate?">
<uptodate property="build.uptodate"
targetfile="${javadocs}/index.html">
<srcfiles dir="${source}" includes="**/*.java,
**/version.props,
**/package.html,
**/doc-files/**" />
</uptodate>
<!-- All this to print "true" or "false" for the property value -->
<condition property="build-uptodate-value" value="false">
<equals arg1="${build.uptodate}" arg2="$${build.uptodate}" />
</condition>
<property name="build-uptodate-value" value="true" />
<echo message="build-uptodate = ${build-uptodate-value}" />
</target>
<!-- .................................................. -->
<target name="javadocs"
description="Generate javadoc documentation."
depends="javadocs.uptodate?,compile"
unless="javadocs.uptodate">
<javadoc destdir="${javadocs}"
private="true" linksource="yes"> <!-- source="1.4"-->
<fileset dir="${source}" includes="*.java"/>
</javadoc>
</target>
<target name="javadocs.uptodate?">
<mkdir dir="${javadocs}" />
<uptodate property="javadocs.uptodate"
targetfile="${javadocs}/index.html">
<srcfiles dir="${source}" includes="**/*.java,
**/package.html,
**/doc-files/**" />
</uptodate>
<!-- All this to print "true" or "false" for the property value -->
<condition property="javadocs-uptodate-value" value="false">
<equals arg1="${javadocs.uptodate}" arg2="$${javadocs.uptodate}" />
</condition>
<property name="javadocs-uptodate-value" value="true" />
<echo message="javadocs-uptodate = ${javadocs-uptodate-value}" />
</target>
</project>