dion 2004/02/02 16:28:03
Modified: castor plugin.properties project.xml plugin.jelly
castor/xdocs properties.xml changes.xml
Log:
Apply MPCASTOR-2
Revision Changes Path
1.4 +1 -0 maven-plugins/castor/plugin.properties
Index: plugin.properties
===================================================================
RCS file: /home/cvs/maven-plugins/castor/plugin.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- plugin.properties 27 May 2003 13:39:55 -0000 1.3
+++ plugin.properties 3 Feb 2004 00:28:03 -0000 1.4
@@ -5,5 +5,6 @@
# keep them apart from the project specific properties.
# -------------------------------------------------------------------
+maven.castor.properties.dir=
maven.castor.dest=${maven.build.dir}/castor/src
maven.castor.tstamp=${maven.build.dir}/castor/tstamp
1.15 +8 -2 maven-plugins/castor/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-plugins/castor/project.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- project.xml 29 Dec 2003 04:38:05 -0000 1.14
+++ project.xml 3 Feb 2004 00:28:03 -0000 1.15
@@ -5,7 +5,7 @@
<pomVersion>3</pomVersion>
<id>maven-castor-plugin</id>
<name>Maven Castor Plug-in</name>
- <currentVersion>1.0</currentVersion>
+ <currentVersion>1.1-SNAPSHOT</currentVersion>
<description>Various goals for making development with Plexus easy.</description>
<shortDescription>Plexus Tools</shortDescription>
<url>http://maven.apache.org/reference/plugins/castor/</url>
@@ -26,11 +26,17 @@
</roles>
</developer>
</developers>
+ <contributors>
+ <contributor>
+ <name>Tim Anderson</name>
+ <email>[EMAIL PROTECTED]</email>
+ </contributor>
+ </contributors>
<dependencies>
<dependency>
<groupId>castor</groupId>
<artifactId>castor</artifactId>
- <version>0.9.4.3</version>
+ <version>0.9.5</version>
<properties>
<classloader>root</classloader>
</properties>
1.5 +38 -7 maven-plugins/castor/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/maven-plugins/castor/plugin.jelly,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- plugin.jelly 10 Nov 2003 01:53:01 -0000 1.4
+++ plugin.jelly 3 Feb 2004 00:28:03 -0000 1.5
@@ -19,30 +19,58 @@
location="${maven.castor.dest}"/>
<maven:addPath id="maven.compile.src.set"
refid="maven.castor.compile.src.set"/>
+
+ <!-- determine if SourceGenerator needs to be run in a separate JVM, -->
+ <!-- to pick up the castorbuilder.properties file -->
+ <j:set var="dir" value="${maven.castor.properties.dir}"/>
+ <j:choose>
+ <!-- NOTE: need to set temp 'dir' var as -->
+ <!-- !empty{maven.castor.properties.dir} doesn't -->
+ <!-- work as expected. -->
+
+ <j:when test="${!empty(dir)}">
+ <ant:property name="maven.castor.fork" value="true"/>
+ <ant:path id="maven.castor.classpath">
+ <ant:path refid="maven.dependency.classpath"/>
+ <ant:pathelement location="${maven.castor.properties.dir}"/>
+ </ant:path>
+ </j:when>
+ <j:otherwise>
+ <ant:property name="maven.castor.fork" value="false"/>
+ <ant:path id="maven.castor.classpath">
+ <ant:path refid="maven.dependency.classpath"/>
+ </ant:path>
+ </j:otherwise>
+ </j:choose>
</goal>
<define:taglib uri="castor">
<define:tag name="generate">
+
<j:set var="fileVar" value="${schema}.filename"/>
<j:set var="uptodateVar" value="${schema}.uptodate"/>
<ant:basename property="${fileVar}" file="${schema}"/>
- <!-- wtf? shouldn't this be plugin.context? -->
- <j:set var="filename" value="${pom.context.getVariable(fileVar)}"/>
- <j:set var="log" value="${maven.castor.tstamp}"/>
- <j:set var="gen" value="${maven.castor.dest}"/>
+
+ <!-- need to jump through some hoops to get values, in order to -->
+ <!-- support maven 1.0-beta-10 -->
+ <j:set var="filename"
+ value="${pom.context.getVariable(fileVar)}"/>
+ <j:set var="context"
+ value="${pom.getPluginContext('maven-castor-plugin')}"/>
+ <j:set var="log" value="${context.getVariable('maven.castor.tstamp')}"/>
+ <j:set var="gen" value="${context.getVariable('maven.castor.dest')}"/>
<ant:uptodate property="${uptodateVar}" targetfile="${log}/${filename}">
<ant:srcfiles dir="${basedir}" includes="${schema}"/>
</ant:uptodate>
- <!-- wtf? shouldn't this be plugin.context? -->
- <j:set var="uptodate"
- value="${pom.context.getVariable(uptodateVar)}"/>
+ <j:set var="uptodate" value="${pom.context.getVariable(uptodateVar)}"/>
<j:if test="${uptodate == null}">
<ant:echo message="Generating sources for ${schema}"/>
<ant:java className="org.exolab.castor.builder.SourceGenerator"
+ fork="${maven.castor.fork}"
failonerror="true">
<ant:arg value="-i"/>
<ant:arg value="${schema}"/>
@@ -60,6 +88,8 @@
</j:if>
<ant:arg value="-dest"/>
<ant:arg value="${gen}"/>
+
+ <ant:classpath refid="maven.castor.classpath"/>
</ant:java>
<ant:touch file="${log}/${filename}"/>
</j:if>
@@ -68,6 +98,7 @@
<!-- needs to be deprecated -->
<define:tag name="srcgen">
+ <ant:echo message="DEPRECATED: castor:srcgen. Use castor:generate"/>
<ant:java
className="org.exolab.castor.builder.SourceGenerator"
failonerror="true">
1.3 +8 -0 maven-plugins/castor/xdocs/properties.xml
Index: properties.xml
===================================================================
RCS file: /home/cvs/maven-plugins/castor/xdocs/properties.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- properties.xml 27 May 2003 13:39:55 -0000 1.2
+++ properties.xml 3 Feb 2004 00:28:03 -0000 1.3
@@ -16,6 +16,14 @@
<th>Optional?</th>
</tr>
<tr>
+ <td>maven.castor.properties.dir</td>
+ <td>
+ Specifies the directory to locate the
+ <em>castorbuilder.properties</em> file.
+ </td>
+ <td>Yes</td>
+ </tr>
+ <tr>
<td>maven.castor.dest</td>
<td>
Specifies the directory to place generated sources.<br/>
1.2 +9 -0 maven-plugins/castor/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/castor/xdocs/changes.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- changes.xml 24 Jan 2003 03:44:50 -0000 1.1
+++ changes.xml 3 Feb 2004 00:28:03 -0000 1.2
@@ -6,6 +6,15 @@
</properties>
<body>
+ <release version="1.1" date="in CVS">
+ <action dev="tima" type="add">
+ Added <em>maven.castor.properties.dir</em> property.
+ </action>
+ <action dev="tima" type="update">
+ Updated to castor 0.9.5
+ </action>
+ </release>
+
<release version="1.0" date="2002-08-04">
<action dev="jvanzyl" type="add">
Original release for Maven 1.0-beta8
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]