vmassol 2003/09/29 06:08:58
Added: src/plugins-build/caller .cvsignore project.properties
plugin.properties project.xml plugin.jelly
src/plugins-build/caller/xdocs goals.xml navigation.xml
properties.xml index.xml changes.xml
Log:
Initial commit of new caller plugin. The caller plugin is useful to isolate a plugin
from other plugins it calls so that different implementation can be seamlessly
introduced.
Revision Changes Path
1.1 maven/src/plugins-build/caller/.cvsignore
Index: .cvsignore
===================================================================
target
maven.log
velocity.log
.classpath
.project
1.1 maven/src/plugins-build/caller/project.properties
Index: project.properties
===================================================================
# -------------------------------------------------------------------
# P R O J E C T P R O P E R T I E S
# -------------------------------------------------------------------
maven.xdoc.date=left
maven.xdoc.version=${pom.currentVersion}
maven.license.licenseFile=${basedir}/../../../LICENSE.txt
1.1 maven/src/plugins-build/caller/plugin.properties
Index: plugin.properties
===================================================================
# List of Well-Known Goal Interface (WKGI).
#
# compile-java : compile the source code in ${maven.compile.src.set} (i.e. the
# sources in ${pom.build.sourceDirectory}).
# Default implementation goals for the WKGIs
maven.caller.call.compile-java = java:compile
1.1 maven/src/plugins-build/caller/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<project>
<extend>../project.xml</extend>
<pomVersion>3</pomVersion>
<id>maven-caller-plugin</id>
<name>Maven Caller Plugin</name>
<currentVersion>1.0-SNAPSHOT</currentVersion>
<description>Interface to isolate calls between plugins</description>
<shortDescription>Maven Caller plugin</shortDescription>
<url>http://maven.apache.org/reference/plugins/caller/</url>
<siteDirectory>/www/maven.apache.org/reference/plugins/caller/</siteDirectory>
<repository>
<connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:maven/src/plugins-build/caller/</connection>
<url>http://cvs.apache.org/viewcvs/maven/src/plugins-build/caller/</url>
</repository>
<developers>
<developer>
<name>Vincent Massol</name>
<id>vmassol</id>
<email>[EMAIL PROTECTED]</email>
<organization>Pivolis</organization>
<roles>
<role>Creator</role>
<role>Developer</role>
<role>Release Manager</role>
</roles>
</developer>
</developers>
<dependencies/>
</project>
1.1 maven/src/plugins-build/caller/plugin.jelly
Index: plugin.jelly
===================================================================
<?xml version="1.0"?>
<project
xmlns:j="jelly:core"
xmlns:ant="jelly:ant"
xmlns:define="jelly:define">
<define:taglib uri="caller">
<!-- Example of usage:
<caller:call goalInterface="compile-java"/>
-->
<define:tag name="call">
<j:set var="callProperty" value="maven.caller.call.${goalInterface}"/>
<!-- Search first in the caller's context -->
<j:set var="goalName"
value="${context.findVariable(callProperty)}"/>
<j:if test="${goalName == null}">
<!-- Search in this plugin context -->
<j:set var="goalName"
value="${pom.getPluginContext('maven-caller-plugin').findVariable(callProperty)}"/>
</j:if>
<j:if test="${goalName == null}">
<ant:fail message="Property [maven.caller.call.${goalInterface}] is not
defined"/>
</j:if>
<attainGoal name="${goalName}"/>
</define:tag>
<!-- Example of usage:
<caller:set goalInterface="compile-java" goal="aspectj:compile"/>
-->
<define:tag name="set">
<j:set var="setProperty" value="maven.caller.call.${goalInterface}"/>
<j:set var="${setProperty}" value="${goal}"/>
</define:tag>
</define:taglib>
</project>
1.1 maven/src/plugins-build/caller/xdocs/goals.xml
Index: goals.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Maven Caller plugin goals</title>
<author email="[EMAIL PROTECTED]">Vincent Massol</author>
</properties>
<body>
<section name="Goals">
<table>
<tr><th>Goal</th><th>Description</th></tr>
<tr>
<td>call</td>
<td>
Call a Well-Known Goal Interface (WKGI). For example
<code><caller:call goalInterface="compile-java"/></code>.
The list of WKGIs are found on the
<a href="properties.html">properties page</a>.
</td>
</tr>
<tr>
<td>set</td>
<td>
Rewire a WKGI implementation. For example
<code><caller:set goalInterface="compile-java"
goal="aspectj:compile"/></code>.
You can also directly set the corresponding Maven property:
<code>maven.caller.call.[WKGI name]</code>.
</td>
</tr>
</table>
</section>
</body>
</document>
1.1 maven/src/plugins-build/caller/xdocs/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Maven Caller Plugin">
<title>Maven Caller Plugin</title>
<author email="[EMAIL PROTECTED]">Vincent Massol</author>
<body>
<links>
<item name="Maven" href="http://maven.apache.org/"/>
</links>
<menu name="Overview">
<item name="Goals" href="/goals.html" />
<item name="Properties" href="/properties.html" />
</menu>
</body>
</project>
1.1 maven/src/plugins-build/caller/xdocs/properties.xml
Index: properties.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<document>
<properties>
<title>Maven Caller plugin properties</title>
<author email="[EMAIL PROTECTED]">Vincent Massol</author>
</properties>
<body>
<section name="Maven Caller plugin settings">
<table>
<tr>
<th>Property name</th>
<th>Optional?</th>
<th>Description</th>
</tr>
<tr>
<td>maven.caller.call.compile-java</td>
<td>Yes</td>
<td>
Defines the implementing goal for the "compile-java" WKGI.
The default value is <code>java:compile</code>.
</td>
</tr>
</table>
</section>
</body>
</document>
1.1 maven/src/plugins-build/caller/xdocs/index.xml
Index: index.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Maven Caller plugin</title>
<author email="[EMAIL PROTECTED]">Vincent Massol</author>
</properties>
<body>
<section name="Maven Caller Plug-in">
<p>
The Caller plugin is an interface abstraction for goals. It defines
several Well-Known Goal Interfaces (WKGI). This allows a plugin
to call another plugin through this Caller plugin. The benefit is
that it is then possible to rewire the implementation of a WKGI.
</p>
<p>
Here's a typical scenario. Imagine you wish to implement an aspectj
plugin. This plugin will compile the Java sources using the Aspectj
compiler. However, the project you wish to use the aspectj plugin on
is a webapp and thus you will need call the <code>war:war</code>.
Alas, the <code>war:war</code> goal has a hard-wired call to
<code>java:compile</code>. What you would like is redirect this call
to your <code>aspectj:compile</code> goal. The solution: the Caller
plugin.
</p>
<p>
Here's what you would write. In the war plugin's
<code>plugin.jelly</code>, you would replace the call to
</p>
<source><![CDATA[
<attainGoal name="java:compile"/>
]]></source>
<p>
by
</p>
<source><![CDATA[
<caller:call goalInterface="compile-java"/>
]]></source>
<p>
Then, in your Aspectj plugin, you would call
</p>
<source><![CDATA[
<caller:set goalInterface="compile-java" goal="aspectj:compile"/>
]]></source>
<p>
Thus, when, as a user you will call the <code>war:war</code>
goal, your <code>aspectj:compile</code> goal will be called.
</p>
<p>
For more information on the functionality provided by this plugin,
please see the <a href="goals.html">Goals</a> document.
</p>
<p>
For more information on how to customise the functionality provided
by this plugin, please see the <a href="properties.html">properties</a>
document.
</p>
</section>
</body>
</document>
1.1 maven/src/plugins-build/caller/xdocs/changes.xml
Index: changes.xml
===================================================================
<?xml version="1.0"?>
<document>
<properties>
<title>Caller Plugin</title>
<author email="[EMAIL PROTECTED]">Vincent Massol</author>
</properties>
<body>
<release version="1.0" date="in CVS">
<action dev="vmassol" type="add">
Initial creation of plugin.
</action>
</release>
</body>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]