diff options
-rw-r--r-- | build/build-properties.xml | 206 | ||||
-rw-r--r-- | build/build.xml | 482 | ||||
-rw-r--r-- | build/junit-patterns.properties | 18 | ||||
-rw-r--r-- | build/readme-build-and-test-aspectj.html | 205 | ||||
-rw-r--r-- | build/release/build.xml | 814 | ||||
-rw-r--r-- | build/release/readme.txt | 22 | ||||
-rw-r--r-- | build/release/release-tests.xml | 273 | ||||
-rw-r--r-- | build/sample.local.properties | 10 | ||||
-rw-r--r-- | build/test-build-script.xml | 42 |
9 files changed, 936 insertions, 1136 deletions
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 @@ <project name="build-properties" default="init-properties"> <target name="init-properties" - unless="aspectj.modules.build.dir"> - - <!-- + unless="init-properties.done"> + <!-- callers should define aspectj.modules.dir --> + <property name="aspectj.modules.dir" location="${basedir}/.."/> + <require-available property="local-properties" + path="${aspectj.modules.dir}/build/local.properties"/> + <property file="${aspectj.modules.dir}/build/local.properties"/> + <!-- Changing version: - base should always be 1.1 (used for manifests, other version-parsing code) - Others should be DEVELOPMENT unless testing/doing release builds, when @@ -30,12 +34,13 @@ - build.version.eclipse.plugins should be set to "9.9.9" for "DEVELOPMENT", and - the same as build.version.long (in major.minor.service form) for releases. --> - <property name="build.verbose" value="false"/> + <property name="min.vm" value="13"/> + <property name="max.vm" value="15"/> + <property name="build.verbose" value="false"/> <property name="build.version" value="DEVELOPMENT"/> <property name="build.version.base" value="1.2"/> <property name="build.version.long" value="DEVELOPMENT"/> <property name="build.version.short" value="DEVELOPMENT"/> - <property name="build.version.eclipse.plugins" value="9.9.9"/> <!-- formats comply with SimpleDateFormat --> <property name="build.time.format" value="EEEE MMM d, yyyy 'at' HH:mm:ss z"/> @@ -52,17 +57,13 @@ <property name="company.name" value="aspectj.org"/> <property name="copyright.allRights.from1998" value="Copyright (c) 1998-2001 Xerox Corporation, 2002 Palo Alto Research Center, Incorporated, 2003-2005 Contributors. All rights reserved." /> - - <!-- callers define basedir as dir of build file? --> - <property name="aspectj.modules.dir" - location="${basedir}/.."/> - + <!-- aj... names are generated, can be mutated/cleaned --> - <property name="aj.results.dir" - location="${aspectj.modules.dir}/aj-build-results"/> <!-- these names are known to BuildModule.java and common to all --> <property name="aj.build.dir" location="${aspectj.modules.dir}/aj-build"/> + <property name="aj.failure.file" + location="${aj.build.dir}/failures.txt"/> <property name="aj.temp.dir" location="${aj.build.dir}/temp"/> <property name="aj.jar.dir" @@ -73,15 +74,11 @@ location="${aj.build.dir}/junit"/> <property name="aj.webDeploy.dir" location="${aj.build.dir}/webDeploy"/> - <property name="aj.plugin.org.aspectj.ajde.dir" - location="${aj.dist.dir}/ide/eclipse/org.aspectj.ajde"/> - <property name="aj.plugin.org.aspectj.aspectjrt.dir" - location="${aj.dist.dir}/ide/eclipse/org.aspectj.aspectjrt"/> - <property name="aj.plugin.org.aspectj.ajde.source.dir" - location="${aj.dist.dir}/ide/eclipse/org.aspectj.ajde.source"/> - <property name="aj.plugin.org.aspectj.ajde.doc.dir" - location="${aj.dist.dir}/ide/eclipse/org.aspectj.ajde.doc"/> - + <property name="aj.install.dir" + location="${aj.build.dir}/install"/> + <property name="aj.logs.dir" + location="${aj.build.dir}/logs"/> + <!-- aspectj... names are sources, not to be mutated --> <property name="aspectj.modules.lib.dir" location="${aspectj.modules.dir}/lib"/> @@ -96,13 +93,39 @@ location="${aspectj.modules.build.dir}/products"/> <property name="aspectj.modules.tests.dir" location="${aspectj.modules.dir}/tests"/> + + <property file="${aspectj.modules.build.dir}/junit-patterns.properties"/> + + <property name="aspectj.tools.modules.13" + value="ajbrowser,ajde,ajdoc,asm,bridge,loadtime,org.aspectj.ajdt.core,runtime,taskdefs,util,weaver"/> + <property name="aspectj.tools.modules.15" + value="loadtime5,aspectj5rt"/> + <condition property="aspectj.tools.modules" + value="${aspectj.tools.modules.13},${aspectj.tools.modules.15}"> + <equals arg1="1.5" arg2="${ant.java.version}"/> + </condition> + <condition property="aspectj.tools.modules" + value="${aspectj.tools.modules.13}"> + <not> + <equals arg1="1.5" arg2="${ant.java.version}"/> + </not> + </condition> + <property name="aspectj.test.modules" + value="build,testing,testing-client,testing-drivers,testing-util,tests"/> + <property name="aspectj.compilerTest.modules" + value="tests"/> + <property name="aspectj.other.modules" + value="docs,eclipse.plugin"/> + <jar-property name="junit.jar" location="${aspectj.modules.lib.dir}/junit/junit.jar"/> - <property name="junit.includes" - value="**/*Test.java,**/**TestCase.java"/> - <property name="junit.excludes" - value="**/DocumentParserTest.java,**/CommandTestCase.java,**/VerifyWeaveTestCase.java,**/KnownfailuresTests.java,**/KnownLimitationsTests.java,**/PureJavaTests.java,**/AbstractWorldTestCase.java,**/WeaveTestCase.java"/> - <!-- would like to enable PureJavaTests.java --> + <guarded-property name="jdk.tools.jar" + location="${java.home}/../lib/tools.jar"/> + <guarded-property name="jdk.tools.jar" + location="${java.home}/lib/tools.jar"/> + <guarded-property name="aspectjrt.path" + location="${aspectj.modules.lib.dir}/test/aspectjrt.jar"/> + <property name="init-properties.done" value="true"/> </target> <target name="init-taskdefs" @@ -112,10 +135,8 @@ location="${aspectj.modules.lib.dir}/build/build.jar"/> <jar-property name="lib.ant.jar" location="${aspectj.modules.lib.dir}/ant/lib/ant.jar"/> - <taskdef resource="org/aspectj/internal/tools/ant/taskdefs/taskdefs.properties" + <taskdef resource="org/aspectj/internal/tools/ant/taskdefs/taskdefs.properties" classpath="${aspectj.build.jar}"/> - <property name="aj.taskdef.package" - value="org.aspectj.internal.tools.ant.taskdefs"/> <path id="ant.lib.path"> <fileset dir="${aspectj.modules.lib.dir}/ant/lib"> <include name="**/*.jar"/> @@ -144,20 +165,15 @@ </target> <target name="init-directories" - depends="init-properties"> -<!-- some flows take us through this target twice in one build and it needs to - successfully execute twice --> -<!-- unless="init-directories.done" --> - <mkdir dir="${aj.results.dir}" /> + depends="init-properties" + description="ensure dirs, possibly many times in a build"> <mkdir dir="${aj.build.dir}" /> <mkdir dir="${aj.temp.dir}" /> <mkdir dir="${aj.jar.dir}" /> <mkdir dir="${aj.dist.dir}" /> - <mkdir dir="${aj.plugin.org.aspectj.ajde.dir}" /> - <mkdir dir="${aj.plugin.org.aspectj.ajde.source.dir}" /> - <mkdir dir="${aj.plugin.org.aspectj.ajde.doc.dir}" /> - <property name="init-directories.done" value="done"/> - </target> + <mkdir dir="${aj.install.dir}" /> + <mkdir dir="${aj.logs.dir}" /> + </target> <target name="init-filters" depends="init-properties" @@ -186,9 +202,10 @@ depends="init-directories" unless="clean-directories.done" > <property name="clean-directories.done" value="done"/> - <delete quiet="on" dir="${aj.build.dir}" /> <!-- warning if not deleted? --> + <delete quiet="on"> + <fileset dir="${aj.build.dir}" includes="*,**/*"/> + </delete> <antcall target="init-directories"/> - <!-- aj.results.dir is not cleaned --> </target> <target name="clean-jars" @@ -211,7 +228,6 @@ build.version.short = ${build.version.short} aspectj.modules.dir = ${aspectj.modules.dir} aj.build.dir = ${aj.build.dir} - aj.results.dir = ${aj.results.dir} ant.home = ${ant.home} java.home = ${java.home} </echo> @@ -230,16 +246,116 @@ message="unable to find @{name}: ${@{name}}"/> </sequential> </macrodef> - - <!-- todo convert clients to clean-dir --> + <macrodef name="guarded-property" + description="set property {name} to {location} if unset and {location} exists"> + <attribute name="name"/> + <attribute name="location"/> + <sequential> + <property name="@{name}.path" + location="@{location}"/> + <condition property="@{name}" + value="${@{name}.path}"> + <and> + <not> + <isset property="@{name}"/> + </not> + <available file="${@{name}.path}"/> + </and> + </condition> + </sequential> + </macrodef> + <macrodef name="clean-dir"> <attribute name="dir"/> <sequential> <mkdir dir="@{dir}"/> <delete> - <fileset dir="@{dir}" includes="*"/> + <fileset dir="@{dir}" includes="*,**/*"/> </delete> <mkdir dir="@{dir}"/> </sequential> </macrodef> + + <macrodef name="report-if-failed"> + <attribute name="property"/> + <attribute name="text"/> + <sequential> + <echo level="debug" message="property: @{property}: ${@{property}}"/> + <echo level="debug" message="text: @{text}: ${@{text}}"/> + <condition property="failed" value="true"> + <isset property="@{property}"/> + </condition> + <echo level="debug" message="failed: ${failed}"/> + <antcall target="do-report-fail"> + <param name="text" value="@{text}"/> + </antcall> + </sequential> + </macrodef> + <target name="do-report-fail" + if="failed"> + <echo level="debug" message="do-report-fail - failed=${failed}"/> + <echo level="debug" message="do-report-fail - text=${text}"/> + <echo append="true" file="${aj.failure.file}">${text} +</echo> + </target> + + <target name="fail-if-failures" + description="fail if ${aj.failure.file} exists and is not empty"> + <loadfile + failonerror="false" + property="failures" + srcfile="${aj.failure.file}"/> + <fail> + <condition> + <length file="${aj.failure.file}" + when="greater" length="0"/> + </condition> +${failures} +</fail> + <!-- + <loadfile + failonerror="false" + property="failures" + srcfile="${aj.failure.file}"/> + <condition property="failure"> + <equals arg1="${failures}" arg2="${failure}"/> + </condition> + <condition property="passed"> + <equals arg1="${failures}" arg2=""/> + </condition> + <fail unless="passed">${failures} +</fail> + --> + </target> + + <macrodef name="set-available" + description="set property and property.available if path exists"> + <attribute name="property"/> + <attribute name="path"/> + <sequential> + <property name="@{property}.location" + location="@{path}"/> + + <available property="@{property}" + file="${@{property}.location}" + value="${@{property}.location}"/> + <condition property="@{property}.available"> + <equals arg1="${@{property}.location}" arg2="${@{property}}"/> + </condition> + </sequential> + </macrodef> + + <macrodef name="require-available"> + <attribute name="property"/> + <attribute name="path"/> + <attribute name="message" default=""/> + <sequential> + + <set-available property="@{property}" path="@{path}"/> + <fail unless="@{property}.available"> +@{message} (property "@{property}" not at "@{path}") + </fail> + </sequential> + </macrodef> + </project> 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 @@ <project name="build" default="all" basedir="."> - <target name="all" depends="aspectj"/> <!-- used to also depend on "eclipse.plugins"/--> + <target name="all" depends="aspectj"> + <antcall target="eclipse.plugins"/> + </target> <target name="rebuild" depends="clean,all"/> <target name="clean" depends="clean-directories"/> - <!-- these rely on mapping ant.project.name to module.name --> - <target name="compile" depends="build-module"/> - <target name="compile-tests" depends="init"> - <antcall target="any-module-all"> - <param name="trim.testing.default" value="false"/> - </antcall> + + <target name="compile" depends="build-module" + description="compile module ${module.name} (without tests, by default)"/> + + <target name="compile-tests" depends="init" + description="compile module ${module.name} tests"> + <assemble-module-test module="${module.name}"/> </target> <target name="test" depends="compile-tests"> - <antcall target="run-module-junit-tests"/> + <antcall target="do-test-junit"/> </target> - <!-- ===================================================================== --> <!-- Init --> <!-- ===================================================================== --> - <!-- use this file to force prop values --> <property name="modules.dir" location="${basedir}/.."/> <property name="module.name" value="${ant.project.name}"/> <import file="${modules.dir}/build/build-properties.xml"/> + <target name="wes" depends="init-properties"> + <delete file="${aj.failure.file}"/> + <echo message="-> no false negative (no file)"/> + <antcall target="fail-if-failures"/> + + <touch file="${aj.failure.file}"/> + <echo message="-> no false negative (empty file)"/> + <antcall target="fail-if-failures"/> + + <echo message="-> no false negative (unset Property)"/> + <report-if-failed text="not error text" property="unsetProperty"/> + <antcall target="fail-if-failures"/> + + <echo message="-> true negative (set Property)"/> + <property name="setProperty" value="."/> + <report-if-failed text="error text" property="setProperty"/> + <antcall target="fail-if-failures"/> + <loadfile property="emit" srcfile="${aj.failure.file}"/> + <echo message="-> file contents: ${emit}"/> + </target> <target name="init" depends="init-properties,init-directories"> <property name="build.config" value=""/> <property name="trim.testing.default" value="true"/> <property name="aj.installer.jar" - location="${aj.dist.dir}/aspectj-${build.version.short}.jar"/> + location="${aj.dist.dir}/aspectj-${build.version.long}.jar"/> <available property="ant.lib.aspectjtools" file="${ant.home}/lib/aspectjtools.jar" @@ -138,20 +159,7 @@ failonerror="on" command="update -dP" /> </target> - - <!-- ===================================================================== --> - <!-- test targets --> - <!-- ===================================================================== --> - - <target name="quicklook" > - <antcall target="clean"/> - <!-- todo: compile modules without test sources --> - <!-- todo: junit tests (compile with test sources) --> - <antcall target="aspectj"/> - <antcall target="ajcTests"/> - <!-- todo: product install and tests --> - </target> - + <!-- ===================================================================== --> <!-- antcall targets --> <!-- ===================================================================== --> @@ -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 @@ </target> <target name="build-module" depends="init,init-taskdefs,init-version"> - <ajbuild jarDir="${aj.jar.dir}" - baseDir="${aspectj.modules.dir}" - distDir="${aj.dist.dir}" - module="${module.name}" - trimTesting="${trim.testing.default}" - buildConfig="${build.config}" - version="${build.version.long}" - verbose="${build.verbose}" - failonerror="true"/> - </target> - - <target name="build-module-all" depends="init,init-taskdefs,init-version"> <ajbuild module="${module.name}" baseDir="${aspectj.modules.dir}" distDir="${aj.dist.dir}" jarDir="${aj.jar.dir}" - trimTesting="${trim.testing.default}" + trimTesting="${trim.testing}" buildConfig="${build.config}" version="${build.version.long}" verbose="${build.verbose}" - assembleall="true" + assembleall="${assemble}" failonerror="true"/> </target> + <macrodef name="build-module-all"> + <attribute name="module"/> + <attribute name="trimTesting" default="${trim.testing.default}"/> + <sequential> + <antcall target="build-module"> + <param name="module.name" value="@{module}"/> + <param name="trim.testing" value="@{trimTesting}"/> + <param name="assemble" value="true"/> + </antcall> + </sequential> + </macrodef> + <macrodef name="build-module"> + <attribute name="module"/> + <attribute name="trimTesting" default="${trim.testing.default}"/> + <attribute name="assemble" default="false"/> + <sequential> + <antcall target="build-module"> + <param name="module.name" value="@{module}"/> + <param name="trim.testing" value="@{trimTesting}"/> + <param name="assemble" value="@{assemble}"/> + </antcall> + </sequential> + </macrodef> + + <macrodef name="assemble-module-test"> + <attribute name="module"/> + <sequential> + <build-module module="@{module}" assemble="true" trimTesting="false"/> + </sequential> + </macrodef> + + <target name="create-installer" depends="init,init-taskdefs,init-filters" description="create ${installer.file} from ${staging.dir} using ${htmlSrc.dir} and ${simpleClassName}"> <!-- init-filters: filter on copy used by ajinstaller taskdef --> @@ -221,186 +249,126 @@ </target> <!-- ===================================================================== --> - <!-- custom targets --> - <!-- ===================================================================== --> - <!-- - deprecated, but desireable... - <target name="junit-tests-allinone" + <!-- test targets --> + <!-- ===================================================================== --> + <target name="test-run-all-junit-tests" depends="init" - description="deprecated - kills JUnit by using run-all-junit-tests "> - <property name="alltests.module" - value="run-all-junit-tests"/> - <clean-dir dir="${aj.junit.dir}"/> - <antcall target="build-module-all"> - <param name="module.name" value="${alltests.module}"/> - <param name="trim.testing.default" value="false"/> + description="run unit tests via run-all-junit-tests module"> + <antcall target="test"> + <param name="module.name" value="run-all-junit-tests"/> </antcall> - <junit fork="on" - includeAntRuntime="off" - dir="${aspectj.modules.build.dir}" - printsummary="yes" - haltonfailure="${haltOnTestFailure}" > - <classpath> - <pathelement location="${java.home}/lib/tools.jar"/> - <pathelement location="${aj.jar.dir}/${alltests.module}-all.jar"/> - <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar"/> - <fileset dir="${aspectj.modules.lib.dir}/ant/lib" - includes="ant.jar,ant-junit.jar,xml-apis.jar,xercesImpl.jar"/> - </classpath> - <jvmarg value="-Daspectjrt.path=${aspectjrt.path}" /> - <jvmarg value="-Xmx400m" /> - <formatter type="xml"/> - <test name="AllModuleTests" todir="${aj.junit.dir}"/> - </junit> - </target> - --> - <target name="junit-tests" + </target> + + <target name="test-compiler-tests" depends="init" - description="build and run JUnit leaf tests ${junit.includes}"> - <property name="alltests.module" - value="run-all-junit-tests"/> - <clean-dir dir="${aj.junit.dir}"/> - <antcall target="build-module-all"> - <param name="module.name" value="${alltests.module}"/> - <param name="trim.testing.default" value="false"/> + description="run compiler tests via tests module"> + <antcall target="test"> + <param name="module.name" value="tests"/> </antcall> - - <junit fork="on" + </target> + + <target name="test-each-module" + depends="init" + description="run JUnit tests for each module"> + <subant target="test"> + <filelist dir="${aspectj.modules.dir}" + files="${aspectj.tools.modules},${aspectj.test.modules}"/> + </subant> + </target> + + <target name="junitreport" depends="init,init-taskdefs" + if="junitreport.available"> + <clean-dir dir="${aj.junit.dir}/html"/> + <junitreport todir="${aj.junit.dir}/html"> + <fileset dir="${aj.junit.dir}"> + <include name="**/TEST-*.xml"/> + </fileset> + <report format="frames" todir="${aj.junit.dir}/html"/> + </junitreport> + <pathconvert property="jur.url" targetos="unix"> + <path location="${aj.junit.dir}/html/index.html"/> + </pathconvert> + <echo message="see file:${jur.url}"/> + </target> + + <target name="do-test-junit" + depends="init-taskdefs" + description="run junit tests for a module using module root or leaves"> + <property name="dtj.dir" + location="${aj.junit.dir}/${module.name}"/> + <mkdir dir="${dtj.dir}"/> + + <condition property="dtj.includes" + value="${junit.includes}" + else="${junit.rootSuites}"> + <istrue value="${junit.leaves}"/> + </condition> + <condition property="dtj.excludes" + value="${junit.excludes}" + else=""> + <istrue value="${junit.leaves}"/> + </condition> + + <junit + dir="${aspectj.modules.build.dir}" + failureproperty="test-junit-${module.name}.failed" + fork="on" + forkmode="perTest" + maxmemory="400m" includeAntRuntime="off" - dir="${aspectj.modules.build.dir}" printsummary="yes" haltonfailure="${haltOnTestFailure}" > <classpath> - <pathelement location="${aj.jar.dir}/${alltests.module}-all.jar"/> - <!-- see skipped libraries in Builder.properties --> - <pathelement location="${java.home}/lib/tools.jar"/> + <pathelement location="${aj.jar.dir}/${module.name}-test-all.jar"/> + <!-- see skipped libraries in Builder.properties --> + <pathelement location="${jdk.tools.jar}"/> <pathelement location="${aspectj.modules.lib.dir}/junit/junit.jar"/> - <fileset dir="${aspectj.modules.lib.dir}/ant/lib" + <!-- XML api's used by loadtime, also needed when running under 1.3 per Ant FAQ --> + <fileset dir="${aspectj.modules.lib.dir}/ant/lib" includes="ant.jar,ant-junit.jar,xml-apis.jar,xercesImpl.jar"/> </classpath> - <jvmarg value="-Daspectjrt.path=${aspectjrt.path}" /> - <jvmarg value="-Xmx400m" /> + <jvmarg value="-Daspectjrtpath=${aspectjrt.path}" /> <formatter type="xml"/> - <batchtest todir="${aj.junit.dir}"> - <fileset dir="${aspectj.modules.dir}/ajde/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/ajdoc/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/asm/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/bridge/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/build/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/loadtime/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/org.aspectj.ajdt.core/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/runtime/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/taskdefs/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/testing/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/testing-client/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/testing-drivers/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/tests/src" includes="**/*Tests.java" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/util/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - <fileset dir="${aspectj.modules.dir}/weaver/testsrc" includes="${junit.includes}" excludes="${junit.excludes}"/> - </batchtest> - </junit> - <antcall target="if.junitreport"/> - </target> - - <target name="if.junitreport" depends="init" - if="junitreport.available" - description="silently skip if no libraries available"> - <antcall target="junitreport"/> + <batchtest todir="${dtj.dir}"> + <fileset dir="${modules.dir}/${module.name}/testsrc" + includes="${dtj.includes}" + excludes="${dtj.excludes}"/> + </batchtest> + </junit> + <report-if-failed text="JUnit tests for ${module.name} failed" + property="test-junit-${module.name}.failed"/> </target> - - <target name="junitreport" depends="init,init-taskdefs"> - <fail unless="junitreport.available" - message="junitreport needs lib/ant/lib/xalan.jar"/> - <clean-dir dir="${aj.junit.dir}/html"/> - <junitreport todir="${aj.junit.dir}/html"> - <fileset dir="${aj.junit.dir}"> - <include name="TEST-*.xml"/> - </fileset> - <report format="frames" todir="${aj.junit.dir}/html"/> - </junitreport> - </target> - <target name="build-testing-drivers" depends="init-taskdefs,init" - unless="testing.drivers.all.available"> - <antcall target="any-module-all"> - <param name="module.name" value="testing-drivers"/> - </antcall> - </target> + + <!-- ===================================================================== --> + <!-- custom targets --> + <!-- ===================================================================== --> - <target name="build-testing-jars" - depends="aspectjrt,build,ajbrowser-all" - description="build testing jars. - Use -Dtrim.testing.default=false to build junit tests"> - <antcall target="any-module"> - <param name="module.name" value="testing"/> - </antcall> - <antcall target="any-module"> - <param name="module.name" value="testing-drivers"/> - </antcall> - <antcall target="build-testing-drivers"/> + <target name="build-harness-jar" depends="init" + description="build harness jar from scratch"> + <antcall target="clean-jars"/> + <assemble-module-test module="testing-drivers"/> </target> - <target name="build-testing-client" depends="init-taskdefs,init"> - <antcall target="build-module-all"> - <param name="module.name" value="testing-client"/> - </antcall> + <target name="build-testing-jars" depends="init" + description="build harness jar from scratch"> + <antcall target="build-harness-jar"/> + </target> + + <target name="build-testing-client" depends="init-taskdefs,init"> + <build-module module="testing-client" assemble="true"/> + <assemble-module-test module="testing-client"/> <echo> To use testing client jar in tests, mv ../aj-build/jars/testing-client-all.jar ../lib/tests/testing-client.jar </echo> </target> - <target name="run-module-junit-tests" depends="init-taskdefs" - description="run all junit tests for a module"> - <mkdir dir="${aj.junit.dir}/${module.name}"/> - <!-- fork to load classes, include AntRuntime to get taskdef classes junit.jar --> - <junit - fork="true" - dir="../${module.name}" - printsummary="yes" - haltonfailure="${haltOnTestFailure}"> - <classpath> - <pathelement location="${aj.build.dir}/jars/${module.name}-all.jar"/> - <!-- libraries clipped from -all jars (though junit in parent) --> - <pathelement location="${aspectjrt.path}"/> - <pathelement location="${junit.jar}"/> - </classpath> - - <!-- aspectjrt.path used by ajde tests --> - <sysproperty key="aspectjrt.path" value="${aspectjrt.path}"/> - - <formatter type="xml"/> - <batchtest - todir="${aj.junit.dir}/${module.name}"> - <fileset dir="${modules.dir}/${module.name}/testsrc"> - <include name="*ModuleTests.java" /> - </fileset> - </batchtest> - </junit> - </target> - - <!-- remove as unused - see release/build.xml test-sources --> - <target name="ajcTests" depends="init,build-testing-drivers"> - <java fork="true" jar="${aj.jar.dir}/testing-drivers-all.jar" - dir="${aspectj.modules.tests.dir}" - output="${aj.results.dir}/ajcTests.out.txt"> - <arg value="-traceTestsMin"/> - <arg value="-logFail"/> - <arg value="-hideStreams"/> - <arg value="-loud"/> - <arg value="-ajctestSkipKeywords=purejava,knownLimitations"/> - <arg value="ajcTests.xml"/> - </java> - <echo message="find result in ${aj.results.dir}/ajcTests.out.txt"/> - </target> - - <target name="aspectj" depends="init,aspectjtools-dist,docs-dist" + <target name="aspectj" depends="init,aspectjtools-dist,docs-dist" description="create installer from local distributions"> <property name="installer.staging.dir" location="${aj.temp.dir}/installer-staging"/> - <mkdir dir="${installer.staging.dir}"/> - <delete dir="${installer.staging.dir}"/> - <mkdir dir="${installer.staging.dir}"/> + <clean-dir dir="${installer.staging.dir}"/> <copy todir="${installer.staging.dir}"> <fileset dir="${aj.dist.dir}/tools"/> <fileset dir="${aj.dist.dir}/docs"/> @@ -427,10 +395,8 @@ To use testing client jar in tests, <target name="aspectjrt" depends="init" description="build aspectjrt.jar (differently than release)"> - <antcall target="build-module-all"> - <param name="module.name" value="runtime"/> - </antcall> - <copy file="${aj.jar.dir}/runtime.jar" + <build-module-all module="aspectj5rt"/> + <copy file="${aj.jar.dir}/aspectj5rt-all.jar" tofile="${aj.jar.dir}/aspectjrt.jar"/> </target> @@ -440,17 +406,13 @@ To use testing client jar in tests, <!-- for any-[module|product], define [module|product].name --> <target name="any-module" depends="init"> - <fail unless="module.name" message="use -Dmodule.name=... to define"/> - <antcall target="build-module"> - <param name="module.name" value="${module.name}"/> - </antcall> + <fail unless="module.name" message="use -Dmodule.name=... to define"/> + <build-module module="${module.name}"/> </target> <target name="any-module-all" depends="init"> - <fail unless="module.name" message="use -Dmodule.name=... to define"/> - <antcall target="build-module-all"> - <param name="module.name" value="${module.name}"/> - </antcall> + <fail unless="module.name" message="use -Dmodule.name=... to define"/> + <build-module-all module="${module.name}"/> </target> <target name="any-product" depends="init"> @@ -460,30 +422,16 @@ To use testing client jar in tests, </antcall> </target> - <!-- literal targets --> - <target name="eajc" depends="init"> - <antcall target="build-module-all"> - <param name="module.name" value="org.aspectj.ajdt.core"/> - </antcall> - <echo message="use org.aspectj.ajdt.core-all.jar for eajc.jar"/> - </target> - <target name="ajbrowser-all" > - <antcall target="build-module-all"> - <param name="module.name" value="ajbrowser"/> - </antcall> + <build-module-all module="ajbrowser"/> </target> <target name="ajdoc-all"> - <antcall target="build-module-all"> - <param name="module.name" value="ajdoc"/> - </antcall> + <build-module-all module="ajdoc"/> </target> <target name="build"> - <antcall target="build-module"> - <param name="module.name" value="build"/> - </antcall> + <build-module-all module="build"/> </target> <target name="aspectjtools-dist" depends="init" @@ -497,90 +445,10 @@ To use testing client jar in tests, <!-- eclipse plugins --> <!-- ===================================================================== --> - <target name="eclipse.plugins" depends="org.aspectj.ajde.source, - org.aspectj.ajde.doc, - org.aspectj.ajde, - org.aspectj.aspectjrt" - description="create the Eclipse distribution plugins"/> - - <target name="org.aspectj.ajde.source" depends="init" - description="build the AspectJ source distribution plugin"> - <copy todir="${aj.plugin.org.aspectj.ajde.source.dir}"> - <fileset dir="${aspectj.modules.dir}/eclipse.plugin/org.aspectj.ajde.source"/> - </copy> - <replace file="${aj.plugin.org.aspectj.ajde.source.dir}/plugin.xml" - token="build.version.eclipse.plugins" - value="${build.version.eclipse.plugins}"/> - <copy file="${aspectj.modules.dir}/org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip" - todir="${aj.plugin.org.aspectj.ajde.source.dir}/src"/> - <zip destfile="${aj.plugin.org.aspectj.ajde.source.dir}/src/aspectjsrc.zip"> - <fileset dir="${aspectj.modules.dir}/ajbrowser/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/ajdoc/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/ajde/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/asm/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/bridge/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/org.aspectj.ajdt.core/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/runtime/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/taskdefs/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/util/src" includes="**"/> - <fileset dir="${aspectj.modules.dir}/weaver/src" includes="**"/> - </zip> - <jar destfile="${aj.plugin.org.aspectj.ajde.source.dir}/../org.aspectj.ajde.source_${build.version.eclipse.plugins}.jar"> - <fileset dir="${aj.plugin.org.aspectj.ajde.source.dir}" includes="**"/> - </jar> - </target> - - <target name="org.aspectj.ajde.doc" depends="init,docs-dist" - description="build the AspectJ documentation plugin for Eclipse"> - <copy todir="${aj.plugin.org.aspectj.ajde.doc.dir}"> - <fileset dir="${aspectj.modules.dir}/eclipse.plugin/org.aspectj.ajde.doc"/> - </copy> - <copy todir="${aj.plugin.org.aspectj.ajde.doc.dir}/doc"> - <fileset dir="${aj.dist.dir}/docs/doc" includes="**"/> - </copy> - <replace file="${aj.plugin.org.aspectj.ajde.doc.dir}/plugin.xml" - token="build.version.eclipse.plugins" - value="${build.version.eclipse.plugins}"/> - <jar destfile="${aj.plugin.org.aspectj.ajde.doc.dir}/../org.aspectj.ajde.doc_${build.version.eclipse.plugins}.jar"> - <fileset dir="${aj.plugin.org.aspectj.ajde.doc.dir}" includes="**"/> - </jar> - </target> - - <target name="org.aspectj.ajde" depends="init,aspectj" - description="build the AspectJ library plugin for Eclipse"> - <copy todir="${aj.plugin.org.aspectj.ajde.dir}"> - <fileset dir="${aspectj.modules.dir}/eclipse.plugin/org.aspectj.ajde"/> - </copy> - <replace file="${aj.plugin.org.aspectj.ajde.dir}/plugin.xml" - token="build.version.eclipse.plugins" - value="${build.version.eclipse.plugins}"/> - <copy file="${aj.dist.dir}/tools/lib/aspectjrt.jar" - todir="${aj.plugin.org.aspectj.ajde.dir}"/> - <copy file="${aj.dist.dir}/tools/lib/aspectjtools.jar" - todir="${aj.plugin.org.aspectj.ajde.dir}"/> - <jar destfile="${aj.plugin.org.aspectj.ajde.dir}/ajde.jar"> - <zipfileset src="${aj.dist.dir}/tools/lib/aspectjtools.jar" - includes="org/aspectj/**"/> - </jar> - <jar destfile="${aj.plugin.org.aspectj.ajde.dir}/../org.aspectj.ajde_${build.version.eclipse.plugins}.jar"> - <fileset dir="${aj.plugin.org.aspectj.ajde.dir}" includes="**"/> - </jar> - </target> - - <target name="org.aspectj.aspectjrt" depends="init,aspectj" - description="build the AspectJ runtime library plugin for Eclipse"> - <copy todir="${aj.plugin.org.aspectj.aspectjrt.dir}"> - <fileset dir="${aspectj.modules.dir}/eclipse.plugin/org.aspectj.aspectjrt"/> - </copy> - <replace file="${aj.plugin.org.aspectj.aspectjrt.dir}/plugin.xml" - token="build.version.eclipse.plugins" - value="${build.version.eclipse.plugins}"/> - <copy file="${aj.dist.dir}/tools/lib/aspectjrt.jar" - todir="${aj.plugin.org.aspectj.aspectjrt.dir}"/> - <jar destfile="${aj.plugin.org.aspectj.aspectjrt.dir}/../org.aspectj.aspectjrt_${build.version.eclipse.plugins}.jar"> - <fileset dir="${aj.plugin.org.aspectj.aspectjrt.dir}" includes="**"/> - </jar> - </target> + <target name="eclipse.plugins" depends="init" + description="create the Eclipse distribution plugins"> + <ant dir="${aspectj.modules.dir}/eclipse.plugin" inheritAll="false"/> + </target> </project> 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</pre> If using Eclipse, check out the subdirectories of <code>org.aspectj/modules</code> as Eclipse projects. -Skip modules <code>aspectj-attic</code> and (unless running -JUnit or compiler tests) <code>tests</code> and most <code>testing*</code> -modules. Do not skip <code>testing-utils</code>, -which is used by other modules. +Skip the <code>aspectj-attic</code> module. <p/>Build an AspectJ distribution: <pre> cd org.aspectj/modules/build - ../lib/ant/bin/ant -f build.xml</pre> - -To speed the build, Eclipse users can adopt the Eclipse-produced .class files: -<pre> ../lib/ant/bin/ant -f build.xml -Dbuild.config=useEclipseCompiles</pre> + ../lib/ant/bin/ant</pre> Install the distribution (e.g., into build/../aspectj-install): @@ -86,81 +80,110 @@ target directory using <code>-to {targDir}</code>: Test it by running the build script in the examples directory: <pre> cd ../aspectj-install/doc/examples - ../../ant/bin/ant</pre> + ../../lib/ant/bin/ant</pre> This should build and run the spacewar example. -<h3>Requirements</h3> -To build requires only the AspectJ project modules. +<h3>Required sources, libraries, and tools</h3> + <p> + +To build requires only the AspectJ project modules and Java VM's. All necessary libraries and tools are in the -<a href="../lib/">lib</a> directory. For command-line users, -that usually means checking out the modules directory: +<a href="../lib/">lib</a> directory, including Ant. + </p> +<p>To get the source, check out from CVS. E.g., from the command line, +</p> + <pre> export CVS_ROOT=":pserver:anonymous@dev.eclipse.org:/home/technology" cvs co org.aspectj/modules </pre> -Eclipse users should check out subdirectories of - <code>org.aspectj/modules</code> as a Java project. - -<p/> <p> - + Eclipse users should check out each relevant subdirectory of + <code>org.aspectj/modules</code> as a project + (most have .project files). +</p> +<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. 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. +The <code>aspectj-attic</code> module only has old code. </p> <h3>Standard builds</h3> +<h4>Overview</h4> +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 <code>src</code> (or <code>java5-src</code> +for Java 5 code) and test source files in +<code>testsrc</code> (or <code>java5-testsrc</code>), +and can handle Java and AspectJ projects. +For more information on the build infrastructure and setup, see +<a href="readme-build-module.html">readme-build-module.html</a> +and <a href="#antInvariants">below</a>. + <h4>Building using Ant</h4> +<p> +You should use the Ant in ../lib/ant. Currently this is a vanilla +distribution of Ant 1.6.3, but that might change. +</p> +<p> This <a href=".">build</a> directory has a master <a href="build.xml">build.xml</a> script, and the modules have satellite <code>build.xml</code> which support building only that module. -(To run Ant, use the project's <a href="../lib/ant">../lib/ant</a> -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 <a href="build.xml">build.xml</a> +The <a href="release">release</a> 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 <code>build.xml</code> files are in +The <a href="../docs/build.xml">../docs/build.xml</a>, + <a href="../org.aspectj.lib/build-aspectjlib.xml">org.aspectj.lib/build-aspectjlib.xml</a>, +and <a href="../eclipse.plugin/build.xml">../eclipse.plugin/build.xml</a>. +These are invoked by the master +<a href="build.xml">build.xml</a> as needed. +Other modules have generic <code>build.xml</code>'s that just +use the master build file to run targets <code>compile</code> and +<code>test</code> for that module. +(If you do <code>clean</code>, all binaries for all +modules are cleaned.) +</p> +<p> +The master <a href="build.xml">build.xml</a> creates an AspectJ distribution in <a href="../aj-build/dist/aspectj-DEVELOPMENT.jar"> ../aj-build/dist/aspectj-DEVELOPMENT.jar </a>; -see the <a href="build.xml">build.xml</a> for other targets. -The <code>build.xml</code>'s in the other modules support the -targets <code>compile</code> and <code>test</code> for just -that module; if you do <code>clean</code>, all binaries for all -modules are cleaned. - +You'll notice module jar results are put in + <a href="../aj-build/jars">../aj-build/jars</a>, +including <code>{module}.jar</code> and <code>{module}-test.jar</code> +(for the release and test classes) and +<code>{module}-all.jar</code>, and +<code>{module}-test-all.jar</code> +(including all antecedant classes and libraries). +See <a href="build.xml">build.xml</a> for other targets. +</p> +<p> +For any build, you should create your own version of + <a href="local.properties">local.properties</a>, using + <a href="sample.local.properties">sample.local.properties</a> +as a template. When using the master <code>build.xml</code>, -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, <p/> -<table cellpadding="1" border="1"> -<tr><th>Property</th><th>Meaning</th> - </tr> -<tr><td>module.name - </td><td>To build any module (esp. those not directly supported - by a target), use the "any-module" target and define - the module name. - </td></tr> -<tr><td>check.build.jar - </td><td>any value cause build to fail if - <code>lib/build/build.jar</code> is out of date. (This is a - built archive of the build module to avoid bootstrapping.) - </td></tr> -<tr><td>build.config - </td><td>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. - </td></tr> -</table> - +<pre> + ant -Dbuild.config=useEclipseCompiles,verbose +</pre> +<p> +(<code>useEclipseCompiles</code> is incompatible with release builds +since it mixes testing and release classes.) <p/> +<h4>Example builds</h4> <p> For example, to build everything into a release bundle, with verbose logging: @@ -192,13 +215,16 @@ To build the test harness into </p> <pre> cd modules/build - ../lib/ant/bin/ant -f build.xml build-testing-drivers + ../lib/ant/bin/ant build-harness-jar </pre> <h4>Building with Eclipse</h4> <p> 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. <h4>Using Eclipse to compile but Ant to assemble</h4> -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 <code>useEclipseCompiles</code> in the -<code>build.config</code> -variable as described above. That reduces the build process -to product assembly, which can be completed in a couple minutes. +<code>build.config</code>. That reduces the build process +to product assembly. (And of course you can run Ant from Eclipse as described above.) <h4>Running the compiler, browser, or harness from the command-line</h4> @@ -318,34 +344,36 @@ run the JUnit and compiler tests is to run the top-level suite <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. -To run all the JUnit tests, use Ant to "build" - <a href="../tests/junitModules.xml">../tests/junitModules.xml</a>. -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 +<a href="../run-all-junit-tests/testsrc/RunTheseBeforeYouCommitTests.java"> + RunTheseBeforeYouCommitTests</a>. + +<h4>Running JUnit tests in Ant from the command line</h4> +To run the JUnit tests for any module, just go there and +<pre>../lib/ant/bin/ant tests</pre>. <h4>Running JUnit tests from the command-line without Eclipse or Ant</h4> <p> -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 -<a href="readme-build-module.html">readme-build-module.html</a>). -</p> -<h4>Running JUnit tests from Ant without Eclipse</h4> -<p> -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: </p> <pre> -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 </pre> +<p> +The assembled (<code>-all</code>) jar files include all antecedants, +except for those "skipped" (like Ant and JUnit). +(For more on skipped libraries, see +<a href="readme-build-module.html">readme-build-module.html</a>). +</p> <h4>Using the test harness to run compiler tests</h4> <p> -The <code>build-testing-drivers</code> target builds a single jar with +The <a href="build.xml">build.xml</a> <code>build-harness-jar</code> +target builds a single jar with the AspectJ binaries and a test harness as the main class. It reads test suite files like <a href="../tests/ajcTests.xml">../tests/ajcTests.xml</a>; @@ -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 <a href="build-properties.xml">build-properties.xml</a>, which +in <a href="local.properties">local.properties</a>, which will update <code>org.aspectj.bridge.Version</code>. Do not run using the <code>build.config</code> value <code>useEclipseCompiles</code>, @@ -400,8 +428,7 @@ based on the release code. E.g., from the command line: </pre> <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), +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 <a name="antInvariants"/> <h3>New modules, Java 5, and Ant-only build problems</h3> <p> - As described more fully in - <a href="readme-build-module.html">readme-build-module.html</a>, + To reiterate (and as described more fully in + <a href="readme-build-module.html">readme-build-module.html</a>), 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 @@ <!-- ========================================================================= --> -<!-- Copyright (c) 2003 Contributors. --> +<!-- Copyright (c) 2003-2005 Contributors. --> <!-- All rights reserved. --> <!-- This program and the accompanying materials are made available --> -<!-- under the terms of the Common Public License v1.0 --> +<!-- under the terms of the Eclipse Public License v1.0 --> <!-- which accompanies this distribution and is available at --> -<!-- http://www.eclipse.org/legal/cpl-v10.html --> +<!-- http://www.eclipse.org/legal/epl-v10.html --> <!-- --> <!-- Contributors: --> <!-- Wes Isberg initial implementation --> <!-- ========================================================================= --> -<project name="build" default="all" basedir="."> - -<!-- ========================================================================= --> - - <target name="info" depends="init-variables"> - <echo> - 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 +<project name="build" default="all" basedir=".."> - -- 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 + <property name="aspectj.modules.dir" location="${basedir}/.."/> - - test only sources in local tree - - cd build/release - ant test-sources $${sp} + <import file="${aspectj.modules.dir}/build/build-properties.xml"/> + <import file="${aspectj.modules.dir}/build/release/release-tests.xml"/> - - 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} - -</echo> + <target name="info"> + <echo message="see build.readme.txt and readme.txt"/> </target> - <target name="init-variables" > - - <!-- re-enable when tested --> - <property name="skip.cvs" value="true"/> + <target name="init" depends="init-release-properties"> + </target> + + <target name="init-release-properties" depends="init-properties,init-directories"> + <property name="do.cvs" value="false"/> + <property name="run.${min.vm}" value="true"/> + <property name="run.14" value="false"/> + <property name="run.${max.vm}" value="true"/> <property name="aspectj.build.props" value=""/> - <property name="version" value="DEVELOPMENT"/> <property name="ant.verbose" value=""/> <property name="failonerror" value="true"/> <property name="harness.jvmline" value="-Dignore=me"/> <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"/> + location="${aspectj.modules.dir}/../.."/> <property name="aspectj.build.release.dir" - location="${aspectj.build.dir}/release"/> - <property name="aspectj.tests.dir" - location="${aspectj.modules.dir}/tests"/> + location="${aspectj.modules.build.dir}/release"/> <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.install.dir" - location="${aj.build.dir}/install"/> - <property name="aj.build.log.dir" + <property name="aj.logs.dir" location="${aj.build.dir}/logs"/> - <!-- todo: clean-up file created as side-effect --> <property name="java.home.file" - location="${aspectj.build.release.dir}/javahome.props.tmp"/> - - <property name="aspectj.jar" - location="${aj.build.dist.dir}/aspectj-${version}.jar"/> - - <property name="harness.jar" - location="${aj.build.jar.dir}/testing-drivers-all.jar"/> + location="${aj.build.dir}/javahome.props.tmp"/> <property name="java13.command" location="${java13.home}/bin/java"/> @@ -161,542 +60,87 @@ <property name="java15.command" location="${java15.home}/bin/java"/> - <mkdir dir="${aj.build.log.dir}"/> + <mkdir dir="${aj.logs.dir}"/> - <path id="lib.classpath"> - <pathelement location="${aspectj.lib.dir}/eclipse2.0/jdtDepends.jar" /> - <pathelement location="${aspectj.lib.dir}/bcel/bcel.jar" /> - <pathelement location="${aspectj.lib.dir}/jdiff/jdiff.jar" /> - <pathelement location="${aspectj.lib.dir}/commons/commons.jar" /> - <pathelement location="${aspectj.lib.dir}/ant/lib/ant.jar" /> - <pathelement location="${aspectj.lib.dir}/ant/lib/xml-apis.jar" /> - <pathelement location="${aspectj.lib.dir}/ant/lib/xercesImpl.jar" /> - <pathelement location="${aspectj.lib.dir}/junit/junit.jar" /> - <pathelement location="${aspectj.modules.dir}/org.eclipse.jdt.core/jdtcore-for-aspectj.jar" /> - </path> - - <!-- requires normal build, i.e., with test classes --> - <path id="jar.classpath"> - <pathelement location="${aj.build.jar.dir}/ajde.jar" /> - <pathelement location="${aj.build.jar.dir}/ajbrowser.jar" /> - <pathelement location="${aj.build.jar.dir}/ajdoc.jar" /> - <pathelement location="${aj.build.jar.dir}/asm.jar" /> - <pathelement location="${aj.build.jar.dir}/bridge.jar" /> - <pathelement location="${aj.build.jar.dir}/build.jar" /> - <pathelement location="${aj.build.jar.dir}/org.aspectj.ajdt.core.jar" /> - <pathelement location="${aj.build.jar.dir}/runtime.jar" /> - <pathelement location="${aj.build.jar.dir}/taskdefs.jar" /> - <pathelement location="${aj.build.jar.dir}/testing.jar" /> - <pathelement location="${aj.build.jar.dir}/testing-client.jar" /> - <pathelement location="${aj.build.jar.dir}/testing-drivers.jar" /> - <pathelement location="${aj.build.jar.dir}/testing-util.jar" /> - <pathelement location="${aj.build.jar.dir}/util.jar" /> - <pathelement location="${aj.build.jar.dir}/weaver.jar" /> - <path refid="lib.classpath"/> - </path> - - <available property="jar.path.available" - file="${aj.build.jar.dir}/ajbrowser.jar" type="file"/> - </target> - <target name="init-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="init-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 in ${aj.build.install.dir}"/> - </target> - - <target name="init-harness-available" depends="init-variables" - unless="harness.available"> - <available property="harness.available" - classname="org.aspectj.testing.drivers.Harness" - classpath="${harness.jar}"/> - <fail unless="harness.available" - message="harness not found - first build-tests"/> + <target name="all" depends="init"> + <clean-dir dir="${aj.build.dir}"/> + <build-aspectj vm="${min.vm}" target="all"/> + <clean-dir dir="${aj.build.dir}"/> + <antcall target="build-install"/> + <antcall target="post-build"/> </target> - - <target name="init-junitTests-available" depends="init-variables" - unless="tests.available"> - <available property="tests.available" - classname="TestingDriversModuleTests"> - <classpath> - <path refid="jar.classpath"/> - <path location="${aspectj.lib.dir}/junit/junit.jar"/> - </classpath> - </available> - <fail unless="tests.available" - message="test classes not found - first build-tests"/> - </target> - -<!-- ========================================================================= --> - - <target name="all"> + + <target name="post-build" depends="init"> <antcall target="install"/> - <antcall target="test"/> - </target> - - <target name="build" unless="skip.build" - description="build an AspectJ release and tests"> - <antcall target="build-release"> - <param name="do.ant.vm" value="15"/> - </antcall> - <antcall target="build-tests"> - <param name="do.ant.vm" value="15"/> - </antcall> - </target> - - <target name="build-13-check" unless="skip.build" - description="build an AspectJ release and tests using 1.3"> - <antcall target="build-release"> - <param name="do.ant.vm" value="13"/> - </antcall> - <antcall target="build-tests"> - <param name="do.ant.vm" value="13"/> - </antcall> - </target> - - <target name="test" unless="skip.test" - description="test AspectJ source and distribution"> - <antcall target="test-sources"/> - <antcall target="test-install"/> - </target> - - <target name="install" depends="build,init-variables" - description="install AspectJ distribution using current java"> - <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="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="${aspectj.workspace}" - package="org.aspectj/modules" - quiet="on" - failonerror="on" - command="checkout -P" /> - </target> - - <target name="build-release" depends="init-variables,create-tree" - description="build an AspectJ release under Java ${do.ant.vm} (param)" - unless="skip.build.release"> - - <!-- release build destroys test build, but not vice-versa --> - <antcall target="do-aspectj-build"> - <param name="do.ant.target" value="clean"/> - <param name="do.ant.props" value=""/> - <param name="do.ant.vm" value="${do.ant.vm}"/> - </antcall> - <antcall target="do-aspectj-build"> - <param name="do.ant.target" value="aspectj"/> - <param name="do.ant.props" value=""/> - <param name="do.ant.vm" value="${do.ant.vm}"/> - </antcall> - - <antcall target="do-aspectj-build"> - <param name="do.ant.target" value="eclipse.plugins"/> - <param name="do.ant.props" value=""/> - <param name="do.ant.vm" value="${do.ant.vm}"/> - </antcall> - </target> - - <target name="build-tests" depends="init-variables,create-tree" - description="build AspectJ tests under Java 13" - unless="skip.build.tests"> - - <antcall target="do-aspectj-build"> - <param name="do.ant.target" value="clean-jars"/> - <param name="do.ant.props" value=""/> - <param name="do.ant.vm" value="${do.ant.vm}"/> - </antcall> - <antcall target="do-aspectj-build"> - <param name="do.ant.target" value="build-testing-jars"/> - <param name="do.ant.props" value="-Dtrim.testing.default=false"/> - <param name="do.ant.vm" value="${do.ant.vm}"/> - </antcall> - </target> - - <!-- ==== install tests ==== --> - <target name="test-install"> - <antcall target="do-13-target"> - <param name="do.target" value="do-test-install-sequence"/> - </antcall> - <antcall target="do-14-target"> - <param name="do.target" value="do-test-install-sequence"/> - </antcall> - <antcall target="do-15-target"> - <param name="do.target" value="do-test-install-sequence"/> - </antcall> - <antcall target="test-doc-links"/> - <echo message="TODO: Run test-examples-11 manually - AWT not exiting?"/> - <!-- antcall target="test-examples-11"/ --> - </target> - - <target name="do-test-install-sequence" - depends="init-variables,init-aspectj-available"> - <antcall target="test-build-examples"/> - <antcall target="test-ajc-aspectj"/> + <antcall target="JUnit-tests"/> + <build-aspectj vm="${max.vm}" target="junitreport"/> + <antcall target="build-tests"/> + <antcall target="product-tests"/> + <antcall target="fail-if-failures"/> </target> - <target name="test-build-examples" - depends="init-variables,init-aspectj-available"> - <antcall target="do-build-installed-example"> - <param name="example.target" value="bean"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="intro"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="intro-clone"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="intro-compare"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="intro-hash"/> - </antcall> - <!-- observer uses GUI --> - <antcall target="do-build-installed-example"> - <param name="example.target" value="telecom"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="telecom-billing"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="telecom-timing"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tjp"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tracing-none"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tracing-1"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tracing-2"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tracing-3"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="tracing-bc"/> - </antcall> - <antcall target="do-build-installed-example"> - <param name="example.target" value="nonGui"/> - </antcall> - <echo message="TODO: setup and run compiler adapter example"/> + <target name="build-install" depends="init-release-properties" + unless="build-install.done" + description="build aspectj using Java max.vm=${max.vm}"> + <build-aspectj vm="${max.vm}" target="all"/> + <property name="build-install.done" value="true"/> </target> - - <target name="test-ajc-aspectj" - depends="init-variables,init-aspectj-available,init-sources-available"> - <antcall target="do-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}/test-ajc-aspectj"/> - </antcall> - <delete quiet="on" dir="${aspectj.modules.dir}/tests/product/build-aspectj/output"/> - </target> - - <!-- ==== source tests ==== --> - <target name="test-sources"> - <antcall target="do-13-target"> - <param name="do.target" value="do-test-sources-sequence"/> - </antcall> - <antcall target="do-14-target"> - <param name="do.target" value="do-test-sources-sequence"/> - </antcall> - <antcall target="do-15-target"> - <param name="do.target" value="do-test-sources-sequence"/> - </antcall> - </target> - - <target name="do-test-sources-sequence"> - <antcall target="test-harness-tests"/> - <antcall target="test-junit-modules"/> - </target> - - <target name="test-junit-modules" - depends="init-variables,init-junitTests-available"> - <antcall target="do-run-ant"> - <param name="run.ant.file" value="build.xml"/> - <param name="ant.target" value="junit-tests"/> - <param name="ant.dir" - location="${aspectj.modules.dir}/build"/> - <param name="ant.output" - location="${aj.build.log.dir}/test-junitModules"/> - </antcall> - - <property file="${java.home.file}"/> - <property name="tjm.copy.todir" - location="${aj.build.log.dir}/junitXmlOutput-${build.java.version}"/> - <mkdir dir="${tjm.copy.todir}"/> - <delete quiet="on"> - <fileset dir="${tjm.copy.todir}" includes="**/*"/> - </delete> - <property name="xmlSrcDir" - location="${aspectj.tests.dir}/bin/junitXmlOutput"/> - <move todir="${tjm.copy.todir}" > - <fileset dir="${xmlSrcDir}" includes="**/*"/> - </move> + + <target name="build-tests" depends="init-release-properties" + unless="build-test.done" + description="build aspectj tests using Java max.vm=${max.vm}"> + <antcall target="clean-jars"/> + <build-aspectj vm="${max.vm}" target="build-testing-jars"/> + <property name="build-test.done" value="true"/> </target> - <target name="test-junit" - depends="init-variables"> - - <antcall target="do-run-ant"> - <param name="run.ant.file" value="newbuild.xml"/> - <param name="ant.target" value="test"/> - <param name="ant.dir" - location="${aspectj.modules.dir}/run-all-junit-tests"/> - <param name="ant.output" - location="${aj.build.log.dir}/test-run-all-junit-tests"/> - </antcall> - <property file="${java.home.file}"/> - <property name="tjm.copy.todir" - location="${aj.build.log.dir}/test-run-all-junit-tests-${build.java.version}"/> - <mkdir dir="${tjm.copy.todir}"/> - <delete quiet="on"> - <fileset dir="${tjm.copy.todir}" includes="**/*"/> - </delete> - <property name="xmlSrcDir" - location="${aj.build.dir}/junit/run-all-junit-tests"/> - <move todir="${tjm.copy.todir}" > - <fileset dir="${xmlSrcDir}" includes="**/*"/> - </move> + <target name="clean-install" depends="init-release-properties"> + <clean-dir dir="${aj.install.dir}"/> </target> - <target name="test-doc-links" - depends="init-aspectj-available,init-harness-available" - description="run link check against distribution"> - <antcall target="do-java13-setup"/> - <property file="${java.home.file}"/> - <fail unless="build.java.home" - message="failed to read ${build.java.home} from ${java.home.file}"/> - - <property name="doclink.output.file" - location="${aj.build.log.dir}/test-doc-links"/> - <property name="doclink.start.file" - location="${aj.build.install.dir}/README-AspectJ.html"/> - <echo> - 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?) - -</echo> - <java - classname="org.aspectj.testing.util.LinkCheck" - fork="true" - dir="${aj.build.install.dir}" - classpath="${harness.jar}" - jvm="${build.java.command}" - output="${doclink.output.file}-out.txt"> - <arg value="${doclink.start.file}"/> - <arg value="-printInfo"/> - <arg value="-log"/> - <arg value="${doclink.output.file}-messages.txt"/> - <sysproperty key="http.proxyHost" value="${proxy.host}" /> - <sysproperty key="http.proxyPort" value="${proxy.port}" /> - </java> - </target> - - <target name="test-examples-11" depends="init-harness-available" - description="run examples under JDK 1.1"> - <property name="j11.home" - location="${java11.home}"/> - <property name="java11.command" - location="${java11.home}/bin/java"/> - <property name="java11.classes.zip" - location="${java11.home}/lib/classes.zip"/> - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTestsExamples"/> - <param name="harness.args" value="-1.1"/> - <param name="harness.suffix" value="-run11"/> - <param name="harness.jvmline" - value="-Djavarun.fork=true -Djavarun.java=${java11.command} -Djavarun.java.home=${j11.home} -Djavarun.bootclasspath=${java11.classes.zip}"/> - </antcall> - </target> - <target name="compile-runtime-11" depends="init-variables" - description="compile runtime under 1.1 - fails, but by how much?"> - <mkdir dir="${aj.build.dir}/classes-1.1"/> - <property name="j11.classes" - location="${j11.home}/lib/classes.zip"/> - <javac - compiler="javac1.1" - bootclasspath="${j11.classes}" - source="1.3" - includejavaruntime="no" - includeantruntime="no" - destdir="${aj.build.dir}/classes-1.1" - srcdir="${aspectj.modules.dir}/runtime/src" - target="1.1" - verbose="false" - failonerror="false" - /> - <delete dir="${aj.build.dir}/classes-1.1"/> - </target> - - <target name="test-harness-tests" depends="init-harness-available"> - <!-- we could use harness variants, e.g., "-emacssym-", - but separating runs puts each variant in a different - output file, which makes them easier to analyze. - --> - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcHarnessTests"/> - <param name="harness.args" value="-ajctestSkipKeywords=expect-fail"/> - <param name="harness.suffix" value="-pass"/> - </antcall> - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTestsFailing"/> - <param name="harness.args" value=""/> - <param name="harness.suffix" value=""/> - </antcall> - - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTestsFailing"/> - <param name="harness.args" value="-emacssym"/> - <param name="harness.suffix" value="-emacssym"/> - </antcall> - - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTests"/> - <param name="harness.args" value=""/> - <param name="harness.suffix" value=""/> - </antcall> - - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTests"/> - <param name="harness.args" value="-emacssym"/> - <param name="harness.suffix" value="-emacssym"/> - </antcall> - - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTests"/> - <param name="harness.args" value="-ajctaskCompiler -ajctestSkipKeywords=knownLimitation-ajctaskCompiler"/> - <param name="harness.suffix" value="-ajctaskCompiler"/> - </antcall> - - <!-- examples tested only from command-line, eclipse --> - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTestsExamples"/> - <param name="harness.args" value=""/> - <param name="harness.suffix" value=""/> - </antcall> - - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTestsExamples"/> - <param name="harness.args" value="-ajctaskCompiler"/> - <param name="harness.suffix" value="-ajctaskCompiler"/> - </antcall> - <!-- skip examples -emacssym - avoid littering docs tree --> - - <!-- AJDE compiler hangs when done - unclose swing thread? - <antcall target="do-run-harness"> - <param name="suite.filename" value="ajcTests"/> - <param name="harness.args" value="-ajdeCompiler -ajctestSkipKeywords=knownLimitations-ajdeCompiler"/> - <param name="harness.suffix" value="-ajdeCompiler"/> - </antcall> - --> - </target> - - <!-- ======= do-{...} tasks are called only by other tasks ======== --> - - <target name="do-run-harness" - depends="init-variables,init-harness-available"> - <fail unless="suite.filename" - message="define suite.filename"/> - <fail unless="harness.args" - message="define harness.args"/> - <fail unless="harness.suffix" - message="define harness.suffix"/> - - <property name="drho.default.options" - value="-release -logFail -killTemp"/> - + <target name="install" depends="init-release-properties" + description="install AspectJ distribution using Java min.vm=${min.vm}"> + <antcall target="init-postBuild-properties"/> + <require-available property="aspectj.jar" + path="${aj.dist.dir}/aspectj-${build.version}.jar"/> + <clean-dir dir="${aj.install.dir}"/> + <setup-vm vm="${min.vm}"/> <property file="${java.home.file}"/> - <fail unless="build.java.home" - message="failed to read ${build.java.home} from ${java.home.file}"/> - <fail unless="build.java.version" - message="failed to read ${build.java.version} from ${java.home.file}"/> - - <property name="harness.output.file" - location="${aj.build.log.dir}/test-${suite.filename}${harness.suffix}-${build.java.version}.txt"/> - <echo> - do-run-harness ${suite.filename}.xml - with options ${drho.default.options} ${harness.args} - to ${harness.output.file} -</echo> - <java - fork="true" - dir="${aspectj.tests.dir}" - jar="${harness.jar}" + <fail unless="build.java.command" + message="failed to read ${build.java.command} from ${java.home.file}"/> + <java + fork="true" jvm="${build.java.command}" - maxmemory="250m" - output="${harness.output.file}"> - <jvmarg line="${harness.jvmline}"/> - <arg value="${suite.filename}.xml"/> - <arg line="${drho.default.options} ${harness.args}"/> + jar="${aspectj.jar}" + failonerror="true"> + <arg line="-to ${aj.install.dir}"/> </java> </target> - <target name="do-build-installed-example" depends="init-variables"> - <antcall target="do-run-ant"> - <param name="ant.dir" - location="${aj.build.install.dir}/doc/examples"/> - <param name="run.ant.file" value="build.xml"/> - <param name="ant.target" value="${example.target}"/> - <param name="ant.output" - location="${aj.build.log.dir}/test-example-${example.target}"/> - <param name="ant.properties" value=""/> - <!-- XXX getting OOMemory - permit and investigate --> - <param name="failonerror" value="false"/> - </antcall> - </target> - - <target name="do-aspectj-build" depends="init-variables" - description="build targets in ../build.xml using Java ${do.ant.vm}"> - <fail unless="do.ant.target" message="caller sets do.ant.target"/> - <fail unless="do.ant.props" message="caller sets do.ant.props"/> - <fail unless="do.ant.vm" message="caller sets do.ant.vm"/> - <antcall target="do-java${do.ant.vm}-setup"/> - <antcall target="do-run-ant"> - <param name="ant.dir" location="${aspectj.build.dir}"/> - <param name="run.ant.file" value="build.xml"/> - <param name="ant.target" value="${do.ant.target}"/> - <param name="ant.output" - location="${aj.build.log.dir}/build-${do.ant.target}"/> - <param name="ant.properties" value="${do.ant.props} ${aspectj.build.props}"/> - </antcall> - </target> - - <target name="do-run-ant" depends="init-variables" + <macrodef name="build-aspectj"> + <attribute name="target"/> + <attribute name="vm"/> + <sequential> + <setup-vm vm="@{vm}"/> + <condition property="do.ant.props" value=" "> + <not><isset property="do.ant.props"/></not> + </condition> + + <antcall target="do-run-ant"> + <param name="ant.dir" location="${aspectj.modules.build.dir}"/> + <param name="run.ant.file" value="build.xml"/> + <param name="ant.target" value="@{target}"/> + <param name="ant.output" + location="${aj.logs.dir}/build-@{target}"/> + <param name="ant.properties" value="${do.ant.props} ${aspectj.build.props}"/> + </antcall> + </sequential> + </macrodef> + + <target name="do-run-ant" depends="init-release-properties" description="the ant we use to build"> <!-- we could use normal ant, but we enforce using our ant libraries and the specified java runtime @@ -731,6 +175,7 @@ newenvironment="true" output="${ant.output.file}"> <classpath> + <!-- TODO use lib/ant-launcher.jar only? --> <fileset dir="${aspectj.ant.lib.dir}"> <include name="*.jar"/> </fileset> @@ -746,67 +191,72 @@ <!-- for ajde --> <sysproperty key="aspectjrt.path" - file="${aj.build.install.dir}/lib/aspectjrt.jar"/> - <sysproperty key="test.classpath" - value="jar.classpath"/> + file="${aj.install.dir}/lib/aspectjrt.jar;${aspectj.modules.dir}/lib/test/aspectjrt.jar"/> <!-- for tests/product/build-aspectj/build.xml --> <sysproperty key="ASPECTJ_MODULES" file="${aspectj.modules.dir}"/> <sysproperty key="ASPECTJ_HOME" - file="${aj.build.install.dir}"/> + file="${aj.install.dir}"/> <arg line="-f ${run.ant.file} ${ant.target} ${ant.verbose} ${ant.properties}"/> </java> </target> + + <macrodef name="do-vm-targets"> + <attribute name="target"/> + <sequential> + <do-vm-target target="@{target}" vm="min" /> + <do-vm-target target="@{target}" vm="14" /> + <do-vm-target target="@{target}" vm="max" /> + </sequential> + </macrodef> + <macrodef name="do-vm-target"> + <attribute name="vm"/> + <attribute name="target"/> + <sequential> + <antcall target="do-@{vm}-target"> + <param name="do.target" value="@{target}"/> + </antcall> + </sequential> + </macrodef> + + <target name="do-13-target" if="run.13"> + <setup-vm vm="13"/> + <antcall target="${do.target}"/> + </target> - <target name="do-13-target" unless="run.14.only"> - <antcall target="do-java13-setup"/> + <target name="do-14-target" if="run.14"> + <setup-vm vm="14"/> <antcall target="${do.target}"/> </target> - <target name="do-14-target" unless="run.13.only"> - <antcall target="do-java14-setup"/> + <target name="do-15-target" if="run.15"> + <setup-vm vm="15"/> <antcall target="${do.target}"/> </target> - <target name="do-15-target" unless="run.14.only"> - <antcall target="do-java15-setup"/> + <target name="do-min-target" if="run.${min.vm}"> + <setup-vm vm="${min.vm}"/> <antcall target="${do.target}"/> </target> - <target name="do-java15-setup"> - <antcall target="do-write-javahome-file"> - <param name="build.java.version" value="15"/> - <param name="build.java.home" value="${java15.home}"/> - </antcall> + <target name="do-max-target" if="run.${max.vm}"> + <setup-vm vm="${max.vm}"/> + <antcall target="${do.target}"/> </target> - <target name="do-java14-setup"> - <antcall target="do-write-javahome-file"> - <param name="build.java.version" value="14"/> - <param name="build.java.home" value="${java14.home}"/> - </antcall> - </target> - - <!-- legal do.ant.vm values are 13, 14, 15 per these target names --> - <target name="do-java13-setup"> - <antcall target="do-write-javahome-file"> - <param name="build.java.version" value="13"/> - <param name="build.java.home" value="${java13.home}"/> - </antcall> - </target> - - <target name="do-write-javahome-file" depends="init-variables" - description="save global build.java.[version,command,home]"> - <fail unless="build.java.version"/> - <fail unless="build.java.home"/> - <property name="wjf.bjh" location="${build.java.home}"/> - <property name="wjf.cmd" location="${wjf.bjh}/bin/java"/> - <propertyfile file="${java.home.file}"> - <entry key="build.java.version" value="${build.java.version}"/> - <entry key="build.java.home" value="${wjf.bjh}"/> - <entry key="build.java.command" value="${wjf.cmd}"/> - </propertyfile> - </target> + <macrodef name="setup-vm"> + <attribute name="vm"/> + <sequential> + <property name="wjf.bjh" location="${java@{vm}.home}"/> + <property name="wjf.cmd" location="${wjf.bjh}/bin/java"/> + <delete file="${java.home.file}"/> + <propertyfile file="${java.home.file}"> + <entry key="build.java.version" value="@{vm}"/> + <entry key="build.java.home" value="${wjf.bjh}"/> + <entry key="build.java.command" value="${wjf.cmd}"/> + </propertyfile> + </sequential> + </macrodef> </project>
\ 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 @@ +<!-- ========================================================================= --> +<!-- Copyright (c) 2005 Contributors. --> +<!-- All rights reserved. --> +<!-- This program and the accompanying materials are made available --> +<!-- under the terms of the Eclipse Public License v1.0 --> +<!-- which accompanies this distribution and is available at --> +<!-- http://www.eclipse.org/legal/epl-v10.html --> +<!-- --> +<!-- Contributors: --> +<!-- Wes Isberg initial implementation --> +<!-- ========================================================================= --> +<project name="release-tests" default="product-tests"> + <target name="JUnit-tests" unless="skip.test" + description="run JUnit unit and compiler tests"> + <build-aspectj vm="${max.vm}" target="test-each-module"/> + <build-aspectj vm="${max.vm}" target="clean-jars"/> + <build-aspectj vm="${min.vm}" target="test-each-module"/> + </target> + + <target name="product-tests" unless="skip.test" + description="run product tests"> + <do-vm-targets target="test-build-examples"/> + </target> + + <target name="init-postBuild-properties" depends="init-release-properties"> + <require-available property="aspectj.jar" + path="${aj.dist.dir}/aspectj-${build.version}.jar"/> + + <property name="harness.jar" + location="${aj.jar.dir}/testing-drivers-all.jar"/> + </target> + + <target name="init-sources-available" depends="init-release-properties" + unless="sources.available"> + <available property="sources.available" + file="${aspectj.modules.dir}/build/build.xml"/> + <fail unless="sources.available" message="checkout first"/> + </target> + + <target name="init-aspectj-available" depends="init-release-properties" + unless="aspectj.available"> + <available property="aspectj.available" + file="${aj.install.dir}" type="dir"/> + <fail unless="aspectj.available" + message="install first in ${aj.install.dir}"/> + </target> + + <target name="init-harness-available" depends="init-release-properties" + unless="harness.available"> + <available property="harness.available" + classname="org.aspectj.testing.drivers.Harness" + classpath="${harness.jar}"/> + <fail unless="harness.available" + message="harness not found - first build-tests"/> + </target> + + <target name="test-build-examples" + depends="init-postBuild-properties,init-aspectj-available"> + <run-example name="bean"/> + <run-example name="intro"/> + <run-example name="intro-clone"/> + <run-example name="intro-compare"/> + <run-example name="intro-hash"/> + <run-example name="telecom"/> + <run-example name="telecom-billing"/> + <run-example name="telecom-timing"/> + <run-example name="tjp"/> + <run-example name="tracing-1"/> + <run-example name="tracing-2"/> + <run-example name="tracing-3"/> + <run-example name="tracing-bc"/> + <run-example name="nonGui"/> + <echo message="TODO: setup and run compiler adapter example"/> + </target> + + <target name="do-run-harness" depends="init-postBuild-properties,init-harness-available"> + <fail unless="suite.filename" message="define suite.filename"/> + <fail unless="harness.args" message="define harness.args"/> + <fail unless="harness.suffix" message="define harness.suffix"/> + + <property name="drho.default.options" + value="-release -logFail -killTemp"/> + + <property file="${java.home.file}"/> + <fail unless="build.java.home" + message="failed to read ${build.java.home} from ${java.home.file}"/> + <fail unless="build.java.version" + message="failed to read ${build.java.version} from ${java.home.file}"/> + + <property name="harness.output.file" + location="${aj.logs.dir}/test-${suite.filename}${harness.suffix}-${build.java.version}.txt"/> + <echo> do-run-harness ${suite.filename}.xml with options + ${drho.default.options} ${harness.args} to ${harness.output.file} + </echo> + <java fork="true" dir="${aspectj.modules.dir}/tests" jar="${harness.jar}" + jvm="${build.java.command}" maxmemory="250m" + output="${harness.output.file}"> + <jvmarg line="${harness.jvmline}"/> + <arg value="${suite.filename}.xml"/> + <arg line="${drho.default.options} ${harness.args}"/> + </java> + </target> + + <macrodef name="run-example"> + <attribute name="name"/> + <sequential> + + <antcall target="init"/> + <antcall target="do-run-ant"> + <param name="ant.dir" + location="${aj.install.dir}/doc/examples"/> + <param name="run.ant.file" value="build.xml"/> + <param name="ant.target" value="@{name}"/> + <param name="ant.output" + location="${aj.logs.dir}/test-example-@{name}"/> + <param name="ant.properties" value=""/> + <!-- XXX getting OOMemory - permit and investigate --> + <param name="failonerror" value="false"/> + </antcall> + </sequential> + </macrodef> + + <target name="test-ajc-aspectj" + depends="init-postBuild-properties,init-aspectj-available,init-sources-available"> + <antcall target="do-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.logs.dir}/test-ajc-aspectj"/> + </antcall> + <delete quiet="on" dir="${aspectj.modules.dir}/tests/product/build-aspectj/output"/> + </target> + + <!-- ==== source tests ==== --> + <target name="test-sources"> + <do-vm-targets target="do-test-sources-sequence"/> + </target> + + <target name="do-test-sources-sequence"> + <antcall target="test-harness-tests"/> + <antcall target="test-junit-modules"/> + </target> + + <target name="test-doc-links" + depends="init-aspectj-available,init-harness-available" + description="run link check against distribution"> + <setup-vm vm="13"/> + <property file="${java.home.file}"/> + <fail unless="build.java.home" + message="failed to read ${build.java.home} from ${java.home.file}"/> + + <property name="doclink.output.file" + location="${aj.logs.dir}/test-doc-links"/> + <property name="doclink.start.file" + location="${aj.install.dir}/README-AspectJ.html"/> + <echo> + 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?) + +</echo> + <java + classname="org.aspectj.testing.util.LinkCheck" + fork="true" + dir="${aj.install.dir}" + classpath="${harness.jar}" + jvm="${build.java.command}" + output="${doclink.output.file}-out.txt"> + <arg value="${doclink.start.file}"/> + <arg value="-printInfo"/> + <arg value="-log"/> + <arg value="${doclink.output.file}-messages.txt"/> + <sysproperty key="http.proxyHost" value="${proxy.host}" /> + <sysproperty key="http.proxyPort" value="${proxy.port}" /> + </java> + </target> + + <target name="test-examples-11" depends="init-harness-available" + description="run examples under JDK 1.1"> + <property name="j11.home" + location="${java11.home}"/> + <property name="java11.command" + location="${java11.home}/bin/java"/> + <property name="java11.classes.zip" + location="${java11.home}/lib/classes.zip"/> + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTestsExamples"/> + <param name="harness.args" value="-1.1"/> + <param name="harness.suffix" value="-run11"/> + <param name="harness.jvmline" + value="-Djavarun.fork=true -Djavarun.java=${java11.command} -Djavarun.java.home=${j11.home} -Djavarun.bootclasspath=${java11.classes.zip}"/> + </antcall> + </target> + + <target name="compile-runtime-11" depends="init-postBuild-properties" + description="compile runtime under 1.1 - fails, but by how much?"> + <mkdir dir="${aj.build.dir}/classes-1.1"/> + <property name="j11.classes" + location="${j11.home}/lib/classes.zip"/> + <javac + compiler="javac1.1" + bootclasspath="${j11.classes}" + source="1.3" + includejavaruntime="no" + includeantruntime="no" + destdir="${aj.build.dir}/classes-1.1" + srcdir="${aspectj.modules.dir}/runtime/src" + target="1.1" + verbose="false" + failonerror="false" + /> + <delete dir="${aj.build.dir}/classes-1.1"/> + </target> + + <target name="test-harness-tests" depends="build-tests"> + <!-- we could use harness variants, e.g., "-emacssym-", + but separating runs puts each variant in a different + output file, which makes them easier to analyze. + --> + <antcall target="init-harness-available"/> + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcHarnessTests"/> + <param name="harness.args" value="-ajctestSkipKeywords=expect-fail"/> + <param name="harness.suffix" value="-pass"/> + </antcall> + + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTests"/> + <param name="harness.args" value=""/> + <param name="harness.suffix" value=""/> + </antcall> + + <!-- + skip variants for now + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTests"/> + <param name="harness.args" value="-emacssym"/> + <param name="harness.suffix" value="-emacssym"/> + </antcall> + + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTests"/> + <param name="harness.args" value="-ajctaskCompiler -ajctestSkipKeywords=knownLimitation-ajctaskCompiler"/> + <param name="harness.suffix" value="-ajctaskCompiler"/> + </antcall> + + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTestsExamples"/> + <param name="harness.args" value=""/> + <param name="harness.suffix" value=""/> + </antcall> + + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTestsExamples"/> + <param name="harness.args" value="-ajctaskCompiler"/> + <param name="harness.suffix" value="-ajctaskCompiler"/> + </antcall> + --> + + <!-- AJDE compiler hangs when done - unclose swing thread? + <antcall target="do-run-harness"> + <param name="suite.filename" value="ajcTests"/> + <param name="harness.args" value="-ajdeCompiler -ajctestSkipKeywords=knownLimitations-ajdeCompiler"/> + <param name="harness.suffix" value="-ajdeCompiler"/> + </antcall> + --> + </target> + +</project>
\ 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 @@ +<!-- ========================================================================= --> +<!-- Copyright (c) 2005 Contributors --> +<!-- All rights reserved. --> +<!-- This program and the accompanying materials are made available --> +<!-- under the terms of the Eclipse Public License v1.0 --> +<!-- which accompanies this distribution and is available at --> +<!-- http://www.eclipse.org/legal/epl-v10.html --> +<!-- --> +<!-- Contributors: (See CVS checkin's) --> +<!-- Wes Isberg initial implementation --> +<!-- ========================================================================= --> + +<project name="test-build-script" default="all" basedir="."> + + <property name="modules.dir" location="${basedir}/.."/> + + <import file="${modules.dir}/build/build-properties.xml"/> + + <target name="all" depends="failures"/> + + <target name="failures" depends="init-properties"> + <delete file="${aj.failure.file}"/> + <echo message="-> no false negative (no file)"/> + <antcall target="fail-if-failures"/> + + <touch file="${aj.failure.file}"/> + <echo message="-> no false negative (empty file)"/> + <antcall target="fail-if-failures"/> + + <echo message="-> no false negative (unset Property)"/> + <report-if-failed text="not error text" property="unsetProperty"/> + <antcall target="fail-if-failures"/> + + <echo message="-> true negative (set Property)"/> + <property name="setProperty" value="."/> + <report-if-failed text="error text" property="setProperty"/> + <antcall target="fail-if-failures"/> + + <loadfile property="emit" srcfile="${aj.failure.file}"/> + <echo message="-> file contents: ${emit}"/> + </target> +</project>
\ No newline at end of file |