-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.xml
432 lines (401 loc) · 22.6 KB
/
common.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
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<project name="rti-common" default="-fail">
<target name="-fail">
<fail message="Do not call this build directly" />
</target>
<target name="bootstrap" description="build the rtibuild dependencies" unless="skip.bootstrap">
<ant inheritall="false" dir="${ant.file.rti-common}/.." antfile="conf/build.xml" target="jar">
<property name="skip.bootstrap" value="true"/>
</ant>
<property name="skip.bootstrap" value="true"/>
</target>
<property name="rti.build.home" location="${ant.file.rti-common}/../"/>
<path id="emma.libs">
<pathelement location="${rti.build.home}/lib/emma.jar" />
<pathelement location="${rti.build.home}/lib/emma_ant.jar" />
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.libs" />
<target name="-init" depends="-init-props,bootstrap,-init-plugins"/>
<!--Properties that common build uses
generate-with: grep -o '${[a-z.]*}' common-build.xml | tr -d '${}' | sort | uniq
-->
<target name="-init-props">
<!-- Product specific details should never go into the user properties,
it should only be used to specify jdk or other common tool/library
paths
-->
<property file="${user.home}/.rtibuild.properties"/>
<property file="conf/product-user.properties" />
<condition property="os.properties" value="unix.properties">
<os family="unix"/>
</condition>
<property file="${rti.build.home}/conf/${os.properties}"/>
<property file="conf/product.properties" />
<!-- hard coded defaults - if defined in the above files, they
will be overridden -->
<property name="product.disabled.jars" value="" description="A list of jars to exclude from an installer - matching is based upon the token appearing anywhere in the jar name"/>
<property name="fork.javac" value="true" description="Whether to fork javac or not (true or false)"/>
<property name="jdoc.includes" value="**/*.java" description="A list of files to include in javadoc"/>
<property name="jdoc.excludes" value="docs/javadoc" description="A list of files to exclude in javadoc"/>
<property name="java.src.version" value="1.4" description="The java source level to pass to the compiler"/>
<property name="java.target.version" value="1.4" description="The java byte code target level to pass to the compiler"/>
<property name="javac.includes" value="**/*.java" description="Files to include in compilation"/>
<property name="javac.excludes" value="" description="Files to exclude from compilation"/>
<property name="javac.encoding" value="ISO-8859-1" description="Charset to pass to javac"/>
<property name="ext.dir" value="externals" description="The directory for externals with contents defined by svn:externals"/>
<property name="src.dir" value="src" description="The directory for source code"/>
<property name="graphics.dir" value="graphics" description="The directory for graphics resources"/>
<property name="test.dir" value="test" description="The name of a test directory"/>
<property name="build.dir" value="bin" description="The name of a build directory"/>
<property name="test.build.dir" value="${test.dir}/bin" description="The name of a test build directory"/>
<property name="dist.dir" value="dist" description="The name of a distributable directory"/>
<property name="jdoc.dir" value="doc/javadoc" description="The name of a javadoc directory"/>
<property name="nsis.dir" value="installer" description="The name of the nsis installer directory"/>
<!-- <property name="nsis.exe" value="S:\DEVELOP\NSIS\makensis.exe" description="The full path to the NSIS exe"/> -->
<!-- <property name="nsis.exe" value="C:\DEVELOP\NSIS\makensis.exe" description="The full path to the NSIS exe"/> -->
<property name="nsis.exe" value="C:\Program Files (x86)\NSIS\makensis.exe" description="The full path to the NSIS exe"/>
<property name="logs.dir" value="test/logs" />
<property name="javac.debug" value="true" description="A flag to pass to javac for including debugging"/>
<property name="jar.extra.includes" value="" description="A list of includes to use for adding to jars"/>
<property name="jar.excludes" value="" description="A list of excludes for jar building"/>
<property name="java.main.vmargs" value="-Dfoo=bar" description="VM arguments, contains default bogus value to work around linux java/ant launcher bug"/>
<property name="default.jar.excludes" value="**/*.svn,${jar.excludes}" description="The default excludes - do not change this - instead change jar.excludes"/>
<property name="product.icon" value="${rti.build.home}/resources/graphics/Riverside.ico" description="The product icon used in installers, exe, etc."/>
<property name="coverage.dir" location="${test.dir}/coverage" description="emma coverage output directory"/>
<property name="emma.filter" value="rti.*, RTi.*" description="emma includes filter"/>
<!-- computed properties-->
<property name="jar.includes" value="**/*.png,**/*.gif,**/*.jpg,**/*.ico,**/*.class/,**/*.properties,META-INF/**/*,${jar.extra.includes}" />
<property name="jar.name" value="${product.name}_${product.version}.jar" />
<property name="jar.file" value="${dist.dir}/${jar.name}"/>
<property name="run.classpath" value="" description="The classpath to use during execution"/>
<property name="build.classpath" value="" description="The classpath to use during compilation"/>
<property name="test.classpath" value="" description="The classpath to use during test execution"/>
<!-- required from product -->
<required-property name="product.name" description="The name of the product"/>
<required-property name="product.version" description="The version of the product"/>
<!-- common jars -->
<property name="junit.jar" value="${rti.build.home}/lib/junit-3.8.1.jar"/>
</target>
<target name="-init-plugins">
<path id="rti.buildtools.path" path="${rti.build.home}/dist/rtibuild_1_0.jar"/>
<taskdef name="collectjars" classpathref="rti.buildtools.path" classname="rti.build.ant.CollectJarDependencies" onerror="ignore"/>
<taskdef name="collectproducts" classpathref="rti.buildtools.path" classname="rti.build.ant.CollectProductDependencies" onerror="ignore"/>
</target>
<target name="-init-deps" depends="-init">
<available property="rtibuild.present" file="${rti.build.home}/dist/rtibuild_1_0.jar"/>
<fail unless="rtibuild.present" message="Please run the bootstrap target to build rtibuild ant extensions"/>
<available property="rtibuild.present" file="${rti.build.home}/dist/rtibuild_1_0.jar"/>
<fail unless="rtibuild.present" message="Please run the bootstrap target to build rtibuild ant extensions"/>
<echo level="verbose">Disabled jars : ${product.disabled.jars}</echo>
<collectjars useBuildDirs="true" excludes="${product.disabled.jars}"/>
<property name="run.classpath.computed" value="${build.dir}:${build.classpath}:${collected.jar.deps}" description="The final computed classpath - do not change this"/>
<path id="collected.deps.path"/>
</target>
<target name="-init-jre" depends="-init-props">
<condition property="jre.base.dir" value="/opt">
<os family="unix"/>
</condition>
<condition property="jre.142.name" value="jre1.4.2">
<os family="unix"/>
</condition>
<condition property="jre.150.name" value="jre1.5.0">
<os family="unix"/>
</condition>
<condition property="rti.jre.version" value="142">
<equals arg1="${java.src.version}" arg2="1.4"/>
</condition>
<condition property="rti.jre.version" value="150">
<equals arg1="${java.src.version}" arg2="1.5"/>
</condition>
<condition property="rti.jre.version" value="16">
<equals arg1="${java.src.version}" arg2="1.6"/>
</condition>
<condition property="rti.jre.version" value="17">
<equals arg1="${java.src.version}" arg2="1.7"/>
</condition>
<condition property="rti.jre.version" value="18">
<equals arg1="${java.src.version}" arg2="1.8"/>
</condition>
<!-- defaults, if the above rules haven't set the jres, these will -->
<property name="jre.142.name" value="jre_142" />
<property name="jre.150.name" value="jre_150" />
<property name="jre.160.name" value="jre_16" />
<property name="jre.170.name" value="jre_17" />
<property name="jre.180.name" value="jre_18" />
<!-- <property name="jre.base.dir" value="s:/DEVELOP/" description="The location to search for jres"/> -->
<!-- The following worked on Windows 10 machine but why was it using a 32-bit compiler? -->
<!-- Switch to 64-bit compiler for TSTool 14.4.0 -->
<!-- <property name="jre.base.dir" value="C:/Program Files (x86)/Java/" description="The location to search for jres"/> -->
<property name="jre.base.dir" value="C:/Program Files/Java/" description="The location to search for jres"/>
<condition property="jre.src.dir" value="${jre.base.dir}/${jre.142.name}">
<equals arg1="${java.src.version}" arg2="1.4"/>
</condition>
<condition property="jre.src.dir" value="${jre.base.dir}/${jre.150.name}">
<equals arg1="${java.src.version}" arg2="1.5"/>
</condition>
<condition property="jre.src.dir" value="${jre.base.dir}/${jre.160.name}">
<equals arg1="${java.src.version}" arg2="1.6"/>
</condition>
<condition property="jre.src.dir" value="${jre.base.dir}/${jre.170.name}">
<equals arg1="${java.src.version}" arg2="1.7"/>
</condition>
<condition property="jre.src.dir" value="${jre.base.dir}/${jre.180.name}">
<equals arg1="${java.src.version}" arg2="1.8"/>
</condition>
</target>
<target name="-init-jdk" depends="-init-props">
<condition property="jdk.base.dir" value="/opt">
<os family="unix"/>
</condition>
<condition property="java.142.name" value="jdk1.4.2">
<os family="unix"/>
</condition>
<condition property="java.150.name" value="jdk1.5.0">
<os family="unix"/>
</condition>
<condition property="java.160.name" value="jdk1.6">
<os family="unix"/>
</condition>
<condition property="java.170.name" value="jdk1.7">
<os family="unix"/>
</condition>
<condition property="java.180.name" value="jdk1.8">
<os family="unix"/>
</condition>
<!-- defaults - if the above don't apply, these will -->
<!-- Old default: <property name="jdk.base.dir" value="C:/DEVELOP/" description="The location to search for jdks"/> -->
<!-- Use a default that matches standard Oracle isntall default -->
<!-- The following worked on Windows 10 machine but why was it using a 32-bit compiler? -->
<!-- Switch to 64-bit compiler for TSTool 14.4.0 -->
<!-- <property name="jdk.base.dir" value="C:/Program Files (x86)/Java" description="The location to search for jdks"/> -->
<property name="jdk.base.dir" value="C:/Program Files/Java" description="The location to search for jdks"/>
<property name="java.142.name" value="jdk_142" />
<property name="java.150.name" value="jdk_150" />
<!-- Old default: <property name="java.160.name" value="jdk_16" /> -->
<!-- New default matches standard Oracle JDK install -->
<property name="java.160.name" value="jdk6" />
<property name="java.170.name" value="jdk7" />
<property name="java.180.name" value="jdk8" />
</target>
<target name="-init-javac" depends="-init-jdk">
<condition property="jdk.build.home" value="${jdk.base.dir}/${java.142.name}">
<equals arg1="${java.src.version}" arg2="1.4" />
</condition>
<condition property="jdk.build.home" value="${jdk.base.dir}/${java.150.name}">
<equals arg1="${java.src.version}" arg2="1.5" />
</condition>
<condition property="jdk.build.home" value="${jdk.base.dir}/${java.160.name}">
<equals arg1="${java.src.version}" arg2="1.6" />
</condition>
<condition property="jdk.build.home" value="${jdk.base.dir}/${java.170.name}">
<equals arg1="${java.src.version}" arg2="1.7" />
</condition>
<condition property="jdk.build.home" value="${jdk.base.dir}/${java.180.name}">
<equals arg1="${java.src.version}" arg2="1.8" />
</condition>
<property name="javac.exe" value="${jdk.build.home}/bin/javac" description="The javac executable to use when forking"/>
</target>
<target name="-init-java" depends="-init-jdk">
<property name="java.run.version" value="${java.src.version}"/>
<condition property="jdk.run.home" value="${jdk.base.dir}/${java.142.name}">
<equals arg1="${java.run.version}" arg2="1.4" />
</condition>
<condition property="jdk.run.home" value="${jdk.base.dir}/${java.150.name}">
<equals arg1="${java.run.version}" arg2="1.5" />
</condition>
<condition property="jdk.run.home" value="${jdk.base.dir}/${java.160.name}">
<equals arg1="${java.run.version}" arg2="1.6" />
</condition>
<condition property="jdk.run.home" value="${jdk.base.dir}/${java.170.name}">
<equals arg1="${java.run.version}" arg2="1.7" />
</condition>
<condition property="jdk.run.home" value="${jdk.base.dir}/${java.180.name}">
<equals arg1="${java.run.version}" arg2="1.8" />
</condition>
<property name="java.exe" value="${jdk.run.home}/bin/java" description="The java executable to use when executing"/>
</target>
<target name="-enable-emma" depends="-init-build">
<property name="emma.enabled" value="true" />
<mkdir dir="${coverage.dir}"/>
</target>
<target name="-emma" depends="-init-build" unless="emma.disabled">
<emma enabled="${emma.enabled}" >
<instr instrpath="${build.dir}"
destdir="${coverage.dir}/instr"
metadatafile="${coverage.dir}/metadata.emma"
merge="true">
<filter includes="${emma.filter}"/>
</instr>
</emma>
</target>
<target name="-init-build" depends="-init">
<property name="java.main.vmargs" value="" description="VM arguments to pass to java during development execution"/>
<property name="java.main.cwd" value="${basedir}" description="The current working directory to run with"/>
<property name="java.main.class" value="undefined" description="The main class to run with"/>
<property name="coverage.dir" location="${test.dir}/coverage" description="emma coverage output directory"/>
<property name="emma.filter" value="rti.*, RTi.*" description="emma includes filter"/>
</target>
<target name="ant-doc" description="Generate ant documentation" depends="-init">
<taskdef name="antdoc" classpathref="rti.buildtools.path" classname="rti.build.ant.GenerateBuildDoc" onerror="ignore"/>
<antdoc/>
</target>
<macrodef name="requireprop">
<attribute name="name"/>
<attribute name="message" default="The property @{name} must be defined."/>
<sequential>
<condition property="@{name}.undefined">
<equals arg1="${@{name}}" arg2="undefined"/>
</condition>
<fail if="@{name}.undefined" message="@{message}"/>
<fail unless="@{name}" message="@{message}"/>
</sequential>
</macrodef>
<macrodef name="required-property">
<attribute name="name"/>
<attribute name="description"/>
<sequential>
<condition property="@{name}.undefined">
<equals arg1="${@{name}}" arg2="undefined"/>
</condition>
<fail if="@{name}.undefined" message="@{name} must be defined"/>
<fail unless="@{name}" message="product must define property @{name}" />
<property name="@{name}" description="@{description}" value=""/>
</sequential>
</macrodef>
<macrodef name="isPropertySet">
<attribute name="name"/>
<attribute name="isset" default="@{name}.isset"/>
<sequential>
<condition property="@{isset}">
<and>
<isset property="@{name}"/>
<not>
<equals arg1="${@{name}}" arg2=""/>
</not>
</and>
</condition>
</sequential>
</macrodef>
<macrodef name="dojar">
<attribute name="jar"/>
<attribute name="dist.dir" default="${dist.dir}" />
<attribute name="dir" default="${build.dir}" />
<attribute name="includes" default="${jar.includes}" />
<attribute name="excludes" default="${default.jar.excludes}" />
<attribute name="compress" default="false" />
<attribute name="mainClass" default="${java.main.class}"/>
<element name="zipfiles" optional="true"/>
<element name="other" optional="true"/>
<element name="atts" optional="true"/>
<sequential>
<tstamp />
<mkdir dir="@{dist.dir}" />
<jar destfile="@{dist.dir}/@{jar}" excludes="@{excludes}" compress="@{compress}">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Specification-Title" value="${product.name}" />
<attribute name="Specification-Version" value="${product.version}" />
<attribute name="Specification-Vendor" value="Open Water Foundation" />
<attribute name="Implementation-Version" value="${DSTAMP}" />
<atts/>
</manifest>
<fileset dir="@{dir}" includes="@{includes}" excludes="@{excludes}"/>
<other/>
<zipfiles/>
</jar>
</sequential>
</macrodef>
<macrodef name="aptcompile">
<attribute name="includes" default="${javac.includes}" />
<attribute name="excludes" default="${javac.excludes}" />
<attribute name="src" />
<attribute name="source" default="${java.src.version}" />
<attribute name="target" default="${java.target.version}" />
<attribute name="dest" />
<attribute name="debug" default="true" />
<attribute name="deprecation" default="on" />
<attribute name="useant" default="no" />
<attribute name="cp" />
<attribute name="factory"/>
<attribute name="factorycp" default="rti.buildtools.path"/>
<sequential>
<mkdir dir="@{dest}" />
<apt srcdir="@{src}" source="@{source}" target="@{target}"
includes="@{includes}" excludes="@{excludes}"
destdir="@{dest}" debug="@{debug}" deprecation="@{deprecation}"
includeAntRuntime="@{useant}"
failonerror="true" factory="@{factory}" factorypathref="@{factorycp}">
<classpath>
<path path="@{cp}" />
</classpath>
</apt>
</sequential>
</macrodef>
<macrodef name="javacompile">
<attribute name="includes" default="${javac.includes}" />
<attribute name="excludes" default="${javac.excludes}" />
<attribute name="encoding" default="${javac.encoding}" />
<attribute name="src" />
<attribute name="source" default="${java.src.version}" />
<attribute name="target" default="${java.target.version}" />
<attribute name="dest" />
<attribute name="fork" default="${fork.javac}" />
<attribute name="debug" default="true" />
<attribute name="deprecation" default="on" />
<attribute name="executable" default="${javac.exe}" />
<attribute name="useant" default="no" />
<attribute name="failOnError" default="true"/>
<attribute name="cp" />
<sequential>
<mkdir dir="@{dest}" />
<javac srcdir="@{src}" source="@{source}" target="@{target}"
includes="@{includes}" excludes="@{excludes}"
destdir="@{dest}" debug="@{debug}" deprecation="@{deprecation}"
executable="@{executable}" includeAntRuntime="@{useant}"
fork="@{fork}" failonerror="@{failOnError}"
encoding="@{encoding}">
<classpath>
<path path="@{cp}" />
</classpath>
<compilerarg value="-XDignore.symbol.file"/>
</javac>
</sequential>
</macrodef>
<macrodef name="runjava">
<attribute name="main" />
<attribute name="cp" />
<attribute name="dir" default="${basedir}"/>
<element name="vmargs" optional="true"/>
<element name="args" optional="true"/>
<sequential>
<echo>@{cp} @{main}</echo>
<java classname="@{main}" fork="true" jvm="${java.exe}" dir="@{dir}">
<jvmarg line="-Xmx256m"/>
<jvmarg line="-ea"/>
<vmargs/>
<classpath>
<path path="@{cp}" />
</classpath>
<args/>
</java>
</sequential>
</macrodef>
<macrodef name="deps" description="build dependencies">
<attribute name="target" />
<attribute name="products"/>
<attribute name="inheritall" default="false"/>
<attribute name="inheritrefs" default="false"/>
<attribute name="deps" default="nodeps"/>
<element name="inherited" optional="true"/>
<sequential>
<echo>calling @{target} in deps @{products}</echo>
<subant target="@{target}" antfile="conf/build.xml" inheritall="@{inheritall}" inheritrefs="@{inheritrefs}">
<property name="@{deps}" value="@{deps}"/>
<!-- hack for netbeans projects -->
<property name="platform.home" value="${jdk.build.home}"/>
<property name="skip-bootstrap" value="${skip-bootstrap}"/>
<inherited/>
<filelist dir="." files="@{products}"/>
</subant>
</sequential>
</macrodef>
</project>