From: wisberg Date: Fri, 11 Feb 2005 05:04:07 +0000 (+0000) Subject: support for building Java 5 sources X-Git-Tag: V1_5_0M2~173 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c92e64aa1f9d9dafb3de78f974ceaa46c81a9730;p=aspectj.git support for building Java 5 sources --- diff --git a/build/readme-build-and-test-aspectj.html b/build/readme-build-and-test-aspectj.html index 6a9880bd7..8707eba60 100644 --- a/build/readme-build-and-test-aspectj.html +++ b/build/readme-build-and-test-aspectj.html @@ -1,5 +1,7 @@ -Build and Test AspectJ + +Build and Test AspectJ +

Build and Test AspectJ

@@ -16,13 +18,14 @@ debug failed builds, see
  1. Quick start
  2. Requirements
  3. -
  4. Standard builds
  5. +
  6. Standard builds
    1. Building using Ant
    2. Building with Eclipse
    3. Running the Ant build scripts from Eclipse
    4. Using Eclipse to compile but Ant to assemble
    +
  7. Running build products
    1. Running the compiler, browser, or harness from the command-line
    2. @@ -51,7 +54,7 @@ debug failed builds, see

      Quick start

      This is a minimal introduction to building and testing AspectJ. -

      Command-line users use CVS to check out something like this: +

      Command-line users use CVS to check out something like this:

         export CVS_ROOT=":pserver:anonymous@dev.eclipse.org:/home/technology"
         cvs co org.aspectj/modules
      @@ -62,7 +65,7 @@ compiler tests) tests and most testing* modules. Do not skip testing-utils, which is used by other modules. -

      Build an AspectJ distribution: +

      Build an AspectJ distribution:

         cd org.aspectj/modules/build
         ../lib/ant/bin/ant -f build.xml
      @@ -98,10 +101,13 @@ that usually means checking out the modules directory: Eclipse users should check out subdirectories of org.aspectj/modules as a Java project. -

      Not all modules are required. +

      Not all modules are required. The aspectj-attic module only has old code, and the tests and testing-* modules -are only needed to run tests. +are only needed to run tests. Also modules with Java 5 source +in {module}/java5-src require Java 5 to build +for the release; the Java 5 source files are ignored when building +under 1.4 or earlier VM's.

      Standard builds

      Building using Ant

      @@ -113,7 +119,7 @@ The default target builds the AspectJ distribution; see the build.xml for other targets. Consider defining the following flag properties: -

      +

      @@ -136,7 +142,7 @@ Consider defining the following flag properties:
      PropertyMeaning
      -

      +

      For example, to build everything into a release bundle, with verbose logging

      @@ -171,7 +177,7 @@ specified by Eclipse and add all the libraries in
       as well as in ../lib/junit.
       (Do not add ../lib/build/build.jar, which is
       added via a taskdef declaration.)
      -

      +

      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 @@ -193,7 +199,7 @@ The build produces jar files in some of which have manifests specifying the main class, so they can be run using java -jar {file} {arguments}. -

      To run the compiler from the command-line, use the ajbrowser jar file: +

      To run the compiler from the command-line, use the ajbrowser jar file:

          java -jar aj-build/jars/ajbrowser-all.jar {compile arguments}
       
      @@ -207,7 +213,7 @@ This will run ajbrowser if you provide no arguments or

      Running the compiler, browser, or harness from Eclipse

      To run things within Eclipse, create a run configuration from the defining module using the main class: -

      +

      @@ -241,13 +247,13 @@ for each package for the module as a whole ({module}/testsrc/{module}ModuleTests.java). -

      The AspectJ project also has additional custom tests in the +

      The AspectJ project also has additional custom tests in the tests module, mainly the compiler tests run by the harness in ajcTests.xml. It is important to run these additional compiler tests (not covered by the JUnit suite) before and after any change to the compiler. -

      +

      Running JUnit tests in Eclipse

      JUnit tests may be run under eclipse by selecting any JUnit source file and creating a run configuration for it. @@ -277,8 +283,8 @@ use the -help flag to see available options. For more information, see ../tests/readme-tests-module.html. -

      -


      +

      +


      Releases

      Release builds

      Committers do official release builds to create the distribution @@ -295,17 +301,17 @@ See Version synchronization below for more details on how the version is updated.

      Release preconditions and testing

      -

      +

      Normally, we do releases only after fixing all high-priority (P1 and P2) bugs in the bug database - ( + ( All open AspectJ bugs with P1 and P2). For bug fixes, associated tests in tests/ajcTestsFailing.xml are fixed and moved to tests/ajcTests.xml. -

      Before a release, run the release tests as described in +

      Before a release, run the release tests as described in ../tests/readme-release-tests.html (deprecated? using: @@ -322,7 +328,7 @@ based on the release code. E.g., from the command line: cd org.aspectj/ cvs tag -R -c v1_1_0 -

      +

      Pushing the release out to the web involves manually updating aspectj-home/ with the release files (and documentation, if it is not a preview release), @@ -332,8 +338,8 @@ Pushing the release out to the web involves manually updating about deferred bugs or tests in org.aspectj/releases/aspectj-{version}/. -

      -


      +

      +


      Build problems

      Some build problems and fixes encountered in the past:
        @@ -362,7 +368,7 @@ Some build problems and fixes encountered in the past: from the project or Eclipse complains about duplicate jar files in the path. -
          +
        diff --git a/build/readme-build-module.html b/build/readme-build-module.html index 7309557ef..60c5dcb49 100644 --- a/build/readme-build-module.html +++ b/build/readme-build-module.html @@ -86,9 +86,14 @@ module jar file. These have an install directory for installer resources and a dist 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 Builder.moduleAliasFor(String) (yes, an awful hack). - +results (e.g., products/tools/dist/lib). +These placeholder file names are mapped to the originating +module by Builder.moduleAliasFor(String) +using values in + + Builder.properties. +(The "-all" suffix in the source jars means that the module and all required +modules are included.)

        Version synchronization

        @@ -101,9 +106,8 @@ developers use the default "DEVELOPMENT" version.

        The build version is set in build-properties.xml and propogated using Ant copy filters out to -the aspectjrt.jar manifest, +the aspectjrt.jar manifest, the aspectjtools.jar manifest - and to ../bridge/src/org/aspectj/bridge/Version.java @@ -127,6 +131,13 @@ puts them at the same level as other modules. In build scripts, property names follow a similar convention; those prefixed "aj-" may be deleted at will, while "aspectj-" names are source directories which should never be deleted. +

        Building Java 5 sources

        +

        +Java 5 source is supported in {module}/java5-src 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. +

        Debugging build problems

        Running under Eclipse

        When running Ant from eclipse, diff --git a/build/src/org/aspectj/internal/tools/build/Module.java b/build/src/org/aspectj/internal/tools/build/Module.java index 81907928c..cb9e2b644 100644 --- a/build/src/org/aspectj/internal/tools/build/Module.java +++ b/build/src/org/aspectj/internal/tools/build/Module.java @@ -433,9 +433,7 @@ public class Module { 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 @@ -448,6 +446,15 @@ public class Module { } 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() { @@ -483,16 +490,21 @@ public class Module { * @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();) { diff --git a/lib/build/build.jar b/lib/build/build.jar index b491e4099..c872a04ba 100644 Binary files a/lib/build/build.jar and b/lib/build/build.jar differ
      ProgramModuleMain