You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ah...@apache.org on 2005/01/14 00:55:47 UTC

svn commit: r125119 - in maven/maven-1/plugins/trunk/ant: src/plugin-resources/templates src/plugin-test xdocs

Author: aheritier
Date: Thu Jan 13 15:55:45 2005
New Revision: 125119

URL: http://svn.apache.org/viewcvs?view=rev&rev=125119
Log:
MPANT-20 : Allow URL substitutions in generated build.xml files.
Added:
   maven/maven-1/plugins/trunk/ant/src/plugin-test/build.properties   (contents, props changed)
Modified:
   maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly
   maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml
   maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml
   maven/maven-1/plugins/trunk/ant/xdocs/changes.xml

Modified: maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly
Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly?view=diff&rev=125119&p1=maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly&r1=125118&p2=maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly&r2=125119
==============================================================================
--- maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly	(original)
+++ maven/maven-1/plugins/trunk/ant/src/plugin-resources/templates/build.jelly	Thu Jan 13 15:55:45 2005
@@ -67,6 +67,8 @@
   <property name="javadocdir" value="dist/docs/api"/>
   <property name="final.name" value="${maven.final.name}"/>
 
+  <property file="build.properties"/>
+
   <path id="build.classpath">
     <fileset dir="$${libdir}" >
       <include name="**/*.jar"/>
@@ -355,13 +357,16 @@
       <j:choose>
         <j:when test="${checkExist.exists()}">
           <j:set var="dep" value="${lib.dependency}"/>
-   <!-- note: this is a valid use of artifactDirectory -->
-    <get 
-      src="${repo}/${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"
-      dest="$${libdir}/${dep.artifact}"
-      usetimestamp="true"
-      ignoreerrors="true"
-    />
+          <!-- note: this is a valid use of artifactDirectory -->
+          <j:set var="url" value="${repo}/${dep.artifactDirectory}/${dep.type}s/${dep.artifact}"/>
+          <property name="${dep.artifactId}.jar" value="${url}"/>
+          <j:set var="get.src" value="$${${dep.artifactId}.jar}"/>
+          <get 
+            src="${get.src}"
+            dest="$${libdir}/${dep.artifact}"
+            usetimestamp="true"
+            ignoreerrors="true"
+          />
         </j:when>
         <j:otherwise>
           <maven:makeRelativePath var="relativePath" basedir="${basedir}" path="${lib.path}" separator="/"/>  

Added: maven/maven-1/plugins/trunk/ant/src/plugin-test/build.properties
Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/src/plugin-test/build.properties?view=auto&rev=125119
==============================================================================
--- (empty file)
+++ maven/maven-1/plugins/trunk/ant/src/plugin-test/build.properties	Thu Jan 13 15:55:45 2005
@@ -0,0 +1,2 @@
+# Test MPANT-20
+maven-jaxb-plugin.jar=http://ovh.dl.sourceforge.net/sourceforge/maven-plugins/maven-jaxb-plugin-1.0.jar
\ No newline at end of file

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?view=diff&rev=125119&p1=maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml&r1=125118&p2=maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml&r2=125119
==============================================================================
--- maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml	(original)
+++ maven/maven-1/plugins/trunk/ant/src/plugin-test/maven.xml	Thu Jan 13 15:55:45 2005
@@ -15,55 +15,36 @@
  * limitations under the License.
  */
  -->
-<project xmlns:util="jelly:util"
-         xmlns:j="jelly:core"
-         xmlns:ant="jelly:ant"
-         xmlns:maven="jelly:maven"
-         xmlns:u="jelly:util"
-         xmlns:assert="assert"
-         xmlns:x="jelly:xml">
-         
+<project xmlns:util="jelly:util" xmlns:j="jelly:core" xmlns:ant="jelly:ant" xmlns:maven="jelly:maven" xmlns:u="jelly:util" xmlns:assert="assert" xmlns:x="jelly:xml">
   <goal name="testPlugin" prereqs="test-ant">
     <attainGoal name="clean"/>
   </goal>
-  
   <goal name="test-ant">
     <attainGoal name="ant"/>
-    
     <assert:assertFileExists file="${basedir}/build.xml"/>
-
-    <ant:property name="noget" value="noget" />
+    <ant:property name="noget" value="noget"/>
     <ant:ant/>
-
     <!-- 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()}" />
