diff options
author | wisberg <wisberg> | 2003-04-09 14:16:26 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2003-04-09 14:16:26 +0000 |
commit | 41100015d21b2c236a30544464f86e1c97cecbc4 (patch) | |
tree | d99152fdb6f6385c3c4a9ccdb5cb4375b8bc64bb /docs/dist/doc/examples/build.xml | |
parent | 6b4289dbbce933d8395f7519d41164ecee267936 (diff) | |
download | aspectj-41100015d21b2c236a30544464f86e1c97cecbc4.tar.gz aspectj-41100015d21b2c236a30544464f86e1c97cecbc4.zip |
added compiler adapter example
Diffstat (limited to 'docs/dist/doc/examples/build.xml')
-rw-r--r-- | docs/dist/doc/examples/build.xml | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/docs/dist/doc/examples/build.xml b/docs/dist/doc/examples/build.xml index bf38ece5b..b0ea98290 100644 --- a/docs/dist/doc/examples/build.xml +++ b/docs/dist/doc/examples/build.xml @@ -57,6 +57,10 @@ <target name="init.variables" description="init variables"> + + <!-- build.compiler value to pick up our CompilerAdapter for javac --> + <property name="ajc.adapter" + value="org.aspectj.tools.ant.taskdefs.Ajc11CompilerAdapter"/> <!-- required directories - run from examples or predefine --> <property name="example.dir" @@ -93,13 +97,15 @@ <target name="init.taskdefs" depends="init.variables, aspectjtools.jar.available, - aspectjrt.jar.available"> + aspectjrt.jar.available" + unless="taskdefs.init"> <!-- sets name of new task to iajc, old task to ajc --> <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> <classpath> <pathelement path="${aspectjtools.jar}"/> </classpath> </taskdef> + <property name="taskdefs.init" value="true"/> </target> <!-- targets to fail unless required libraries available --> @@ -288,6 +294,40 @@ </target> <!-- ============================================================= --> + <!-- do tracing example using compiler adapter --> + <!-- ============================================================= --> + <target name="tracing-adapter" depends="init" + description="tracing example compiled via javac task"> + <antcall target="clean" /> + <!-- to fork, set adapter.fork=true + and put aspectjtools.jar on ant classpath --> + <javac destdir="${classes.dir}" + fork="${adapter.fork}"> + <src path="${example.dir}"/> + <include name="tracing/*.java"/> + + <!-- compilerarg's ignored unless using our compiler adapter --> + <compilerarg compiler="${ajc.adapter}" + line="-verbose -Xlint -proceedOnError"/> + <!-- use separate values if a path might have spaces --> + <compilerarg compiler="${ajc.adapter}" + value="-classpath"/> + <compilerarg compiler="${ajc.adapter}" + value="${aspectjrt.jar}"/> + <compilerarg compiler="${ajc.adapter}" + path="${example.dir}/tracing/version3/Trace.java"/> + </javac> + </target> + + <target name="tracing-adapter-ajc" depends="init" + description="tracing example compiled using ajc via compiler adapter"> + <!-- aspectjtools.jar must be on system/ant classpath --> + <antcall target="tracing-adapter"> + <param name="build.compiler" value="${ajc.adapter}"/> + </antcall> + </target> + + <!-- ============================================================= --> <!-- do tracing example with 1.1 bytecode weaving (binary aspects) --> <!-- ============================================================= --> <target name="tracing-bc" depends="init" |