]> source.dussan.org Git - aspectj.git/commitdiff
updated with tests, etc. Not working yet:
authorwisberg <wisberg>
Thu, 8 May 2003 08:05:01 +0000 (08:05 +0000)
committerwisberg <wisberg>
Thu, 8 May 2003 08:05:01 +0000 (08:05 +0000)
- junitModules.xml needs better setup with testable jars
- cvs unvalidated
- ajcTests unvalidated - see also ../build.xml script

build/release/build.xml

index 9a201be944ccc1d3c309a4d4ee054aa25f5c83a4..ed7bbc4a7ea86564a0ceb9eb4774f2ad9b498916 100644 (file)
@@ -1,6 +1,6 @@
 
 <!-- ========================================================================= -->
-<!-- Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).        -->
+<!-- Copyright (c) 2003 Contributors.                                          -->
 <!-- All rights reserved.                                                      -->
 <!-- This program and the accompanying materials are made available            -->
 <!-- under the terms of the Common Public License v1.0                         -->
@@ -8,33 +8,34 @@
 <!-- http://www.eclipse.org/legal/cpl-v10.html                                 -->
 <!--                                                                           -->
 <!-- Contributors:                                                             -->
-<!--     Xerox/PARC     initial implementation                                 -->
+<!--     Wes Isberg     initial implementation                                 -->
+<!-- ========================================================================= -->
+
+<project name="build" default="test" basedir=".">
+               
 <!-- ========================================================================= -->
 
-<!DOCTYPE project [
-<!ENTITY build-properties SYSTEM "file:build-properties.xml">
-]>
-<project name="build" default="all" basedir=".">
-       
        <target name="info">
        <echo>
   This downloads and build the AspectJ source tree.
   
   Targets of note:
 
-    build-release          checkout and build AspectJ
+    install                checkout, build, and install AspectJ
+    test (default)         test AspectJ sources and installation
   
   Properties of note:
 
+     skip.cvs              no CVS checkout (done already)
+     skip.build            no build (done already)
+
      version               set if not DEVELOPMENT
-     do.not.create.tree    no CVS checkout
      aspectj.modules.dir   define this to reuse existing
      
        </echo>
        </target>
        
-       <target name="init-variables"
-               unless="init.variables.done">
+       <target name="init-variables">
                
                <property name="version" value="DEVELOPMENT"/>
                <property name="ant.verbose" value=""/>
@@ -61,6 +62,8 @@
                        location="${aj.build.dir}/jars"/>
                <property name="aj.build.install.dir"
                        location="${aj.build.dir}/install"/>
+               <property name="aj.build.log.dir"
+                       location="${aj.build.dir}/logs"/>
 
                <property name="aspectj.jar"
                        location="${aj.build.dist.dir}/aspectj-${version}.jar"/>
                <property name="java.command"
                        location="${java.home}/bin/java"/>
                
-               <path id="ant.classpath">
-                       <fileset dir="${aspectj.ant.lib.dir}">
-                               <include name="*.jar"/>
-                       </fileset>
-                       <pathelement path="${java.home}/lib/tools.jar"/>
-                       <pathelement path="${java.home}/../lib/tools.jar"/>
-               </path>
-               <!-- property name="init.variables.done" value="done"/ -->
+               <mkdir dir="${aj.build.log.dir}"/>
        </target>
        
-       <target name="all" depends="test-aspectj-install"/>
-       
-       <target name="test-aspectj-install" depends="install-aspectj">
-               <!-- run examples non-gui, etc. -->
+       <target name="sources-available" depends="init-variables"
+               unless="sources.available">
+               <available property="sources.available"
+                       file="${aspectj.modules.dir}/build/build.xml"/>
+               <fail unless="sources.available" message="checkout first"/>
+       </target>
+
+       <target name="aspectj-available" depends="init-variables"
+               unless="aspectj.available">
+               <available property="aspectj.available"
+                       file="${aj.build.install.dir}" type="dir"/>
+               <fail unless="aspectj.available" message="install first"/>
        </target>
 