+    <x:parse var="buildXml" xml="${buildFile.toURL()}"/>
     <x:set var="properties" select="$buildXml/project/property"/>
     <j:set var="defaulttargetdirName" value="${properties[0].attribute('name').value}"/>
     <j:set var="defaulttargetdirValue" value="${properties[0].attribute('value').value}"/>
-
-    <assert:assertEquals expected="defaulttargetdir" value="${defaulttargetdirName}"
-      msg="first target is not defaulttargetdir"/>
-    <assert:assertEquals expected="target" value="${defaulttargetdirValue}"
-      msg="defaulttargetdir property is not relative"/>
-
-	<!-- check obey jar override -->
+    <assert:assertEquals expected="defaulttargetdir" value="${defaulttargetdirName}" msg="first target is not defaulttargetdir"/>
+    <assert:assertEquals expected="target" value="${defaulttargetdirValue}" msg="defaulttargetdir property is not relative"/>
+    <!-- check obey jar override -->
     <x:set var="countJarsDownload" select="count($buildXml/project/target[@name = 'get-deps']/get)"/>
-    <assert:assertEquals expected="1" value="${countJarsDownload.intValue().toString()}" msg="Should only download JUnit jar"/> 
+    <assert:assertEquals expected="2" value="${countJarsDownload.intValue().toString()}" msg="Should only download JUnit and maven-jaxb-plugin jars"/>
     <x:set var="countJarsCopy" select="count($buildXml/project/target[@name = 'get-deps']/copy)"/>
-    <assert:assertEquals expected="1" value="${countJarsDownload.intValue().toString()}" msg="Should only copy the activation jar"/> 
-
+    <assert:assertEquals expected="1" value="${countJarsCopy.intValue().toString()}" msg="Should only copy the activation jar"/>
     <!-- check test filesets -->
     <x:set var="testFilesetDirs" select="$buildXml/project/target[@name = 'compile-tests']/copy/fileset/@dir"/>
-    <assert:assertEquals expected="src/test" value="${testFilesetDirs[0].value}"
-      msg="test fileset dirs are not relative"/>
-
+    <assert:assertEquals expected="src/test" value="${testFilesetDirs[0].value}" msg="test fileset dirs are not relative"/>
     <assert:assertFileExists file="${maven.build.dest}/directory-1/file1.properties"/>
     <assert:assertFileExists file="${maven.build.dest}/file2.properties"/>
     <!-- there are no unit test sources present, so the resources wont be copied either
     <assert:assertFileExists file="${maven.test.dest}/directory-1/file1.properties"/>
     <assert:assertFileExists file="${maven.test.dest}/file2.properties"/-->
-
     <delete file="${basedir}/build.xml"/>
   </goal>
 </project>

Modified: maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml
Url: http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml?view=diff&rev=125119&p1=maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml&r1=125118&p2=maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml&r2=125119
==============================================================================
--- maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml	(original)
+++ maven/maven-1/plugins/trunk/ant/src/plugin-test/project.xml	Thu Jan 13 15:55:45 2005
@@ -61,7 +61,15 @@
       <type>jar</type>
       <properties/>
     </dependency>  
-    
+    <!-- Used to test  -->
+    <dependency>
+      <groupId>maven-plugins</groupId>
+      <artifactId>maven-jaxb-plugin</artifactId>
+      <version>1.0</version>
+      <type>jar</type>
+      <properties/>
+    </dependency>
+        
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>

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?view=diff&rev=125119&p1=maven/maven-1/plugins/trunk/ant/xdocs/changes.xml&r1=125118&p2=maven/maven-1/plugins/trunk/ant/xdocs/changes.xml&r2=125119
==============================================================================
--- maven/maven-1/plugins/trunk/ant/xdocs/changes.xml	(original)
+++ maven/maven-1/plugins/trunk/ant/xdocs/changes.xml	Thu Jan 13 15:55:45 2005
@@ -27,6 +27,7 @@
     
     <release version="1.9" date="">
       <action dev="epugh" type="add" issue="MPANT-7">Obey jar override and not attempt to download relative jars.</action>
+      <action dev="aheritier" type="add" issue="MPANT-20" due-to="Dennis Lundberg">Allow URL substitutions in generated build.xml files.</action>
     </release>    
     <release version="1.8.1" date="2004-08-20">
       <action dev="carlos" type="fix" issue="MPANT-16">Use relative paths in test resources filesets.</action>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org