forked from WeTheInternet/collide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.ant.xml
310 lines (288 loc) · 13.5 KB
/
macros.ant.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
<project name="macros">
<!-- Ensure dirs.root has been set by the actual build.xml file -->
<fail message="project build.xml must set property dirs.root!"
unless="dirs.root"/>
<!-- Ensure Vert.x-compatible java version -->
<condition property="java.version.ok">
<or>
<matches string="${java.version}" pattern="^1\.[789]"/>
<matches string="${java.version}" pattern="^1\.[0-9][0-9]"/>
<matches string="${java.version}" pattern="^[2-9]\."/>
</or>
</condition>
<fail message="vert.x requires Java 1.7, you have ${java.version}"
unless="java.version.ok"/>
<!-- Load properties, first from local overrides and then from normal/default
values. First set wins. -->
<property file="${dirs.root}/local.properties"/>
<property file="${dirs.root}/build.properties"/>
<!-- load ant-contrib from the ant install dir, for <outofdate> -->
<taskdef classpath="${dirs.lib}/ant-contrib-${libs.antcontrib}/ant-contrib-${libs.antcontrib}.jar"
resource="net/sf/antcontrib/antlib.xml"
onerror="fail"/>
<!-- Classpaths for various contexts -->
<path id="paths.shared">
<pathelement location="${dirs.demo}/collide"/>
<pathelement location="${dirs.lib}/xapi-${libs.xapi}/xapi-gwt-${libs.xapi}.jar"/>
<pathelement location="${dirs.lib}/guava-${libs.guava}/guava-gwt-${libs.guava}.jar"/>
<pathelement location="${dirs.lib}/guava-${libs.guava}/guava-gwt-${libs.guava}.jar"/>
<pathelement location="${dirs.lib}/gson-${libs.gson}/gson-${libs.gson}.jar"/>
<pathelement location="${dirs.lib}/guava-${libs.guava}/guava-${libs.guava}.jar"/>
<pathelement location="${dirs.lib}/jsr-305/jsr305.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/waveinabox-import-0.3.jar"/>
<pathelement location="${dirs.lib}/xapi-${libs.xapi}/xapi-dev-${libs.xapi}.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-user.jar"/>
<pathelement location="${dirs.lib}/elemental/elemental.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-dev.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/validation-api-1.0.0.GA-sources.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/validation-api-1.0.0.GA.jar"/>
</path>
<!-- Classpaths for plugins -->
<path id="plugins.shared">
<pathelement location="${dirs.root}/plugin"/>
<pathelement location="${dirs.root}/demo/src/main/java"/>
</path>
<!-- Classpaths for clientlibs -->
<path id="paths.clientlibs">
<path refid="paths.shared"/>
<pathelement location="${dirs.root}/java/${dirs.toppkg}/clientlibs/**/*.java"/>
<pathelement location="${dirs.root}/javatest/${dirs.toppkg}/clientlibs/**/*.java"/>
<pathelement location="${dirs.root}/java/${dirs.toppkg}/client/util/**/*.java"/>
<pathelement location="${dirs.root}/javatest/${dirs.toppkg}/client/util/**/*.java"/>
</path>
<path id="plugins.server">
<pathelement location="${dirs.lib}/guava-${libs.guava}/guava-${libs.guava}.jar"/>
<pathelement location="${dirs.lib}/xapi-${libs.xapi}/xapi-dev-${libs.xapi}.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-codeserver.jar"/>
<pathelement location="${dirs.lib}/jgit-${libs.jgit}/org.eclipse.jgit-${libs.jgit}.jar"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-dev.jar"/>
<pathelement location="${dirs.lib}/elemental/elemental.jar"/>
</path>
<path id="paths.client.build">
<path refid="paths.shared"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-user.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/client-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/client-common-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/client-scheduler-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/common-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/concurrencycontrol-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/model-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/media-src.jar"/>
<pathelement location="${dirs.lib}/wave-${libs.wave}/util-src.jar"/>
</path>
<path id="paths.client.runtime">
<path refid="paths.client.build"/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-dev.jar"/>
</path>
<path id="paths.server.build">
<path refid="paths.shared"/>
<path refid="plugins.server"/>
<pathelement location="${dirs.vertx}/lib/vertx-core-${libs.vertx}.jar"/>
<pathelement location="${dirs.vertx}/lib/vertx-platform-${libs.vertx}.jar"/>
<pathelement location="${dirs.vertx}/lib/vertx-lang-java-${libs.vertx}.jar"/>
<pathelement location="${dirs.vertx}/lib/netty-${libs.netty}.jar"/>
</path>
<path id="paths.server.runtime">
<path refid="paths.shared"/>
<path refid="plugins.server"/>
<path refid="paths.client.build"/>
</path>
<path id="paths.test">
<path refid="paths.shared"/>
<pathelement location="${dirs.bin}"/>
<pathelement
location="${dirs.lib}/junit-${libs.junit}/junit-${libs.junit}.jar"/>
<pathelement
location="${dirs.lib}/easymock-${libs.easymock}/easymock-${libs.easymock}.jar"/>
</path>
<!-- Macros for common operations -->
<macrodef name="do.javac" description="Run javac task with common options">
<attribute name="srcdir" default="${dirs.src}" description="Source root"/>
<attribute name="plugindir" default="@{srcdir}" description="Plugin root"/>
<attribute name="destdir" default="${dirs.bin}" description="Output root"/>
<attribute name="verbose" default="false" description="Javac verbosity"/>
<element name="nested" implicit="true"/>
<sequential>
<mkdir dir="@{destdir}"/>
<javac srcdir="@{srcdir}; @{plugindir}" destdir="@{destdir}"
compiler="${javac.compiler}" debug="${javac.debug}"
deprecation="${javac.deprecation}" verbose="${verbose}"
includeAntRuntime="false" fork="yes">
<nested/>
</javac>
</sequential>
</macrodef>
<macrodef name="do.junit" description="Run junit task with common options">
<attribute name="reportdir" description="subdirectory for reports"/>
<attribute name="debugport" default="${junit.debugport}"/>
<attribute name="debugwait" default="${junit.debugwait}"/>
<attribute name="extracp" default="${dirs.toppkg}/client/**"/>
<element name="testpackages"/>
<element name="libraries"/>
<element name="jvmargs" optional="true"/>
<sequential>
<mkdir dir="${dirs.testrpt}/@{reportdir}"/>
<!-- <echo value="@{extracp}"/> -->
<junit printsummary="${junit.summaries}" forkmode="${junit.forkmode}"
fork="yes" haltonerror="false" errorproperty="junit.test.error"
haltonfailure="false" failureproperty="junit.test.failed"
timeout="${junit.timeout}" logfailedtests="true">
<!-- is there a way to make this on only if we need it? Else we get too much
"Listening for transport dt_socket at address: ..." spam.
<jvmarg line="-agentlib:jdwp=transport=dt_socket,server=y,address=@{debugport},suspend=@{debugwait}"/>
-->
<jvmarg line="-Dgwt.args='-war ${dirs.gwtwork}/junit-war'"/>
<jvmargs/>
<classpath>
<pathelement path="${dirs.bin}"/>
<pathelement path="${dirs.testbin}"/>
<libraries/>
<path refid="paths.test"/>
<pathelement path="${dirs.src}"/>
<pathelement path="${dirs.test}"/>
<pathelement path="@{extracp}"/>
</classpath>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest todir="${dirs.testrpt}/@{reportdir}">
<testpackages/>
</batchtest>
</junit>
<!-- We use false for halton{error,failure} above so all tests will run,
and use these "fail" tasks to stop and error out after the test
batch is done overall. -->
<fail status="2" if="junit.test.failed"
message="At least one test failed"/>
<fail status="3" if="junit.test.error"
message="At least one test had errors"/>
</sequential>
</macrodef>
<macrodef name="gwt.compile" description="run GWT compiler">
<attribute name="outdir" description="GWT output directory"/>
<attribute name="extradir" default="@{outdir}/../extras"
description="GWT extras output directory"/>
<attribute name="style" default="OBFUSCATED"
description="GWT compilation mode"/>
<attribute name="workers" default="1"
description="Permutation compiler threads"/>
<attribute name="loglevel" default="INFO"
description="The gwt compile log level."/>
<attribute name="maxmem" default="512M" description="Max JVM memory size"/>
<attribute name="maxstack" default="512K"
description="Max JVM thread stack size"/>
<attribute name="module"
description="GWT module to compile, as full-qualified class name"/>
<attribute name="renamed" default="@{module}"
description="output name of GWT module, if rename-to is used"/>
<attribute name="gwtflags" default=""/>
<attribute name="debugport" default="${gwtc.debugport}"/>
<attribute name="debugwait" default="${gwtc.debugwait}"/>
<element name="sources" optional="false"
description="source files for freshness checks"/>
<element name="srcroots" optional="false"
description="GWT source directories for classpath"/>
<element name="libs" optional="true"
description="library files for GWT compiler classpath"/>
<sequential>
<outofdate outputsources="@{renamed}.sources.path">
<sourcefiles>
<sources/>
</sourcefiles>
<targetfiles>
<fileset dir="@{outdir}/@{renamed}" erroronmissingdir="false">
<include name="*.nocache.js"/>
</fileset>
</targetfiles>
<sequential>
<echo message="Recompiling gwt because the following files have changed (or because @{renamed}/*.nocache.js do not exist): ${@{renamed}.sources.path}" level="info" />
<delete dir="@{outdir}/@{renamed}"/>
<mkdir dir="@{outdir}"/>
<condition property="gwtc.jvmdebug"
value=""
else="-agentlib:jdwp=transport=dt_socket,server=y,address=@{debugport},suspend=@{debugwait}">
<equals arg1="@{debugport}" arg2=""/>
</condition>
<java classname="com.google.gwt.dev.Compiler"
fork="true" failonerror="true">
<classpath>
<srcroots/>
<pathelement location="${dirs.bin}"/>
<path refid="paths.client.build"/>
<libs/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-dev.jar"/>
</classpath>
<sysproperty key="gwt.usearchives" value="false"/>
<jvmarg value="-Xmx@{maxmem}"/>
<jvmarg value="-Xss@{maxstack}"/>
<jvmarg line="${gwtc.jvmdebug}"/>
<arg value="-war"/>
<arg file="@{outdir}"/>
<arg value="-extra"/>
<arg file="@{extradir}"/>
<arg value="-style"/>
<arg value="@{style}"/>
<arg value="-logLevel"/>
<arg value="@{loglevel}"/>
<arg value="-localWorkers"/>
<arg value="@{workers}"/>
<arg line="@{gwtflags}"/>
<arg value="@{module}"/>
</java>
</sequential>
</outofdate>
</sequential>
</macrodef>
<macrodef name="gwt.devmode" description="run GWT dev mode">
<attribute name="outdir" description="GWT output directory"/>
<attribute name="extradir" default="@{outdir}/../extras"
description="GWT extras output directory"/>
<attribute name="maxmem" default="512M" description="Max JVM memory size"/>
<attribute name="maxstack" default="512K"
description="Max JVM thread stack size"/>
<attribute name="startupUrl"
description="The startup URL"/>
<attribute name="module"
description="GWT module to compile, as full-qualified class name"/>
<attribute name="gwtflags" default=""/>
<attribute name="debugport" default="${devmode.debugport}"/>
<attribute name="debugwait" default="${devmode.debugwait}"/>
<element name="sources" optional="false"
description="source files for freshness checks"/>
<element name="srcroots" optional="false"
description="GWT source directories for classpath"/>
<element name="libs" optional="true"
description="library files for GWT compiler classpath"/>
<sequential>
<condition property="devmode.jvmdebug"
value=""
else="-agentlib:jdwp=transport=dt_socket,server=y,address=@{debugport},suspend=@{debugwait}">
<equals arg1="@{debugport}" arg2=""/>
</condition>
<java classname="com.google.gwt.dev.DevMode"
fork="true" failonerror="true">
<classpath>
<srcroots/>
<pathelement location="${dirs.bin}"/>
<path refid="paths.client.build"/>
<libs/>
<pathelement location="${dirs.lib}/gwt-${libs.gwt}/gwt-dev.jar"/>
</classpath>
<jvmarg value="-Xmx@{maxmem}"/>
<jvmarg value="-Xss@{maxstack}"/>
<jvmarg line="${devmode.jvmdebug}"/>
<arg value="-war"/>
<arg file="@{outdir}"/>
<arg value="-extra"/>
<arg file="@{extradir}"/>
<arg value="-startupUrl"/>
<arg value="@{startupUrl}"/>
<arg line="@{gwtflags}"/>
<arg value="@{module}"/>
</java>
</sequential>
</macrodef>
<!-- Build targets that are totally the same for all sub-projects -->
<target name="clean" description="Erase all built artifacts">
<delete dir="${dirs.out}"/>
</target>
</project>