maven-plugins/aspectj/plugin.jelly
kaz 4bfab8a325 Enhanced the AspectJ plugin to enable users to specify that emacs
symbols should be generated.  This is important for users that rely on
the -emacssym ajc command line option.  Specifically, the AspectJ emacs
minor mode uses these symbols (which is a very cool mode btw).

I've simply added a property called maven.aspectj.ajc.option.emacssym
which defaults to 'off' so there is no change in previous behavior of
the plugin.  However, if you set this option to 'on', the aspectj
compile goal will generate the appropriate symbol information.

Documentation has been updated to reflect the change.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113443 13f79535-47bb-0310-9956-ffa450edef68
2003-05-26 15:43:49 +00:00

133 lines
4.6 KiB
XML

<?xml version="1.0"?>
<project xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:util="jelly:util">
<!--==================================================================-->
<!-- Compile all source code, weaving the Aspects -->
<!--==================================================================-->
<goal name="aspectj"
description="Compile code with AspectJ"
prereqs="aspectj:compile"/>
<goal name="aspectj:compile"
description="Compile code with AspectJ">
<j:if test="${sourcesPresent == 'true'}">
<ant:taskdef name="ajc" classname="org.aspectj.tools.ant.taskdefs.Ajc"/>
<ant:available property="aspectSourcesPresent"
file="${pom.build.aspectSourceDirectory}"/>
<ant:uptodate property="aspectj.compile.notRequired"
targetfile="${maven.build.dir}/${maven.final.name}.jar">
<ant:srcfiles dir="${pom.build.sourceDirectory}"/>
<j:if test="${aspectSourcesPresent == 'true'}">
<ant:srcfiles dir="${pom.build.aspectSourceDirectory}"/>
</j:if>
</ant:uptodate>
<j:set var="aspectjCompileNotRequired" value="${aspectj.compile.notRequired}"/>
<j:if test="${aspectjCompileNotRequired == null}">
<j:set
var="ajcEmacssymFlag"
value="${maven.aspectj.ajc.option.emacssym}"/>
<ant:ajc
destdir="${maven.build.dest}"
excludes="**/package.html"
debug="${maven.compile.debug}"
deprecation="${maven.compile.deprecation}"
optimize="${maven.compile.optimize}"
emacssym="${ajcEmacssymFlag}">
<ant:src>
<ant:path refid="maven.compile.src.set"/>
<j:if test="${aspectSourcesPresent == 'true'}">
<ant:pathelement location="${pom.build.aspectSourceDirectory}"/>
</j:if>
</ant:src>
<j:forEach var="sm" items="${pom.build.sourceModifications}">
<ant:available property="classPresent" classname="${sm.className}"/>
<j:if test="${classPresent != 'true'}">
<j:forEach var="exclude" items="${sm.excludes}">
<ant:exclude name="${exclude}"/>
</j:forEach>
</j:if>
</j:forEach>
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
<ant:pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
</ant:classpath>
</ant:ajc>
</j:if>
</j:if>
</goal>
<goal name="aspectj:ajdoc" description="Javadoc source using ajdoc">
<j:if test="${sourcesPresent == 'true'}">
<ant:taskdef name="ajdoc" classname="org.aspectj.tools.ant.taskdefs.Ajdoc" />
<ant:available property="aspectSourcesPresent"
file="${pom.build.aspectSourceDirectory}"/>
<!-- retrieve various javadoc plugin vars -->
<util:tokenize var="javadocVarList" delim=",">
maven.javadoc.author,maven.javadoc.destdir,
maven.javadoc.links,maven.javadoc.maxmemory,
maven.javadoc.private,maven.javadoc.stylesheet,
maven.javadoc.use,maven.javadoc.version
</util:tokenize>
<j:forEach var="javadocVar" items="${javadocVarList}">
<j:set var="javadocVar" value="${javadocVar.trim()}" />
<j:set var="${javadocVar}"
value="${pom.getPluginContext('maven-javadoc-plugin').getVariable(javadocVar)}"/>
</j:forEach>
<ant:ajdoc packagenames="${pom.package}.*"
destdir="${maven.javadoc.destdir}"
author="${maven.javadoc.author}"
private="${maven.javadoc.private}"
version="${maven.javadoc.version}"
use="${maven.javadoc.use}"
windowtitle="${title}"
doctitle="${title}"
bottom="${copyright}"
stylesheetfile="${maven.javadoc.stylesheet}">
<j:forEach var="link" items="${links}">
<ant:link href="${link.trim()}"/>
</j:forEach>
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:path location="${maven.build.dest}"/>
<ant:pathelement path="${plugin.getDependencyPath('aspectj:aspectjrt')}"/>
</ant:classpath>
<ant:sourcepath>
<ant:path refid="maven.compile.src.set"/>
<j:if test="${aspectSourcesPresent == 'true'}">
<pathelement location="${pom.build.aspectSourceDirectory}"/>
</j:if>
</ant:sourcepath>
</ant:ajdoc>
</j:if>
</goal>
</project>