瀏覽代碼

more parts of tests for devguide script example

tags/V1_1_0
wisberg 21 年之前
父節點
當前提交
44424b14e6
共有 2 個文件被更改,包括 135 次插入0 次删除
  1. 132
    0
      docs/test/antScriptTest/build.xml
  2. 3
    0
      docs/test/antScriptTest/readme.txt

+ 132
- 0
docs/test/antScriptTest/build.xml 查看文件

@@ -0,0 +1,132 @@
<project default="build-test" basedir=".">

<target name="info">
<echo>
This script verifies that the example build script in the
Ant section of the development environment guide works.
The target "build-test" should be exactly what's copied from
the development environment guide, as rendered.
To setup for a given version of AspectJ, either build the
tools distribution or define the variable aspectj.home.
This should build the two input jars and then run the
test, which builds and runs an application. It should
request incremental input (press "q{enter}" to quit)
and emit the text:

[java] called Util.utility("persistMe shouting!")
[java] set persistMe to PERSISTME SHOUTING!

Use the "clean" target to remove generated files.
When running from eclipse, set fork.iajc="true" and
change build-test iajc call to avoid incremental mode.
</echo>
</target>
<target name="init">
<property name="fork.iajc"
value="false"/>
<property name="home.dir"
location="${basedir}"/>
<property name="aspectj.modules.dir"
location="../../.."/>
<property name="aspectj.home"
location="${aspectj.modules.dir}/aj-build/dist/tools"/>

<available property="aspectj.home.available"
file="${aspectj.home}/lib/aspectjtools.jar"/>

<available property="aspectjtools.jar.available"
file="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
<available property="aspectjrt.jar.available"
file="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>

<available property="persist.jar.available"
file="${home.dir}/ec/int/persist.jar"/>
<available property="module.jar.available"
file="${home.dir}/build/module.jar"/>
</target>
<target name="taskdef" depends="init,local.aspectj.setup">
<taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
<classpath>
<path location="${home.dir}/tools/aspectj/lib/aspectjtools.jar"/>
</classpath>
</taskdef>
</target>

<target name="clean" depends="init">
<delete quiet="on">
<fileset dir="${home.dir}"
includes="ec/int/persist.jar,
build/module.jar,
output/application.jar,
tools/aspectj/lib/aspectj*.jar"/>
</delete>
</target>
<target name="local.aspectj.setup" depends="init"
unless="aspectjtools.jar.available,aspectjrt.jar.available">
<fail unless="aspectj.home.available"
message="define or build aspectj.home: ${aspectj.home}"/>
<mkdir dir="${home.dir}/tools/aspectj/lib/"/>
<copy todir="${home.dir}/tools/aspectj/lib"
filtering="off">
<fileset dir="${aspectj.home}/lib" includes="aspectj*.jar"/>
</copy>
<available property="aspectjtools.jar.available"
file="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
<available property="aspectjrt.jar.available"
file="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
</target>
<target name="setup" depends="init,taskdef,local.aspectj.setup"
unless="module.jar.available,persist.jar.available">
<iajc outJar="${home.dir}/ec/int/persist.jar"
failonerror="true"
fork="${fork.iajc}"
sourceroots="${home.dir}/ec/int/src"
classpath="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
<iajc outJar="${home.dir}/build/module.jar"
failonerror="true"
fork="${fork.iajc}"
sourceroots="${home.dir}/ec/module/src"
classpath="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
</target>
<target name="build-test" depends="init,taskdef,setup"
description="test Ant script from the devguide">
<!-- copy this from the Ant section of the rendered devguide -->
<!-- in eclipse, must run forked and not incremental -->
<iajc outjar="${home.dir}/output/application.jar"
injars="${home.dir}/build/module.jar"
copyInjars="true"
fork="${fork.iajc}"
sourceRootCopyFilter="**/CVS/*,**/*.java"
incremental="false" >
<sourceroots>
<pathelement location="${home.dir}/ec/project/src"/>
<pathelement location="${home.dir}/ec/project/testsrc"/>
</sourceroots>
<aspectpath>
<pathelement location="${home.dir}/ec/int/persist.jar"/>
</aspectpath>
<classpath>
<pathelement location="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
</classpath>
</iajc>
<java classname="org.smart.app.Main">
<classpath>
<pathelement location="${home.dir}/tools/aspectj/lib/aspectjrt.jar"/>
<pathelement location="${home.dir}/ec/int/persist.jar"/>
<pathelement location="${home.dir}/output/application.jar"/>
</classpath>
</java>
</target>

</project>

+ 3
- 0
docs/test/antScriptTest/readme.txt 查看文件

@@ -0,0 +1,3 @@

This tests the Ant script in the devguide.
See build.xml for more information.

Loading…
取消
儲存