1. Download AspectJ from http://www.eclipse.org/aspectj/downloads.php
2. Copy aspectjrt.jar to /depends/jars/aspectj/
3. Copy aspectjtools.jar and aspectjrt.jar to ANT_HOME/lib and if using Eclipse add both of these to your ant runtime configuration (Window > Preferences > Ant > Runtime > Add...)
4. Edit build file to use iajc* instead of javac and include aspect class files (or apply the buildxmlpatch.txt to build.xml in the math module)
5. Write a tracing aspect (or copy the one attached to modules\math\src\main\java\org\apache\harmony\tracing)
6. Re-build the module
7. Make sure to add aspectjrt.jar to the runtime classpath of whatever program you are running.
* - iajc isn't incremental like javac in ant, it will always do a total rebuild. Also if you switch from using iajc back to javac you will need to do a clean before you do a rebuild.
Regards,
Sian
--
Sian January
IBM Java Technology Centre, UK
Index: C:/eclipse32harmony/eclipse/workspace/Harmony/modules/math/build.xml
===================================================================
--- C:/eclipse32harmony/eclipse/workspace/Harmony/modules/math/build.xml
(revision 472874)
+++ C:/eclipse32harmony/eclipse/workspace/Harmony/modules/math/build.xml
(working copy)
@@ -34,6 +34,11 @@
from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
to="\1.java"/>
</present>
+ <present targetdir="${hy.math.src.main.java}">
+ <mapper type="regexp"
+ from="^(.*?)(\$$[^/\\\.]*)?\.class$$"
+ to="\1.aj"/>
+ </present>
</or>
</fileset>
@@ -50,16 +55,20 @@
</delete>
</target>
+ <taskdef
resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties">
+ <classpath>
+ <pathelement path="${aspectjtools.jar}" />
+ </classpath>
+ </taskdef>
+
<target name="compile-java">
<echo message="Compiling MATH classes" />
+
+ <mkdir dir="${hy.build}" />
- <mkdir dir="${hy.build}" />
-
- <javac sourcepath=""
+ <iajc
srcdir="${hy.math.src.main.java}"
destdir="${hy.build}"
- compiler="${hy.javac.compiler}"
- memoryMaximumSize="${hy.javac.maxmem}"
source="${hy.javac.source}"
target="${hy.javac.target}"
debug="${hy.javac.debug}">
@@ -69,7 +78,7 @@
<include name="**/*.jar" />
</fileset>
</bootclasspath>
- </javac>
+ </iajc>
</target>
<target name="copy-resources">