-       <target name="build-release" depends="init-variables,create-tree"
-               description="build an AspectJ release">
+<!-- ========================================================================= -->
+
+       <target name="install" depends="build,init-variables"
+               description="create an AspectJ source tree">
+               <fail unless="aspectj.jar" message="define aspectj.jar"/>
+               <fail unless="aj.build.install.dir" message="define aj.build.install.dir"/>
+               <mkdir dir="${aj.build.install.dir}"/>
+               <delete dir="${aj.build.install.dir}"/>
+               <mkdir dir="${aj.build.install.dir}"/>
+               <java fork="true" jar="${aspectj.jar}" failonerror="true">
+                       <arg line="-to ${aj.build.install.dir}"/>
+               </java>
+       </target>
+
+       <target name="build" depends="init-variables,create-tree"
+               description="build an AspectJ release"
+               unless="skip.build">
                 <antcall target="run-ant">
+                       <param name="ant.dir"   location="${aspectj.build.dir}"/>
+                       <param name="run.ant.file" value="build.xml"/>
                        <param name="ant.target" value="clean"/>
+                       <param name="ant.output" 
+                               location="${aj.build.log.dir}/build-clean.txt"/>
                 </antcall>
                 <antcall target="run-ant">
+                       <param name="ant.dir" location="${aspectj.build.dir}"/>
+                       <param name="run.ant.file" value="build.xml"/>
                        <param name="ant.target" value="aspectj"/>
+                       <param name="ant.output" 
+                               location="${aj.build.log.dir}/build-aspectj.txt"/>
                 </antcall>
        </target>
-
        <target name="create-tree" depends="init-variables"
-               unless="do.not.create.tree"
+               unless="skip.cvs"
                description="create an AspectJ source tree">
-               <fail message="testing now"/>
+               <fail message="testing now - remove when validated"/>
                <mkdir dir="${aspectj.workspace}"/>
                <delete dir="${aspectj.workspace}"/>
                <mkdir dir="${aspectj.workspace}"/>
                   failonerror="on" 
                       command="checkout -P" />
        </target>
+       
+<!-- ========================================================================= -->
 
-       <target name="install-aspectj" depends="build-release,init-variables"
-               description="create an AspectJ source tree">
-               <fail unless="aspectj.jar" message="define aspectj.jar"/>
-               <fail unless="aj.build.install.dir" message="define aj.build.install.dir"/>
-               <mkdir dir="${aj.build.install.dir}"/>
-               <delete dir="${aj.build.install.dir}"/>
-               <mkdir dir="${aj.build.install.dir}"/>
-               <java fork="true" jar="${aspectj.jar}" failonerror="true">
-                       <arg line="-to ${aj.build.install.dir}"/>
+       <target name="test" 
+               depends="init-variables,aspectj-available">
+               <!-- antcall target="build-examples"/ -->
+               <antcall target="junit-module-tests"/>
+               <antcall target="run-harness-tests"/>
+       </target>
+       
+       <target name="junit-module-tests" 
+               depends="init-variables,aspectj-available">
+               <echo message="need to build all with -Dtrim.testing.default=false"/>
+                <antcall target="run-ant">
+                       <param name="run.ant.file" value="junitModules.xml"/>
+                       <param name="ant.target" value=""/>
+                       <param name="ant.dir" 
+                               location="${aspectj.modules.dir}/tests"/>
+                       <param name="ant.output" 
+                               location="${aj.build.log.dir}/build-junitModules.txt"/>
+                </antcall>
+       </target>
+
+       <target name="build-examples" 
+               depends="init-variables,aspectj-available">
+               <antcall target="build-one-example">
+                       <param name="example.target" value="nonGui"/>
+               </antcall>
+               <antcall target="build-one-example">
+                       <param name="example.target" value="tracing-bc"/>
+               </antcall>
+               <echo message="Also setup and run compiler adapater example"/>
+       </target>
+
+       <target name="build-one-example" depends="init-variables">
+               <ant dir="${aj.build.install.dir}/doc/examples"
+                       inheritAll="false"
+                       target="${example.target}" 
+                       output="${aj.build.log.dir}/example-${example.target}.txt"
+                       />
+       </target>
+
+       <target name="compile-aspectj-using-aspectj" 
+               depends="init-variables,sources-available">
+               <antcall target="run-ant">
+                       <param name="ant.dir" 
+                               location="${aspectj.modules.dir}/tests/product/build-aspectj"/>
+                       <param name="run.ant.file" value="build.xml"/>
+                       <param name="ant.target" value=""/>
+                       <param name="ant.output" 
+                               location="${aj.build.log.dir}/build-aspectj-using-aspectj.txt"/>
+               </antcall>
+       </target>
+       
+       <target name="run-harness-tests" depends="harness-available">
+               <antcall target="run-harness-once">
+                       <param name="suite.filename" value="ajcTests.xml"/>
+                       <param name="emacssym" value=""/>
+               </antcall>
+
+               <antcall target="run-harness-once">
+                       <param name="suite.filename" value="ajcTests.xml"/>
+                       <param name="emacssym" value="-emacssym"/>
+               </antcall>
+       </target>
+
+       <target name="run-harness-once" 
+               depends="init-variables">
+               <fail unless="suite.filename" 
+                    message="define suite.filename"/>
+               <available property="harness.available"
+                       file="${harness.jar}"/>
+               <fail unless="harness.available" message="build harness first"/>
+               <java 
+                       dir="${aspectj.modules.dir}/tests"
+                       jar="${harness.jar}" 
+                       maxmemory="250m"
+                       output="${aj.build.log.dir}/${suite.filename}${emacssym}.txt">
+                       <arg value="${suite.filename}.xml"/>
+                       <arg line="-killTemp -release -logFail ${emacssym}"/>                   
                </java>
        </target>
 
