From ef8037126b0a8838c8914f63f8b5b3a09fcd3cea Mon Sep 17 00:00:00 2001 From: wisberg Date: Thu, 9 Jun 2005 00:05:40 +0000 Subject: revamped build scripts using Ant 1.6.3 features. Now using local.properties instead of command-line flags and sharing build-properties.xml. --- build/build-properties.xml | 206 ++++++-- build/build.xml | 482 +++++++----------- build/junit-patterns.properties | 18 + build/readme-build-and-test-aspectj.html | 205 ++++---- build/release/build.xml | 814 +++++-------------------------- build/release/readme.txt | 22 +- build/release/release-tests.xml | 273 +++++++++++ build/sample.local.properties | 10 + build/test-build-script.xml | 42 ++ 9 files changed, 936 insertions(+), 1136 deletions(-) create mode 100644 build/junit-patterns.properties create mode 100644 build/release/release-tests.xml create mode 100644 build/sample.local.properties create mode 100644 build/test-build-script.xml diff --git a/build/build-properties.xml b/build/build-properties.xml index 99fb509fe..81fa3f3cf 100644 --- a/build/build-properties.xml +++ b/build/build-properties.xml @@ -18,9 +18,13 @@ - - + + + + - + + + - @@ -52,17 +57,13 @@ - - - - + - + - - - - - + + + @@ -96,13 +93,39 @@ location="${aspectj.modules.build.dir}/products"/> + + + + + + + + + + + + + + + + + - - - + + + + - - @@ -144,20 +165,15 @@ - - - + depends="init-properties" + description="ensure dirs, possibly many times in a build"> - - - - - + + + - + + + - @@ -230,16 +246,116 @@ message="unable to find @{name}: ${@{name}}"/> - - + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + ${text} + + + + + + + + + +${failures} + + + + + + + + + + + + + + + + + + + + + + + + + +@{message} (property "@{property}" not at "@{path}") + + + + diff --git a/build/build.xml b/build/build.xml index cd385b273..351f8c950 100644 --- a/build/build.xml +++ b/build/build.xml @@ -16,36 +16,57 @@ - + + + - - - - - - + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + location="${aj.dist.dir}/aspectj-${build.version.long}.jar"/> - - - - - - - - - - - - - - + @@ -162,7 +170,7 @@ baseDir="${aspectj.modules.dir}" distDir="${aj.dist.dir}" productDir="${aspectj.modules.dir}/build/products/${product.name}" - trimTesting="${trim.testing.default}" + trimTesting="true" buildConfig="${build.config}" version="${build.version.long}" verbose="${build.verbose}" @@ -170,30 +178,50 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -221,186 +249,126 @@ - - - + + - - - - - + description="run unit tests via run-all-junit-tests module"> + + - - - - - - - - - - - - - - --> - + + - - - - - + description="run compiler tests via tests module"> + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - + + + - - - - + + + + + + + To use testing client jar in tests, mv ../aj-build/jars/testing-client-all.jar ../lib/tests/testing-client.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -427,10 +395,8 @@ To use testing client jar in tests, - - - - + @@ -440,17 +406,13 @@ To use testing client jar in tests, - - - - + + - - - - + + @@ -460,30 +422,16 @@ To use testing client jar in tests, - - - - - - - - - - - + - - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + diff --git a/build/junit-patterns.properties b/build/junit-patterns.properties new file mode 100644 index 000000000..fb980f3a6 --- /dev/null +++ b/build/junit-patterns.properties @@ -0,0 +1,18 @@ +# if true, then run JUnit tests via leaf tests +# else use junit.rootSuites +junit.leaves=false + +# define the root suite for for each module testsrc/ +junit.rootSuites=*ModuleTests.java + +# define leaf tests for each module testsrc/ +junit.includes=**/*Tests.java,**/*TestCase.java +junit.excludes=**/DocumentParserTest.java,\ +**/CommandTestCase.java,\ +**/VerifyWeaveTestCase.java,\ +**/KnownfailuresTests.java,\ +**/KnownLimitationsTests.java,\ +**/PureJavaTests.java,\ +**/AbstractWorldTestCase.java,\ +**/WeaveTestCase.java + diff --git a/build/readme-build-and-test-aspectj.html b/build/readme-build-and-test-aspectj.html index 048347c52..7292fc2ac 100644 --- a/build/readme-build-and-test-aspectj.html +++ b/build/readme-build-and-test-aspectj.html @@ -61,18 +61,12 @@ This is a minimal introduction to building and testing AspectJ. cvs co org.aspectj/modules If using Eclipse, check out the subdirectories of org.aspectj/modules as Eclipse projects. -Skip modules aspectj-attic and (unless running -JUnit or compiler tests) tests and most testing* -modules. Do not skip testing-utils, -which is used by other modules. +Skip the aspectj-attic module.

