blob: ed7bbc4a7ea86564a0ceb9eb4774f2ad9b498916 (
plain)
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
|
<!-- ========================================================================= -->
<!-- Copyright (c) 2003 Contributors. -->
<!-- All rights reserved. -->
<!-- This program and the accompanying materials are made available -->
<!-- under the terms of the Common Public License v1.0 -->
<!-- which accompanies this distribution and is available at -->
<!-- http://www.eclipse.org/legal/cpl-v10.html -->
<!-- -->
<!-- Contributors: -->
<!-- Wes Isberg initial implementation -->
<!-- ========================================================================= -->
<project name="build" default="test" basedir=".">
<!-- ========================================================================= -->
<target name="info">
<echo>
This downloads and build the AspectJ source tree.
Targets of note:
install checkout, build, and install AspectJ
test (default) test AspectJ sources and installation
Properties of note:
skip.cvs no CVS checkout (done already)
skip.build no build (done already)
version set if not DEVELOPMENT
aspectj.modules.dir define this to reuse existing
</echo>
</target>
<target name="init-variables">
<property name="version" value="DEVELOPMENT"/>
<property name="ant.verbose" value=""/>
<property name="aspectj.workspace"
location="${basedir}/aspectj-workspace"/>
<property name="aspectj.modules.dir"
location="${aspectj.workspace}/org.aspectj/modules"/>
<property name="aspectj.build.dir"
location="${aspectj.modules.dir}/build"/>
<property name="aspectj.lib.dir"
location="${aspectj.modules.dir}/lib"/>
<property name="aspectj.ant.home"
location="${aspectj.lib.dir}/ant"/>
<property name="aspectj.ant.lib.dir"
location="${aspectj.ant.home}/lib"/>
<property name="aj.build.dir"
location="${aspectj.modules.dir}/aj-build"/>
<property name="aj.build.jar.dir"
location="${aj.build.dir}/jars"/>
<property name="aj.build.dist.dir"
location="${aj.build.dir}/dist"/>
<property name="aj.build.jar.dir"
location="${aj.build.dir}/jars"/>
<property name="aj.build.install.dir"
location="${aj.build.dir}/install"/>
<property name="aj.build.log.dir"
location="${aj.build.dir}/logs"/>
<property name="aspectj.jar"
location="${aj.build.dist.dir}/aspectj-${version}.jar"/>
<property name="java.command"
location="${java.home}/bin/java"/>
<mkdir dir="${aj.build.log.dir}"/>
</target>
<target name="sources-available" depends="init-variables"
unless="sources.available">
<available property="sources.available"
file="${aspectj.modules.dir}/build/build.xml"/>
<fail unless="sources.available" message="checkout first"/>
</target>
<target name="aspectj-available" depends="init-variables"
unless="aspectj.available">
<available property="aspectj.available"
file="${aj.build.install.dir}" type="dir"/>
<fail unless="aspectj.available" message="install first"/>
</target>
<!-- ========================================================================= -->
<target name="install" depends="build,init-variables"
description="create an AspectJ source tree">
<fail unless="aspectj.jar" message="define aspectj.jar"/>
<fail unless="aj.build.install.dir" message="define aj.build.install.dir"/>
<mkdir dir="${aj.build.install.dir}"/>
<delete dir="${aj.build.install.dir}"/>
<mkdir dir="${aj.build.install.dir}"/>
<java fork="true" jar="${aspectj.jar}" failonerror="true">
<arg line="-to ${aj.build.install.dir}"/>
</java>
</target>
<target name="build" depends="init-variables,create-tree"
description="build an AspectJ release"
unless="skip.build">
<antcall target="run-ant">
<param name="ant.dir" location="${aspectj.build.dir}"/>
<param name="run.ant.file" value="build.xml"/>
<param name="ant.target" value="clean"/>
<param name="ant.output"
location="${aj.build.log.dir}/build-clean.txt"/>
</antcall>
<antcall target="run-ant">
<param name="ant.dir" location="${aspectj.build.dir}"/>
<param name="run.ant.file" value="build.xml"/>
<param name="ant.target" value="aspectj"/>
<param name="ant.output"
location="${aj.build.log.dir}/build-aspectj.txt"/>
</antcall>
</target>
<target name="create-tree" depends="init-variables"
unless="skip.cvs"
description="create an AspectJ source tree">
<fail message="testing now - remove when validated"/>
<mkdir dir="${aspectj.workspace}"/>
<delete dir="${aspectj.workspace}"/>
<mkdir dir="${aspectj.workspace}"/>
<cvs cvsRoot=":pserver:anonymous@eclipse.org:/home/technology"
dest="${quicklook.tree.dir}"
package="org.aspectj/modules"
quiet="on"
failonerror="on"
command="checkout -P" />
</target>
<!-- ========================================================================= -->
<target name="test"
depends="init-variables,aspectj-available">
<!-- antcall target="build-examples"/ -->
<antcall target="junit-module-tests"/>
<antcall target="run-harness-tests"/>
</target>
<target name="junit-module-tests"
depends="init-variables,aspectj-available">
<echo message="need to build all with -Dtrim.testing.default=false"/>
<antcall target="run-ant">
<param name="run.ant.file" value="junitModules.xml"/>
<param name="ant.target" value=""/>
<param name="ant.dir"
location="${aspectj.modules.dir}/tests"/>
<param name="ant.output"
location="${aj.build.log.dir}/build-junitModules.txt"/>
</antcall>
</target>
<target name="build-examples"
depends="init-variables,aspectj-available">
<antcall target="build-one-example">
<param name="example.target" value="nonGui"/>
</antcall>
<antcall target="build-one-example">
<param name="example.target" value="tracing-bc"/>
</antcall>
<echo message="Also setup and run compiler adapater example"/>
</target>
<target name="build-one-example" depends="init-variables">
<ant dir="${aj.build.install.dir}/doc/examples"
inheritAll="false"
target="${example.target}"
output="${aj.build.log.dir}/example-${example.target}.txt"
/>
</target>
<target name="compile-aspectj-using-aspectj"
depends="init-variables,sources-available">
<antcall target="run-ant">
<param name="ant.dir"
location="${aspectj.modules.dir}/tests/product/build-aspectj"/>
<param name="run.ant.file" value="build.xml"/>
<param name="ant.target" value=""/>
<param name="ant.output"
location="${aj.build.log.dir}/build-aspectj-using-aspectj.txt"/>
</antcall>
</target>
<target name="run-harness-tests" depends="harness-available">
<antcall target="run-harness-once">
<param name="suite.filename" value="ajcTests.xml"/>
<param name="emacssym" value=""/>
</antcall>
<antcall target="run-harness-once">
<param name="suite.filename" value="ajcTests.xml"/>
<param name="emacssym" value="-emacssym"/>
</antcall>
</target>
<target name="run-harness-once"
depends="init-variables">
<fail unless="suite.filename"
message="define suite.filename"/>
<available property="harness.available"
file="${harness.jar}"/>
<fail unless="harness.available" message="build harness first"/>
<java
dir="${aspectj.modules.dir}/tests"
jar="${harness.jar}"
maxmemory="250m"
output="${aj.build.log.dir}/${suite.filename}${emacssym}.txt">
<arg value="${suite.filename}.xml"/>
<arg line="-killTemp -release -logFail ${emacssym}"/>
</java>
</target>
<target name="harness-available" depends="init-variables">
<antcall target="run-ant">
<param name="ant.dir" location="${aspectj.build.dir}"/>
<param name="run.ant.file" value="build.xml"/>
<param name="ant.target" value="build-testing-drivers"/>
<param name="ant.output"
location="${aj.build.log.dir}/build-testing-drivers.txt"/>
</antcall>
</target>
<target name="run-ant" depends="init-variables"
description="the ant we use to build">
<!-- we could use normal ant, but we enforce using ours
<ant dir="${aspectj.build.dir}"
target="clean"
inheritAll="false"/>
-->
<fail unless="ant.target" message="define ant.target"/>
<java
fork="true"
dir="${ant.dir}"
jvm="${java.command}"
classname="org.apache.tools.ant.Main"
maxmemory="350m"
failonerror="true"
newenvironment="true"
output="${ant.output}">
<classpath>
<fileset dir="${aspectj.ant.lib.dir}">
<include name="*.jar"/>
</fileset>
<pathelement path="${aspectj.lib.dir}/junit/junit.jar"/>
<pathelement path="${java.home}/lib/tools.jar"/>
<pathelement path="${java.home}/../lib/tools.jar"/>
</classpath>
<sysproperty key="JAVA_HOME" path="${java.home}"/>
<sysproperty key="ANT_HOME"
path="${aspectj.ant.home}"/>
<sysproperty key="aspectjrt.path"
file="${aj.build.install.dir}/lib/aspectjrt.jar"/>
<sysproperty key="test.classpath"
value="jar.classpath"/>
<arg line="-f ${run.ant.file} ${ant.target} ${ant.verbose}"/>
</java>
</target>
</project>
|