kaz 02/05/04 09:34:18
Modified: src/templates/build default.properties build-maven.xml
xdocs/ref build-file.xml properties.xml
Log:
Compiling with aspects was not completely working. The following
changes fix the errors. The documentation has also been updated to
reflect the new changes.
Revision Changes Path
1.31 +4 -0 jakarta-turbine-maven/src/templates/build/default.properties
Index: default.properties
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/default.properties,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- default.properties 2 May 2002 16:00:47 -0000 1.30
+++ default.properties 4 May 2002 16:34:18 -0000 1.31
@@ -13,6 +13,10 @@
build.src = ${build.dir}/src
build.dest = ${build.dir}/classes
+maven.compile.aspects = false
+maven.jar.aspectjrt = ${ant.home}/lib/aspectjrt.jar
+maven.jar.aspectjtools = ${ant.home}/lib/aspectjtools.jar
+
docs.src = ${basedir}/xdocs
docs.dest = ${basedir}/docs
gen.docs = ${build.dir}/generated-xdocs
1.43 +19 -2 jakarta-turbine-maven/src/templates/build/build-maven.xml
Index: build-maven.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/templates/build/build-maven.xml,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- build-maven.xml 2 May 2002 06:29:44 -0000 1.42
+++ build-maven.xml 4 May 2002 16:34:18 -0000 1.43
@@ -15,6 +15,10 @@
<mkdir dir="${build.dest}"/>
<mkdir dir="${docs.dest}"/>
+ <condition property="build.includes.aspects">
+ <equals arg1="${maven.compile.aspects}" arg2="true"/>
+ </condition>
+
</target>
<!-- ================================================================== -->
@@ -242,12 +246,25 @@
optimize="${compile.optimize}">
<src>
+ <path refid="compile.src.set"/>
<path refid="src.aspect.set"/>
</src>
<classpath>
<path refid="classpath"/>
- <pathelement location="${aspectjrt.jar}"/>
- <pathelement location="${aspectjtools.jar}"/>
+ <pathelement location="${maven.jar.aspectjrt}"/>
+ <pathelement location="${maven.jar.aspectjtools}"/>
+ <!--
+ The fileset is required because the ajc ant task does not
+ support the "includeAntRuntime" attribute (of the javac
+ task). Therefore, Ant's runtime libraries are excluded when
+ aspectj is trying to compile. By default, the javac task
+ does include Ant's runtime libraries when compiling, so to
+ mimic this behavior, we need to manually include the jars
+ from the ant.home/lib directory.
+ -->
+ <fileset dir="${ant.home}/lib">
+ <include name="**/*.jar"/>
+ </fileset>
</classpath>
</ajc>
1.2 +12 -6 jakarta-turbine-maven/xdocs/ref/build-file.xml
Index: build-file.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/xdocs/ref/build-file.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- build-file.xml 1 May 2002 22:03:11 -0000 1.1
+++ build-file.xml 4 May 2002 16:34:18 -0000 1.2
@@ -237,12 +237,18 @@
</p>
<p>
Users interested in compiling with aspects enabled can set the
- <code>build.includes.aspects</code> property. If this
- property is set, the AspectJ compiler will be used to compile
- the source [TODO: add a link to a page that describes how to
- setup one's AspectJ environment]. The aspect source files are
- determined from the
- <a
href="project-descriptor.html#aspectSourceDirectories"><code>aspectSourceDirectories</code></a>
+ <code>maven.compile.aspects</code> property. If this property
+ is set to a value of <code>true</code>, the AspectJ compiler
+ will be used to compile the source. In order to compile using
+ AspectJ, you must have the <code>aspectj-ant.jar</code> JAR
+ (contains the <code>ajc</code> Ant task) installed in your
+ <code>${ant.home}/lib</code> directory. Maven also assumes
+ you have installed <code>aspectjrt.jar</code> and
+ <code>aspectjtools.jar</code> in the
+ <code>${ant.home}/lib</code> directory (although this default
+ may be overridden via <a href="properties.html">Properties</a>).
+ Finally, The aspect source files are determined from the <a
+
href="project-descriptor.html#aspectSourceDirectories"><code>aspectSourceDirectories</code></a>
element of the Maven project descriptor.
</p>
</subsection>
1.4 +25 -3 jakarta-turbine-maven/xdocs/ref/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/xdocs/ref/properties.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- properties.xml 3 May 2002 06:03:26 -0000 1.3
+++ properties.xml 4 May 2002 16:34:18 -0000 1.4
@@ -155,11 +155,33 @@
</td>
</tr>
<tr>
- <td>build.includes.aspects</td>
+ <td>maven.compile.aspects</td>
<td>Yes</td>
<td>
- Specifies that Aspects are included during compilation. Used by the
- <a href="build-file.html#maven:compile">maven:compile</a> target.
+ Specifies that Aspects are included during compilation.
+ Used by the <a href="build-file.html#maven:compile">maven:compile</a>
+ target. The default value is <code>false</code>. Please
+ refer to the <a href="http://www.aspectj.org/">AspectJ</a>
+ web site for more information on Aspect-Oriented
+ Programming.
+ </td>
+ </tr>
+ <tr>
+ <td>maven.jar.aspectjrt</td>
+ <td>Yes</td>
+ <td>
+ Specifies the default location of the <a
+ href="http://www.aspectj.org/">AspectJ</a> runtime JAR.
+ The default value is <code>${ant.home}/lib</code>.
+ </td>
+ </tr>
+ <tr>
+ <td>maven.jar.aspectjtools</td>
+ <td>Yes</td>
+ <td>
+ Specifies the default location of the <a
+ href="http://www.aspectj.org/">AspectJ</a> tools JAR.
+ The default value is <code>${ant.home}/lib</code>.
</td>
</tr>
</table>