Build an AspectJ distribution:

   cd org.aspectj/modules/build
-  ../lib/ant/bin/ant -f build.xml
- -To speed the build, Eclipse users can adopt the Eclipse-produced .class files: -
  ../lib/ant/bin/ant -f build.xml -Dbuild.config=useEclipseCompiles
+ ../lib/ant/bin/ant Install the distribution (e.g., into build/../aspectj-install): @@ -86,81 +80,110 @@ target directory using -to {targDir}: Test it by running the build script in the examples directory:
  cd ../aspectj-install/doc/examples
-  ../../ant/bin/ant
+ ../../lib/ant/bin/ant This should build and run the spacewar example. -

Requirements

-To build requires only the AspectJ project modules. +

Required sources, libraries, and tools

+

+ +To build requires only the AspectJ project modules and Java VM's. All necessary libraries and tools are in the -lib directory. For command-line users, -that usually means checking out the modules directory: +lib directory, including Ant. +

+

To get the source, check out from CVS. E.g., from the command line, +

+
    export CVS_ROOT=":pserver:anonymous@dev.eclipse.org:/home/technology"
    cvs co org.aspectj/modules
 
-Eclipse users should check out subdirectories of - org.aspectj/modules as a Java project. - -

- + Eclipse users should check out each relevant subdirectory of + org.aspectj/modules as a project + (most have .project files). +

+

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. 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. +The aspectj-attic module only has old code.

Standard builds

+

Overview

+The build system is designed to work standalone and support +Eclipse and Ant. +Each module is an Eclipse project, and all required libraries +are in lib/. +All build dependencies are read from Eclipse .classpath files +and managed using an Ant builder task, +so no Ant build scripts need to change when dependencies change. +However, that means the modules (read: Eclipse projects) can only +do what the builder task understands. Currently it expects +release source files in src (or java5-src +for Java 5 code) and test source files in +testsrc (or java5-testsrc), +and can handle Java and AspectJ projects. +For more information on the build infrastructure and setup, see +readme-build-module.html +and below. +

Building using Ant

+

+You should use the Ant in ../lib/ant. Currently this is a vanilla +distribution of Ant 1.6.3, but that might change. +

+

This build directory has a master build.xml script, and the modules have satellite build.xml which support building only that module. -(To run Ant, use the project's ../lib/ant -scripts and libraries, not your own. Currently the build uses -a standard Ant release, but we might modify our version of the -Ant distribution.) -The default target for the master build.xml +The release directory has scripts for doing +release builds (in multiple VM's, with testing). These are run by +automated build and before any AspectJ distribution. +Custom build.xml files are in +The ../docs/build.xml, + org.aspectj.lib/build-aspectjlib.xml, +and ../eclipse.plugin/build.xml. +These are invoked by the master +build.xml as needed. +Other modules have generic build.xml's that just +use the master build file to run targets compile and +test for that module. +(If you do clean, all binaries for all +modules are cleaned.) +

+

