<html>
-<title>Build and Test AspectJ</title>
+<head>
+<title>Build and Test AspectJ</title>
+</head>
<body>
<h1>Build and Test AspectJ</h1>
<ol>
<li>Quick start</li>
<li>Requirements</li>
- <li>Standard builds</li>
+ <li>Standard builds
<ol>
<li>Building using Ant</li>
<li>Building with Eclipse</li>
<li>Running the Ant build scripts from Eclipse</li>
<li>Using Eclipse to compile but Ant to assemble</li>
</ol>
+ </li>
<li>Running build products
<ol>
<li>Running the compiler, browser, or harness from the command-line</li>
<h3>Quick start</h3>
This is a minimal introduction to building and testing AspectJ.
-<p>Command-line users use CVS to check out something like this:
+<p/>Command-line users use CVS to check out something like this:
<pre>
export CVS_ROOT=":pserver:anonymous@dev.eclipse.org:/home/technology"
cvs co org.aspectj/modules</pre>
modules. Do not skip <code>testing-utils</code>,
which is used by other modules.
-<p>Build an AspectJ distribution:
+<p/>Build an AspectJ distribution:
<pre>
cd org.aspectj/modules/build
../lib/ant/bin/ant -f build.xml</pre>
Eclipse users should check out subdirectories of
<code>org.aspectj/modules</code> as a Java project.
-<p>Not all modules are required.
+<p/>Not all modules are required.
The <code>aspectj-attic</code> module only has old code,
and the <code>tests</code> and <code>testing-*</code> modules
-are only needed to run tests.
+are only needed to run tests. Also modules with Java 5 source
+in <code>{module}/java5-src</code> require Java 5 to build
+for the release; the Java 5 source files are ignored when building
+under 1.4 or earlier VM's.
<h3>Standard builds</h3>
<h4>Building using Ant</h4>
see the <a href="build.xml">build.xml</a> for other targets.
Consider defining the following flag properties:
-<p>
+<p/>
<table cellpadding="1" border="1">
<tr><th>Property</th><th>Meaning</th>
</tr>
</td></tr>
</table>
-<p>
+<p/>
For example, to build everything into a release bundle,
with verbose logging
<pre>
as well as in <a href="../lib/junit">../lib/junit</a>.
(Do not add <code>../lib/build/build.jar</code>, which is
added via a taskdef declaration.)
-<p>
+<p/>
If you find on rebuilding that the build products are not
being regenerated, you may need to manually delete them
or restart eclipse (the files are not being closed); see
some of which have manifests specifying the main class, so they
can be run using <code>java -jar {file} {arguments}</code>.
-<p>To run the compiler from the command-line, use the <code>ajbrowser</code> jar file:
+<p/>To run the compiler from the command-line, use the <code>ajbrowser</code> jar file:
<pre>
java -jar aj-build/jars/ajbrowser-all.jar {compile arguments}
</pre>
<h4>Running the compiler, browser, or harness from Eclipse</h4>
To run things within Eclipse, create a run configuration from the
defining module using the main class:
-<p>
+<p/>
<table border="1" cellpadding="1">
<tr><th>Program</th><th>Module</th><th>Main</th></tr>
for the module as a whole
(<code>{module}/testsrc/{module}ModuleTests.java</code>).
-<p>The AspectJ project also has <i>additional</i> custom tests in the
+<p/>The AspectJ project also has <i>additional</i> custom tests in the
<a href="../tests">tests module</a>,
mainly the compiler tests run by the harness in
<a href="../tests/ajcTests.xml">ajcTests.xml</a>. <u>It is important
to run these additional compiler tests (not covered by the JUnit
suite) before and after any change to the compiler.</u>
-</p>
+
<h4>Running JUnit tests in Eclipse</h4>
JUnit tests may be run under eclipse by selecting any JUnit source file
and creating a run configuration for it.
For more information, see
<a href="../tests/readme-tests-module.html">
../tests/readme-tests-module.html</a>.
-<p>
-<hr>
+<p/>
+<hr/>
<h3><a name="releases"></a>Releases</h3>
<h4>Release builds</h4>
Committers do official release builds to create the distribution
for more details on how the version is updated.
<h4>Release preconditions and testing</h4>
-<p>
+<p/>
Normally, we do releases only after fixing all high-priority
(P1 and P2) bugs in the bug database
- (<a href="http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&priority=P1&priority=P2">
+ (<a href="http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&priority=P1&priority=P2">
All open AspectJ bugs with P1 and P2</a>).
For bug fixes, associated tests in
<code>tests/ajcTestsFailing.xml</code> are fixed and moved to
<code>tests/ajcTests.xml</code>.
-<p>Before a release, run the release tests as described in
+<p/>Before a release, run the release tests as described in
<a href="../tests/readme-release-tests.html">
../tests/readme-release-tests.html</a>
(deprecated? using:
cd org.aspectj/
cvs tag -R -c v1_1_0
</pre>
-<p>
+<p/>
Pushing the release out to the web involves manually updating
<code>aspectj-home/</code> with the release files
(and documentation, if it is not a preview release),
about deferred bugs or tests in
<code>org.aspectj/releases/aspectj-{version}/</code>.
-<p>
-<hr>
+<p/>
+<hr/>
<h3>Build problems</h3>
Some build problems and fixes encountered in the past:
<ul>
from the project or Eclipse complains about duplicate jar files
in the path.
</li>
-<ul>
+</ul>
</body>
</html>
These have an <code>install</code> directory for installer resources
and a <code>dist</code> directory containing all files belonging in
the distribution, including 0-length placeholders for the module build
-results. These placeholder file names are mapped to the originating
-module by <code>Builder.moduleAliasFor(String)</code> (yes, an awful hack).
-
+results (e.g., <a href="products/tools/dist/lib">products/tools/dist/lib</a>).
+These placeholder file names are mapped to the originating
+module by <code>Builder.moduleAliasFor(String)</code>
+using values in
+ <a href="src/org/aspectj/internal/tools/build/Builder.properties">
+ Builder.properties</a>.
+(The "-all" suffix in the source jars means that the module and all required
+modules are included.)
<p/>
<a name="version"></a>
<h4>Version synchronization</h4>
<p/>The build version is set in
<a href="build-properties.xml">build-properties.xml</a> and propogated
using Ant copy filters out to
-the <a href="../runtime/runtime.mf.txt">aspectjrt.jar manifest</a>,
+the <a href="../aspectj5rt/aspectj5rt.mf.txt">aspectjrt.jar manifest</a>,
the <a href="../ajbrowser/ajbrowser.mf.txt">aspectjtools.jar manifest</a>
-
and to
<a href="../bridge/src/org/aspectj/bridge/Version.java">
../bridge/src/org/aspectj/bridge/Version.java</a>
follow a similar convention; those prefixed "aj-" may be deleted at will, while
"aspectj-" names are source directories which should never be deleted.
+<h4>Building Java 5 sources</h4>
+<p/>
+Java 5 source is supported in <code>{module}/java5-src</code> directories.
+Under Ant, when building in a pre-Java-5 VM, this source will be ignored
+(hence, it must not be required to compile). Under Eclipse, developers
+not using Java 5 should close the corresponding modules.
+
<h3>Debugging build problems</h3>
<h4>Running under Eclipse</h4>
When running Ant from eclipse,
messager.error("no such library jar " + libJar + " from " + entry);
}
} else if ("var".equals(kind)) {
- if (!"JRE_LIB".equals(path) && !"ASPECTJRT_LIB".equals(path)) {
- messager.log("cannot handle var yet: " + entry);
- }
+ warnVariable(path, entry);
classpathVariables.add(path);
} else if ("con".equals(kind)) {
if (-1 == path.indexOf("JRE")) { // warn non-JRE containers
}
return false;
}
+ private void warnVariable(String path, XMLEntry entry) {
+ String[] known = {"JRE_LIB", "ASPECTJRT_LIB", "JRE15_LIB"};
+ for (int i = 0; i < known.length; i++) {
+ if (known[i].equals(path)) {
+ return;
+ }
+ }
+ messager.log("Module cannot handle var yet: " + entry);
+ }
/** @return true if any properties were read correctly */
private boolean initProperties() {
* @return true if initialization post-processing worked
*/
protected boolean reviewInit() {
- if (!trimTesting) {
- return true;
- }
try {
for (ListIterator iter = srcDirs.listIterator(); iter.hasNext();) {
File srcDir = (File) iter.next();
- String name = srcDir.getName();
- if ("testsrc".equals(name.toLowerCase())) { // XXXFileLiteral
- iter.remove(); // XXX if verbose log
- }
+ String lcname = srcDir.getName().toLowerCase();
+ if (trimTesting
+ && Util.Constants.TESTSRC.equals(lcname)) {
+ iter.remove();
+ } else if (!Util.JAVA5_VM
+ && Util.Constants.JAVA5_SRC.equals(lcname)) {
+ // assume optional for pre-1.5 builds
+ iter.remove();
+ }
+ }
+ if (!trimTesting) {
+ return true;
}
if (!name.startsWith("testing")) {
for (ListIterator iter = libJars.listIterator(); iter.hasNext();) {