-       <target name="run-ant" depends="init-variables">
+       <target name="harness-available" depends="init-variables">
+               <antcall target="run-ant">
+                       <param name="ant.dir" location="${aspectj.build.dir}"/>
+                       <param name="run.ant.file" value="build.xml"/>
+                       <param name="ant.target" value="build-testing-drivers"/>
+                       <param name="ant.output" 
+                               location="${aj.build.log.dir}/build-testing-drivers.txt"/>
+               </antcall>
+       </target>
+
+       <target name="run-ant" depends="init-variables"
+        description="the ant we use to build">
                <!-- we could use normal ant, but we enforce using ours
                <ant dir="${aspectj.build.dir}" 
                        target="clean"
                <fail unless="ant.target" message="define ant.target"/>
                <java 
                        fork="true"
-                       dir="${aspectj.build.dir}"
+                       dir="${ant.dir}"
                        jvm="${java.command}"
                        classname="org.apache.tools.ant.Main"
                        maxmemory="350m"
                        failonerror="true"
                        newenvironment="true"
-                       classpathref="ant.classpath"
-                       >
+                       output="${ant.output}">
+                       <classpath>
+                               <fileset dir="${aspectj.ant.lib.dir}">
+                                       <include name="*.jar"/>
+                               </fileset>
+                               <pathelement path="${aspectj.lib.dir}/junit/junit.jar"/>
+                               <pathelement path="${java.home}/lib/tools.jar"/>
+                               <pathelement path="${java.home}/../lib/tools.jar"/>
+                       </classpath>
                        <sysproperty key="JAVA_HOME" path="${java.home}"/>
                        <sysproperty key="ANT_HOME" 
                                path="${aspectj.ant.home}"/>
-                       <arg line="-f build.xml ${ant.target} ${ant.verbose}"/>
+
+                       <sysproperty key="aspectjrt.path"
+                               file="${aj.build.install.dir}/lib/aspectjrt.jar"/>
+                       <sysproperty key="test.classpath"
+                               value="jar.classpath"/>
+
+                       <arg line="-f ${run.ant.file} ${ant.target} ${ant.verbose}"/>
                </java>
        </target>
+
 </project>
\ No newline at end of file