+The master build.xml creates an AspectJ distribution in ../aj-build/dist/aspectj-DEVELOPMENT.jar ; -see the build.xml for other targets. -The build.xml's in the other modules support the -targets compile and test for just -that module; if you do clean, all binaries for all -modules are cleaned. - +You'll notice module jar results are put in + ../aj-build/jars, +including {module}.jar and {module}-test.jar +(for the release and test classes) and +{module}-all.jar, and +{module}-test-all.jar +(including all antecedant classes and libraries). +See build.xml for other targets. +

+

+For any build, you should create your own version of + local.properties, using + sample.local.properties +as a template. When using the master build.xml, -consider defining the following flag properties: +consider defining "build.config" to pass flags to the Ant +builder. E.g., to reuse Eclipse classes and log verbosely,

- - - - - - -
PropertyMeaning
module.name - To build any module (esp. those not directly supported - by a target), use the "any-module" target and define - the module name. -
check.build.jar - any value cause build to fail if - lib/build/build.jar is out of date. (This is a - built archive of the build module to avoid bootstrapping.) -
build.config - override default configuration in build.xml. - Significant values include "verbose" for more output - and "useEclipseCompiles" to assume that Eclipse has - compiled modules into their bin directories, and just - assemble those classes. -
- +

+	ant -Dbuild.config=useEclipseCompiles,verbose
+
+

+(useEclipseCompiles is incompatible with release builds +since it mixes testing and release classes.)

+

Example builds

For example, to build everything into a release bundle, with verbose logging: @@ -192,13 +215,16 @@ To build the test harness into

   cd modules/build
-  ../lib/ant/bin/ant -f build.xml build-testing-drivers
+  ../lib/ant/bin/ant build-harness-jar
 

Building with Eclipse

As mentioned above, the modules are Eclipse projects, so -once checked out, they should build as-is. That will enable you +once checked out, they should build as-is. +(You will need to be using a version of Eclipse that can +handle the .project and .classpath files in the modules/projects.) +That will enable you to run the compiler or test harness from within Eclipse (see below), but it will not build the AspectJ release as Ant does. If you are making changes in Eclipse, you should set your default JRE @@ -236,12 +262,12 @@ or restart eclipse (the files are not being closed); see for more information.

Using Eclipse to compile but Ant to assemble

-Assuming Eclipse is compiling the AspectJ modules successfully, -you can use Ant to assemble the eclipse-build .class files into a +As mentioned above, +assuming Eclipse is compiling the AspectJ modules successfully, +you can use Ant to assemble the Eclipse-built .class files into a product by including useEclipseCompiles in the -build.config -variable as described above. That reduces the build process -to product assembly, which can be completed in a couple minutes. +build.config. That reduces the build process +to product assembly. (And of course you can run Ant from Eclipse as described above.)

Running the compiler, browser, or harness from the command-line

@@ -318,34 +344,36 @@ run the JUnit and compiler tests is to run the top-level suite

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. -To run all the JUnit tests, use Ant to "build" - ../tests/junitModules.xml. -This file uses the eclipse module bin directories as its classpath, -so it will not work for someone not compiling with Eclipse. +and creating a run configuration for it, including the roll-up + root test + + RunTheseBeforeYouCommitTests. + +

Running JUnit tests in Ant from the command line

+To run the JUnit tests for any module, just go there and +
../lib/ant/bin/ant tests
.

Running JUnit tests from the command-line without Eclipse or Ant

-As you might expect, you can run JUnit directly if you put the built -modules on the JUnit classpath. You can build in Eclipse or using -Ant. The master build script enables you to build an assembled jar -for a module which includes all the normal and testing classes and -any antecedants (except for those "skipped" - see -readme-build-module.html). -

-

Running JUnit tests from Ant without Eclipse

-

-As shown above, you can use the module build script: +To run JUnit directly, put JUnit and the {module}-test-all.jar file +on the classpath:

-cd modules/util
-../lib/ant/bin/ant test	
+	set cp="lib/junit/junit.jar;aj-build/jars/util-test-all.jar"
+	java -classpath "$cp" junit.textui.TestRunner UtilModuleTests
 
+

