-
Notifications
You must be signed in to change notification settings - Fork 2
/
build-defs.xml
executable file
·286 lines (242 loc) · 10.3 KB
/
build-defs.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
<?xml version="1.0" encoding="UTF-8"?>
<project name="build-defs" basedir=".">
<!--
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
-->
<description>
Defines common properties and macros for Visage project.
Sub-repositories should import this file into their build.xml file.
This file will import all other necessary top repository build-*.xml files.
</description>
<!-- This file determines root of the source tree for project -->
<dirname property="visage.root.dir" file="${ant.file.build-defs}"/>
<property name="visage.root.build.src.dir" location="${visage.root.dir}/build-src"/>
<!-- Include any hg properties in case this is a source bundle build. -->
<property file="${visage.root.dir}/hg.properties"/>
<!-- Get platform, or, and arch properties and targets -->
<import file="${visage.root.build.src.dir}/build-os-arch.xml"/>
<!-- Default property values for build defs -->
<property file="${visage.root.dir}/build.properties"/>
<!-- Local overrides for build defs -->
<property file="${visage.root.dir}/build.local.properties"/>
<!-- Get properties defined from the environment -->
<import file="${visage.root.build.src.dir}/build-environment.xml"/>
<!-- Get importer properties and targets -->
<import file="${visage.root.build.src.dir}/build-importer.xml"/>
<!-- Get jars -->
<import file="${visage.root.build.src.dir}/build-jar-importer.xml"/>
<!-- Get platform properties and targets -->
<import file="${visage.root.build.src.dir}/build-${os_name}-defs.xml"/>
<!-- Macrodefs for generic things to be shared by everyone -->
<!-- JAVAC -->
<macrodef name="do-javac">
<attribute name="srcdir"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.src.classpath}"/>
<attribute name="includes" default=""/>
<attribute name="excludes" default=""/>
<sequential>
<mkdir dir="@{destdir}"/>
<echo level="debug">DO_JAVAC</echo>
<echo level="debug"> srcdir="@{srcdir}"</echo>
<echo level="debug"> destdir="@{destdir}"</echo>
<echo level="debug"> debug="${javac.debug}"</echo>
<echo level="debug"> deprecation="${javac.deprecation}"</echo>
<echo level="debug"> source="${javac.source}"</echo>
<echo level="debug"> target="${javac.target}"</echo>
<echo level="debug"> includes="@{includes}"</echo>
<echo level="debug"> excludes="@{excludes}"</echo>
<echo level="debug"> classpath="@{classpath}"</echo>
<javac srcdir="@{srcdir}" destdir="@{destdir}"
debug="${javac.debug}" deprecation="${javac.deprecation}"
source="${javac.source}" target="${javac.target}"
includeantruntime="false" includes="@{includes}"
excludes="@{excludes}">
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs}"/>
</javac>
</sequential>
</macrodef>
<!-- JAVA -->
<presetdef name="do-java.preset">
<java fork="true" dir="${run.dir}">
<jvmarg value="-showversion"/>
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
</java>
</presetdef>
<macrodef name="do-java">
<attribute name="classname" default="${run.main.class}"/>
<sequential>
<echo>jvmarg line="${run.jvmargs}"</echo>
<echo level="debug">DO_JAVA</echo>
<echo level="debug"> classname="@{classname}"</echo>
<do-java.preset classname="@{classname}"/>
</sequential>
</macrodef>
<macrodef name="do-java-debug">
<attribute name="classname" default="${run.main.class}"/>
<sequential>
<echo>jvmarg line="${run.jvmargs}"</echo>
<echo level="debug">DO_JAVA-DEBUG</echo>
<echo level="debug"> classname="@{classname}"</echo>
<nbjpdastart addressproperty="jpda.address" name="JMC" transport="dt_socket">
<classpath path="${run.classpath}"/>
</nbjpdastart>
<do-java.preset classname="@{classname}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
</do-java.preset>
</sequential>
</macrodef>
<macrodef name="do-java-test">
<attribute name="classname"/>
<sequential>
<echo level="debug">DO_JAVA_TEST</echo>
<echo level="debug"> classname="@{classname}"</echo>
<do-java.preset classname="@{classname}" classpath="${test.run.classpath}" dir="${test.run.dir}"/>
</sequential>
</macrodef>
<macrodef name="print-property">
<attribute name="property"/>
<sequential>
<condition property="@{property}.value"
value="${@{property}}" else="">
<isset property="@{property}"/>
</condition>
<echo>@{property} = ${@{property}.value}</echo>
</sequential>
</macrodef>
<macrodef name="do-file-check">
<attribute name="file"/>
<sequential>
<fail message="ERROR: File check failed, missing: @{file}">
<condition>
<not>
<available file="@{file}"/>
</not>
</condition>
</fail>
</sequential>
</macrodef>
<macrodef name="do-class-check">
<attribute name="classname"/>
<attribute name="classpath"/>
<sequential>
<fail message="ERROR: Class check failed, missing: @{classname} in @{classpath}">
<condition>
<not>
<available classname="@{classname}" classpath="@{classpath}"/>
</not>
</condition>
</fail>
</sequential>
</macrodef>
<!-- Untar macrodef (for tar.gz files) -->
<macrodef name="do-untar-bundle">
<attribute name="tar"/>
<attribute name="dir"/>
<attribute name="includes" default="**"/>
<sequential>
<delete dir="@{dir}.untar"/>
<mkdir dir="@{dir}.untar"/>
<untar src="@{tar}"
dest="@{dir}.untar"
compression="gzip">
<patternset includes="@{includes}"/>
</untar>
<mkdir dir="@{dir}"/>
<delete dir="@{dir}"/>
<move file="@{dir}.untar" tofile="@{dir}" verbose="true"/>
<delete dir="@{dir}.untar"/>
</sequential>
</macrodef>
<macrodef name="do-untar-bzip2-bundle">
<attribute name="tar"/>
<attribute name="dir"/>
<attribute name="includes" default="**"/>
<sequential>
<delete dir="@{dir}.untar"/>
<mkdir dir="@{dir}.untar"/>
<untar src="@{tar}"
dest="@{dir}.untar"
compression="bzip2">
<patternset includes="@{includes}"/>
</untar>
<mkdir dir="@{dir}"/>
<delete dir="@{dir}"/>
<move file="@{dir}.untar" tofile="@{dir}" verbose="true"/>
<delete dir="@{dir}.untar"/>
</sequential>
</macrodef>
<!-- Unzip macrodef -->
<macrodef name="do-unzip-bundle">
<attribute name="zip"/>
<attribute name="dir"/>
<attribute name="includes" default="**"/>
<sequential>
<delete dir="@{dir}.unzip"/>
<mkdir dir="@{dir}.unzip"/>
<unzip src="@{zip}" dest="@{dir}.unzip">
<patternset includes="@{includes}"/>
</unzip>
<mkdir dir="@{dir}"/>
<delete dir="@{dir}"/>
<move file="@{dir}.unzip" tofile="@{dir}" verbose="true"/>
<delete dir="@{dir}.unzip"/>
</sequential>
</macrodef>
<!-- Get a zip from a url and unzip it. -->
<macrodef name="do-get-previous-bundle">
<attribute name="name"/>
<attribute name="url"/>
<attribute name="dir"/>
<sequential>
<delete file="previous_@{name}.zip"/>
<get src="@{url}" dest="previous_@{name}.zip"/>
<do-unzip-bundle zip="previous_@{name}.zip" dir="@{dir}"/>
<delete file="previous_@{name}.zip"/>
</sequential>
</macrodef>
<!-- Target to be used by including file. -->
<target name="-init-defs"
depends="-init-platform">
<echo>Property=Value</echo>
<echo>--------------</echo>
<property name="isAny" value="true"/>
<print-property property="visage.root.dir" />
<print-property property="visage.sdk.dir" />
<print-property property="visage.deployed.dir" />
<print-property property="platform.home" />
<print-property property="platform6u10.home" />
<print-property property="dxsdk.path" />
<print-property property="wmsdk.path" />
</target>
</project>