-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
373 lines (337 loc) · 16.9 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
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
<project name="Ceylon module-resolver module" default="publish" basedir=".">
<property file="../ceylon-common/user-build.properties"/>
<property file="../ceylon-common/common-build.properties"/>
<property file="build.properties"/>
<!-- Set build directories for all formats. -->
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes" location="${build.dir}/classes"/>
<property name="build.dist" location="${build.dir}/dist"/>
<property name="build.dist.repo" location="${build.dist}/repo"/>
<property name="build.lib" location="${build.dir}/lib"/>
<property name="build.test" location="${build.dir}/test"/>
<property name="test.reports" location="${build.dir}/test-reports"/>
<!-- The Java source files for the module-resolver -->
<property name="cmr-api.src" location="${basedir}/api/src/main/java"/>
<property name="cmr-api.resources" location="${basedir}/api/src/main/resources"/>
<property name="cmr-impl.src" location="${basedir}/impl/src/main/java"/>
<property name="cmr-spi.src" location="${basedir}/spi/src/main/java"/>
<property name="cmr-webdav.src" location="${basedir}/webdav/src/main/java"/>
<property name="cmr-ceylon.src" location="${basedir}/ceylon/src/main/java"/>
<property name="cmr-maven.src" location="${basedir}/maven/src/main/java"/>
<property name="cmr-maven.resources" location="${basedir}/maven/src/main/resources"/>
<!-- jar generated -->
<property name="module-resolver.jar" location="${build.lib}/module-resolver.jar"/>
<property name="module-resolver-api.jar" location="${build.lib}/module-resolver-api.jar"/>
<property name="cmr-testsuite-test.src" location="${basedir}/testsuite/src/test/java"/>
<property name="cmr-testsuite-test.resources" location="${basedir}/testsuite/src/test/resources"/>
<property name="maven-test.src" location="${basedir}/maven/src/test/java"/>
<property name="maven-test.resources" location="${basedir}/maven/src/test/resources"/>
<tstamp/>
<!-- Local repositoryManager -->
<property name="ceylon.repo.dir" location="${user.home}/.ceylon/repo"/>
<!-- ceylon.module-resolver -->
<property name="module.module-resolver.dir" value="com/redhat/ceylon/module-resolver"/>
<property name="module.module-resolver.name" value="com.redhat.ceylon.module-resolver"/>
<!-- ceylon.common -->
<property name="module.common.dir" value="com/redhat/ceylon/common"/>
<property name="module.common.name" value="com.redhat.ceylon.common"/>
<!-- ceylon.model -->
<property name="module.model.dir" value="com/redhat/ceylon/model"/>
<property name="module.model.name" value="com.redhat.ceylon.model"/>
<!-- module archives -->
<property name="ceylon.module-resolver.dir"
value="${module.module-resolver.dir}/${module.com.redhat.ceylon.module-resolver.version}"/>
<property name="ceylon.module-resolver.src"
value="${ceylon.module-resolver.dir}/${module.module-resolver.name}-${module.com.redhat.ceylon.module-resolver.version}.src"/>
<property name="ceylon.module-resolver.jar"
value="${ceylon.module-resolver.dir}/${module.module-resolver.name}-${module.com.redhat.ceylon.module-resolver.version}.jar"/>
<property name="ceylon.module-resolver.repo" value="${ceylon.repo.dir}/${ceylon.module-resolver.dir}"/>
<property name="ceylon.module-resolver.dist" value="${build.dist.repo}/${ceylon.module-resolver.dir}"/>
<property name="ceylon.maven-support.jar" value="${ceylon.maven-support.repo}"/>
<property name="ceylon.maven-support.repo" value="${ceylon.repo.dir}/${ceylon.maven-support.dir}"/>
<property name="ceylon.maven-support.dist" value="${build.dist.repo}/${ceylon.maven-support.dir}"/>
<property name="ceylon.common.dir"
value="${module.common.dir}/${module.com.redhat.ceylon.common.version}"/>
<property name="ceylon.common.jar"
value="${ceylon.common.dir}/${module.common.name}-${module.com.redhat.ceylon.common.version}.jar"/>
<property name="ceylon.common.lib" value="${ceylon.repo.dir}/${ceylon.common.jar}"/>
<property name="ceylon.model.dir"
value="${module.model.dir}/${module.com.redhat.ceylon.model.version}"/>
<property name="ceylon.model.jar"
value="${ceylon.model.dir}/${module.model.name}-${module.com.redhat.ceylon.model.version}.jar"/>
<property name="ceylon.model.lib" value="${ceylon.repo.dir}/${ceylon.model.jar}"/>
<path id="compiler.classpath">
<pathelement path="${ceylon.common.lib}"/>
<pathelement path="${ceylon.model.lib}"/>
<pathelement path="${jandex.lib}"/>
<pathelement path="${modules.lib}"/>
<pathelement path="${sardine.lib}"/>
<pathelement path="${httpclient.lib}"/>
<pathelement path="${httpcore.lib}"/>
<pathelement path="${shrinkwrap-maven-uberjar.lib}"/>
<pathelement path="${json.lib}" />
</path>
<path id="test.build.classpath">
<path refid="compiler.classpath"/>
<pathelement path="${build.classes}"/>
<pathelement path="${junit.lib}"/>
</path>
<path id="test.run.classpath">
<path refid="test.build.classpath"/>
<pathelement path="${cmr-testsuite-test.resources}"/>
<pathelement path="${build.test}"/>
<pathelement path="${httpclient.lib}"/>
<pathelement path="${httpcore.lib}"/>
<pathelement path="${commons-logging.lib}"/>
<pathelement path="${slf4j-api.lib}"/>
<pathelement path="${slf4j-simple.lib}"/>
</path>
<!-- ################################################################## -->
<!-- constant to declare a file binary for checksumsum -->
<property name="checksum.binary-prefix" value=" *"/>
<!-- Helper target, used to create a sha1 checksum file -->
<!-- Requires 'file' as a parameter. -->
<target name="sha1sum">
<fail unless="file"/>
<fail if="filename"/>
<fail if="value"/>
<basename file="${file}" property="filename"/>
<checksum file="${file}" property="value" algorithm="sha1"/>
<echo file="${file}.sha1" message="${value}"/>
</target>
<!-- Rule to clean everything up -->
<target name="clean" description="Clean up everything">
<delete dir="${build.dir}"/>
<delete dir="${cmr-testsuite-test.src}/repo/com"/>
</target>
<target name="ide-quick-internal">
<property name="archivePath" value="${ceylon.repo.dir}/${ceylon.module-resolver.jar}"/>
<basename file="${archivePath}" property="archiveFileName"/>
<property name="proxy-project" value="../ceylon-ide-eclipse/required-bundle-proxies/${archiveFileName}"/>
<mkdir dir="${proxy-project}"/>
<delete failonerror="false" dir="${proxy-project}/META-INF"/>
<copy toDir="${proxy-project}" overwrite="true">
<zipfileset src="${archivePath}" includes="META-INF/**"/>
<fileset file="${archivePath}"/>
</copy>
<manifest file="${proxy-project}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Bundle-Classpath" value="${archiveFileName}"/>
</manifest>
<property name="archivePath2" value="${ceylon.repo.dir}/${ceylon.maven-support.jar}"/>
<basename file="${archivePath2}" property="archiveFileName2"/>
<property name="proxy-project2" value="../ceylon-ide-eclipse/required-bundle-proxies/${archiveFileName2}"/>
<mkdir dir="${proxy-project2}"/>
<delete failonerror="false" dir="${proxy-project2}/META-INF"/>
<copy toDir="${proxy-project2}" overwrite="true">
<zipfileset src="${archivePath2}" includes="META-INF/**"/>
<fileset file="${archivePath2}"/>
</copy>
<manifest file="${proxy-project2}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Bundle-Classpath" value="${archiveFileName2}"/>
</manifest>
</target>
<target name="dist"
depends="build"
description="Create Ceylon module-resolver distribution">
<mkdir dir="${ceylon.module-resolver.dist}"/>
<zip destfile="${build.dist.repo}/${ceylon.module-resolver.src}">
<fileset dir="${cmr-api.src}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${cmr-impl.src}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${cmr-spi.src}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${cmr-webdav.src}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${cmr-ceylon.src}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${cmr-maven.src}">
<include name="**/*.java"/>
</fileset>
</zip>
<antcall target="sha1sum">
<param name="file" value="${build.dist.repo}/${ceylon.module-resolver.src}"/>
</antcall>
<copy file="${module-resolver.jar}" tofile="${build.dist.repo}/${ceylon.module-resolver.jar}"/>
<antcall target="sha1sum">
<param name="file" value="${build.dist.repo}/${ceylon.module-resolver.jar}"/>
</antcall>
<copy file="${shrinkwrap-maven-uberjar.lib}" tofile="${build.dist.repo}/${ceylon.maven-support.jar}"/>
<antcall target="sha1sum">
<param name="file" value="${build.dist.repo}/${ceylon.maven-support.jar}"/>
</antcall>
<copy file="${sardine.lib}" tofile="${build.dist.repo}/${sardine.repo}"/>
<copy file="${httpclient.lib}" tofile="${build.dist.repo}/${httpclient.repo}"/>
<copy file="${httpcore.lib}" tofile="${build.dist.repo}/${httpcore.repo}"/>
<copy file="${commons-logging.lib}" tofile="${build.dist.repo}/${commons-logging.repo}"/>
<copy file="${commons-codec.lib}" tofile="${build.dist.repo}/${commons-codec.repo}"/>
<copy file="${slf4j-api.lib}" tofile="${build.dist.repo}/${slf4j-api.repo}"/>
<copy file="${slf4j-simple.lib}" tofile="${build.dist.repo}/${slf4j-simple.repo}"/>
<copy file="${json.lib}" tofile="${build.dist.repo}/${json.repo}"/>
</target>
<!-- Repository targets -->
<target name="publish"
depends="dist,clean.repo,init.repo,publish-internal"
description="Publish Ceylon module-resolver module to default repo">
</target>
<target name="publish-internal" depends="init.repo">
<copy todir="${ceylon.repo.dir}" overwrite="true">
<fileset dir="${build.dist.repo}"/>
</copy>
</target>
<target name="init.repo"
description="Create default local Ceylon module repositoryManager">
<mkdir dir="${ceylon.module-resolver.repo}"/>
</target>
<target name="clean.repo"
description="Clean default local Ceylon module repositoryManager">
<delete dir="${ceylon.module-resolver.repo}"/>
</target>
<!-- Tasks related to building the module-resolver -->
<!-- Rule to build module-resolver classes from their Java sources -->
<target name="module-resolver.classes.api">
<mkdir dir="${build.classes}"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-spi.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-api.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
</target>
<!-- Rule to build module-resolver classes from their Java sources -->
<target name="module-resolver.classes" depends="module-resolver.classes.api">
<mkdir dir="${build.classes}"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-impl.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-webdav.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-ceylon.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-maven.src}"
destdir="${build.classes}"
classpathref="compiler.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<copy todir="${build.classes}">
<fileset dir="${cmr-maven.resources}">
<include name="**"/>
</fileset>
</copy>
</target>
<!-- Rule to build module-resolver jar -->
<target name="module-resolver.jar" depends="module-resolver.classes">
<mkdir dir="${build.lib}"/>
<tstamp>
<format property="qualifier" timezone="GMT" pattern="'v'yyyyMMdd-HHmm"/>
</tstamp>
<jar destfile="${module-resolver.jar}">
<fileset dir="${build.classes}">
</fileset>
<manifest>
<attribute name="Bundle-SymbolicName" value="com.redhat.ceylon.module-resolver"/>
<attribute name="Bundle-Version" value="${module.com.redhat.ceylon.module-resolver.version}.${qualifier}"/>
</manifest>
</jar>
</target>
<!-- Rule to build module-resolver-api jar -->
<target name="module-resolver-api.jar" depends="module-resolver.classes.api">
<mkdir dir="${build.lib}"/>
<jar destfile="${module-resolver-api.jar}">
<fileset dir="${build.classes}">
<include name="**/spi/*"/>
<include name="**/api/*"/>
</fileset>
</jar>
</target>
<!-- Rule to compile and test -->
<target name="build" depends="module-resolver.jar"/>
<target name="compile.tests" depends="build">
<mkdir dir="${build.test}"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${cmr-testsuite-test.src}"
destdir="${build.test}"
classpathref="test.build.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<javac debug="true"
encoding="UTF-8"
srcdir="${maven-test.src}"
destdir="${build.test}"
classpathref="test.build.classpath"
target="${compile.java.target}"
source="${compile.java.source}"
bootclasspath="${compile.java.bootclasspath}"
includeantruntime="false"/>
<copy todir="${build.test}">
<fileset dir="${maven-test.resources}">
<include name="**"/>
</fileset>
</copy>
</target>
<target name="test" depends="compile.tests" description="Runs the JUnit tests">
<mkdir dir="${test.reports}"/>
<junit printsummary="yes" haltonfailure="no">
<classpath refid="test.run.classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.reports}">
<fileset dir="${cmr-testsuite-test.src}">
<include name="**/*TestCase.java"/>
</fileset>
<fileset dir="${maven-test.src}">
<include name="**/*TestCase.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.reports}">
<fileset dir="${test.reports}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports}"/>
</junitreport>
</target>
</project>