You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ah...@apache.org on 2006/05/09 01:14:56 UTC

svn commit: r405217 - in /maven/maven-1/plugins/trunk/ant: plugin.jelly plugin.properties src/plugin-test/maven.xml xdocs/changes.xml xdocs/properties.xml

Author: aheritier
Date: Mon May  8 16:14:54 2006
New Revision: 405217

URL: http://svn.apache.org/viewcvs?rev=405217&view=rev
Log:
MPANT-25: Add a new goal (ant:execute) to execute a build.xml file from maven.

Modified:
    maven/maven-1/plugins/trunk/ant/plugin.jelly
    maven/maven-1/plugins/trunk/ant/plugin.properties
    maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml
    maven/maven-1/plugins/trunk/ant/xdocs/changes.xml
    maven/maven-1/plugins/trunk/ant/xdocs/properties.xml

Modified: maven/maven-1/plugins/trunk/ant/plugin.jelly
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/plugin.jelly?rev=405217&r1=405216&r2=405217&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/ant/plugin.jelly (original)
+++ maven/maven-1/plugins/trunk/ant/plugin.jelly Mon May  8 16:14:54 2006
@@ -48,4 +48,23 @@
     <ant:echo>${maven.ant.generatebuild.file} generated.</ant:echo>
   </goal>
   
+  <goal
+    name="ant:execute"
+    description="Execute an Ant build file">
+
+    <ant:echo>Executing ${maven.ant.execute.dir}/${maven.ant.execute.script} ...</ant:echo>
+    <ant:ant>
+      <j:if test="${context.getVariable('maven.ant.execute.script') != null and !context.getVariable('maven.ant.execute.script').equals('')}">
+        <ant:setProperty name="antfile" value="${context.getVariable('maven.ant.execute.script')}" />
+      </j:if>
+      <j:if test="${context.getVariable('maven.ant.execute.dir') != null and !context.getVariable('maven.ant.execute.dir').equals('')}">
+        <ant:setProperty name="dir" value="${context.getVariable('maven.ant.execute.dir')}" />
+      </j:if>
+      <j:if test="${context.getVariable('maven.ant.execute.target') != null and !context.getVariable('maven.ant.execute.target').equals('')}">
+        <ant:setProperty name="target" value="${context.getVariable('maven.ant.execute.target')}" />
+      </j:if>
+    </ant:ant>
+    <ant:echo>${maven.ant.execute.dir}/${maven.ant.execute.script} executed.</ant:echo>
+  </goal>
+  
 </project>

Modified: maven/maven-1/plugins/trunk/ant/plugin.properties
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/plugin.properties?rev=405217&r1=405216&r2=405217&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/ant/plugin.properties (original)
+++ maven/maven-1/plugins/trunk/ant/plugin.properties Mon May  8 16:14:54 2006
@@ -21,7 +21,12 @@
 # keep them apart from the project specific properties.
 # -------------------------------------------------------------------
 
+maven.ant.execute.script = build.xml
+maven.ant.execute.dir    = ${basedir}
+maven.ant.execute.target =
+
 maven.ant.generatebuild.file = ${basedir}/build.xml
-maven.ant.use.properties     = true
 maven.ant.compatibility      = 1.6
+
+maven.ant.use.properties     = true
 maven.ant.use.multirepo      = true

Modified: maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml?rev=405217&r1=405216&r2=405217&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml (original)
+++ maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml Mon May  8 16:14:54 2006
@@ -19,9 +19,9 @@
   <goal name="testPlugin" prereqs="test-ant"/>
   <goal name="test-ant" prereqs="clean">
     <delete file="${basedir}/build.xml" failonerror="false"/>
-    <attainGoal name="ant"/>
+    <attainGoal name="ant:generate-build"/>
     <assert:assertFileExists file="${basedir}/build.xml"/>
-    <ant:ant/>
+    <attainGoal name="ant:execute"/>
     <!-- load build.xml file and check that 'target' property is relative -->
     <u:file name="${basedir}/build.xml" var="buildFile"/>
     <x:parse var="buildXml" xml="${buildFile.toURL()}"/>

Modified: maven/maven-1/plugins/trunk/ant/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/xdocs/changes.xml?rev=405217&r1=405216&r2=405217&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/ant/xdocs/changes.xml (original)
+++ maven/maven-1/plugins/trunk/ant/xdocs/changes.xml Mon May  8 16:14:54 2006
@@ -26,11 +26,8 @@
   </properties>
   <body>
     <release version="1.10-SNAPSHOT" date="In SVN">
-      <action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : 
-        <ul>
-          <li>commons-jelly-tags-xml v1.0 -> v1.1</li>
-        </ul>
-      </action>
+      <action dev="aheritier" type="add" issue="MPANT-25">Add a new goal (ant:execute) to execute a build.xml file from maven.</action>
+      <action dev="aheritier" type="update" issue="MAVEN-1712">Update dependencies to match ones in maven 1.1 core and to unify them between plugins. The following dependencies are updated : commons-jelly-tags-xml v1.0 to v1.1.</action>
     </release>
     <release version="1.9" date="2005-04-09">
       <action dev="aheritier" type="add" issue="MPANT-24">Ant script looks for dependencies in several remote repositories.</action>

Modified: maven/maven-1/plugins/trunk/ant/xdocs/properties.xml
URL: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/xdocs/properties.xml?rev=405217&r1=405216&r2=405217&view=diff
==============================================================================
--- maven/maven-1/plugins/trunk/ant/xdocs/properties.xml (original)
+++ maven/maven-1/plugins/trunk/ant/xdocs/properties.xml Mon May  8 16:14:54 2006
@@ -67,9 +67,30 @@
         <tr>
           <td>maven.ant.use.multirepo</td>
           <td>Defines if you want to generate a script which will download dependencies from all your repositories. If false, the script will only download them from the first one (ibiblio by default).</td>
-          <td>since 1.9</td>
+          <td>since 1.10</td>
           <td>Yes</td>
           <td>true</td>
+        </tr>
+        <tr>
+          <td>maven.ant.execute.script</td>
+          <td>The buildfile to use. Defaults to "build.xml". This file is expected to be a filename relative to the "maven.ant.execute.dir" property given.</td>
+          <td>since 1.10</td>
+          <td>Yes</td>
+          <td>"build.xml"</td>
+        </tr>
+        <tr>
+          <td>maven.ant.execute.dir</td>
+          <td>The directory to use as a basedir for the Ant project. Defaults to the current project's basedir. This will override the basedir setting of the called project.</td>
+          <td>since 1.10</td>
+          <td>Yes</td>
+          <td>${basedir}</td>
+        </tr>
+        <tr>
+          <td>maven.ant.execute.target</td>
+          <td>The target of the Ant project that should be executed. Defaults to the project's default target.</td>
+          <td>since 1.9</td>
+          <td>Yes</td>
+          <td><i>&lt;empty&gt;</i></td>
         </tr>
       </table>
     </section>