+The assembled (-all) jar files include all antecedants, +except for those "skipped" (like Ant and JUnit). +(For more on skipped libraries, see +readme-build-module.html). +

Using the test harness to run compiler tests

-The build-testing-drivers target builds a single jar with +The build.xml build-harness-jar +target builds a single jar with the AspectJ binaries and a test harness as the main class. It reads test suite files like ../tests/ajcTests.xml; @@ -360,9 +388,9 @@ For more information, see Committers do official release builds to create the distribution released in binary form from the web site. -Release builds differ only in running +Release builds differ mainly in running from a clean, up-to-date tree and with correct build version values -in build-properties.xml, which +in local.properties, which will update org.aspectj.bridge.Version. Do not run using the build.config value useEclipseCompiles, @@ -400,8 +428,7 @@ based on the release code. E.g., from the command line:

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), +the web with the release files and documentation, verifying the downloads and pages, and sending any release notifications. Save the release installer, test results, and any notes @@ -413,8 +440,8 @@ Pushing the release out to the web involves manually updating

New modules, Java 5, and Ant-only build problems

- As described more fully in - readme-build-module.html, + To reiterate (and as described more fully in + readme-build-module.html), the build system introspects on module and the .classpath file to determine how to build. Further, it enforces stricter build invariants than the Eclipse projects do; when your code works diff --git a/build/release/build.xml b/build/release/build.xml index addaf690c..b6c530eb9 100644 --- a/build/release/build.xml +++ b/build/release/build.xml @@ -1,156 +1,55 @@ - + - + - + - - - - - - - Build and test the AspectJ source tree. Targets: - - all (default) - install # install distribution - build - build-release # build distribution - build-tests # build test classes - test - test-sources # - requires only sources - test-harness-tests # run tests/{suite}.xml's - test-install # - requires distribution - test-build-examples # install/docs/examples - test-ajc-aspectj # ajc compiles aspectj - - Normally this builds with Java 1.5 and tests with both - Java 1.3 and 1.4, so define all properties. You - can select any target (not prefixed "do-" or "init-"). - The leaf targets will run with Java version set in - ${java.home.file} - When running non-leaf targets, if you want to test - only in 1.3 or 1.4, set property "run.1[3|4].only". - - Properties to consider setting on the command-line: - - -- required - java11.home JAVA_HOME for latest JDK 1.1 - java13.home JAVA_HOME for latest J2SE 1.3 - java14.home JAVA_HOME for latest J2SE 1.4 - java15.home JAVA_HOME for latest J2SE 1.5 - - -- flags to control - run.13.only only use Java 1.3 - run.14.only only use Java 1.4 - skip.cvs no CVS checkout (true) - skip.build no build (done already) - skip.test no tests - skip.build.release no build of release - skip.build.tests no build of tests - version set if not DEVELOPMENT(?) - aspectj.build.props Ant props for ../build.xml - - -- locations to re-use existing tree or install - aspectj.workspace location for new cvs tree - aspectj.modules.dir ... for existing cvs tree - aj.build.install.dir ... for installed dist + - -- when building behind a proxy server - (currently only used for test-doc-links target) - proxy.host name of proxy server - proxy.port proxy server's port number - - Example command lines for using this script: - - - define variable for standard properties - - sp="-Djava13.home=d:/j13 -Djava14.home=d:/j14 -Djava15.home=d:/j15" - sp="$${sp} -Daspectj.modules.dir=../.." - - - clean first - - cd build - ant clean + - - test only sources in local tree - - cd build/release - ant test-sources $${sp} + + - - build and install distribution: - - cd build/release - ant install $${sp} - - - test installation and sources in local tree: - - cd build/release - ant test $${sp} -Dskip.build=true - - - do everything but checkout from cvs: - - cd build - ant clean - cd release - ant all $${sp} - - + + - - - - + + + + + + + + - - - + location="${aspectj.modules.dir}/../.."/> - + location="${aspectj.modules.build.dir}/release"/> - - - - - - - - - - + location="${aj.build.dir}/javahome.props.tmp"/> @@ -161,542 +60,87 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - test-doc-links ${doclink.start.file} - to ${doclink.output.file}-[out|messages].txt - WARNING: verify manually if result code is not 0. Known failures: - - google link nets 403, but works in browser - - progguide/printable.html has harmless empty link to d0e26 (ajc-ref?) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - do-run-harness ${suite.filename}.xml - with options ${drho.default.options} ${harness.args} - to ${harness.output.file} - - + - - - + jar="${aspectj.jar}" + failonerror="true"> + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -746,67 +191,72 @@ - + file="${aj.install.dir}/lib/aspectjrt.jar;${aspectj.modules.dir}/lib/test/aspectjrt.jar"/> + file="${aj.install.dir}"/> + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/release/readme.txt b/build/release/readme.txt index 035895ac1..cc36a86bc 100644 --- a/build/release/readme.txt +++ b/build/release/readme.txt @@ -1,8 +1,9 @@ -This script builds and tests an AspectJ release. -Use the info target to emit details. +This directory has scripts to build and test an AspectJ release. +At the bottom of this readme is a bash script to run it. -At the bottom is a bash script to run it. +NOTE: currently the set of tests done during the release build is +a subset of available product tests... ---- Evaluating the results of a build cycle @@ -45,23 +46,18 @@ Known imperfect results in the AspectJ 1.1 release: scriptDir=`dirname "${0}"` scriptDir=`cd "$scriptDir"; pwd | sed 's|/cygdrive/c/|c:/|'` -sp="-Dskip.cvs=true -Daspectj.modules.dir=../.." -sp="${sp} -Djava13.home=c:/home/apps/jdk13" -sp="${sp} -Djava14.home=c:/home/apps/jdk14" -sp="${sp} -Djava15.home=c:/home/apps/jdk15" -#sp="${sp} -Drun.14.only=true" - #alias myant="$scriptDir/../../lib/ant/bin/ant" myant="$scriptDir/../../lib/ant/bin/ant" -# clean +# clean, create distribution jar cd `dirname "$0"` cd .. "$myant" clean +"$myant" -# build local tree and install distribution: +# install distribution: cd release -"$myant" install ${sp} +"$myant" install # test installation and sources in local tree: [ -z "$skipTest" ] && "$myant" test ${sp} -Dskip.build=true @@ -69,4 +65,4 @@ cd release # check 1.1 runtime - compile will fail, # but should only be in known 1.2-dependent classes #export JAVA_HOME=c:/home/apps/jdk13 -#"$myant" compile-runtime-11 ${sp} +#"$myant" compile-runtime-11 diff --git a/build/release/release-tests.xml b/build/release/release-tests.xml new file mode 100644 index 000000000..ea28e1259 --- /dev/null +++ b/build/release/release-tests.xml @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + do-run-harness ${suite.filename}.xml with options + ${drho.default.options} ${harness.args} to ${harness.output.file} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + test-doc-links ${doclink.start.file} + to ${doclink.output.file}-[out|messages].txt + WARNING: verify manually if result code is not 0. Known failures: + - google link nets 403, but works in browser + - progguide/printable.html has harmless empty link to d0e26 (ajc-ref?) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build/sample.local.properties b/build/sample.local.properties new file mode 100644 index 000000000..81432f545 --- /dev/null +++ b/build/sample.local.properties @@ -0,0 +1,10 @@ +# for non-release builds, versions should all be DEVELOPMENT +# except for build.version.base +build.version=DEVELOPMENT +build.version.base=1.5 +build.version.long=DEVELOPMENT +build.version.short=DEVELOPMENT +java11.home=c:/home/apps/jdk11 +java13.home=c:/home/apps/jdk13 +java14.home=c:/home/apps/jdk14 +java15.home=c:/home/apps/jdk15 diff --git a/build/test-build-script.xml b/build/test-build-script.xml new file mode 100644 index 000000000..fc02e3999 --- /dev/null +++ b/build/test-build-script.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3