ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r960950 - in /ant/core/trunk: fetch.xml src/etc/poms/ant-netrexx/pom.xml
Date Tue, 06 Jul 2010 17:26:05 GMT
Author: jglick
Date: Tue Jul  6 17:26:04 2010
New Revision: 960950

URL: http://svn.apache.org/viewvc?rev=960950&view=rev
Log:
Hackish way of making NetRexxC.jar available to the Maven build without using a public repo.
Easy enough to run fetch.xml during Maven build, but complicated by fact that
system-scope dependencies are checked for existence before plugins get a chance
to run. Also complicated a bit by the fact that adding a plugin dependency to
maven-antrun-plugin (on commons-net:commons-net:1.4.0) does not seem to suffice
to let Ant load the <ftp> task (which does not support nested <classpath>).

Modified:
    ant/core/trunk/fetch.xml
    ant/core/trunk/src/etc/poms/ant-netrexx/pom.xml

Modified: ant/core/trunk/fetch.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/fetch.xml?rev=960950&r1=960949&r2=960950&view=diff
==============================================================================
--- ant/core/trunk/fetch.xml (original)
+++ ant/core/trunk/fetch.xml Tue Jul  6 17:26:04 2010
@@ -224,6 +224,7 @@ Set -Ddest=LOCATION on the command line
     depends="init">
     <f2 project="commons-net" />
     <f2 project="com.jcraft" archive="jsch"/>
+    <available property="have.commons.net" classname="org.apache.commons.net.ftp.FTPClientConfig"/>
   </target>
 
   <target name="regexp"
@@ -309,11 +310,11 @@ Set -Ddest=LOCATION on the command line
     <f2 project="com.sun.media" archive="jai-codec" repository="http://repository.jboss.org/maven2"/>
   </target>
 
-  <target name="netrexx" depends="init-no-m2,-setup-temp-cache,networking,-fetch-netrexx,-cleanup-temp-cache"
+  <target name="netrexx" depends="init-no-m2,-setup-temp-cache,networking,-fetch-netrexx,-fetch-netrexx-no-commons-net,-cleanup-temp-cache"
           description="load NetRexx compiler" />
 
   <target name="-fetch-netrexx" depends="-setup-temp-cache"
-          description="FTPs NetRexx compiler from IBM site">
+          description="FTPs NetRexx compiler from IBM site" if="have.commons.net">
     <get-ftp-file host="ftp.software.ibm.com" remotedir="/software/awdtools/netrexx"
             filename="NetRexx.zip" localdir="${temp.dir}" />
     <copy todir="${dest.dir}" flatten="true">
@@ -324,6 +325,17 @@ Set -Ddest=LOCATION on the command line
     </copy>
   </target>
 
+  <target name="-fetch-netrexx-no-commons-net" depends="-setup-temp-cache"
+          description="FTPs NetRexx compiler from IBM site" unless="have.commons.net">
+    <get src="ftp://ftp.software.ibm.com/software/awdtools/netrexx/NetRexx.zip" dest="${temp.dir}/NetRexx.zip"
skipexisting="true"/>
+    <copy todir="${dest.dir}" flatten="true">
+      <zipfileset src="${temp.dir}/NetRexx.zip">
+        <include name="NetRexx\lib\NetRexxC.jar" />
+        <include name="NetRexx\browse\license.txt" />
+      </zipfileset>
+    </copy>
+  </target>
+
   <target name="all"
     description="load all the libraries (except jython)"
     depends="logging,junit,xml,networking,regexp,antlr,bcel,jdepend,bsf,debugging,script,javamail,jspc,jai,netrexx"
/>

Modified: ant/core/trunk/src/etc/poms/ant-netrexx/pom.xml
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/etc/poms/ant-netrexx/pom.xml?rev=960950&r1=960949&r2=960950&view=diff
==============================================================================
--- ant/core/trunk/src/etc/poms/ant-netrexx/pom.xml (original)
+++ ant/core/trunk/src/etc/poms/ant-netrexx/pom.xml Tue Jul  6 17:26:04 2010
@@ -42,12 +42,15 @@ xsi:schemaLocation="http://maven.apache.
       <version>1.8.2-SNAPSHOT</version>
       <scope>compile</scope>
     </dependency>
+    <!-- Processed too early, before maven-antrun-plugin gets a chance to work:
     <dependency>
       <groupId>com.ibm.netrexx</groupId>
       <artifactId>netrexx</artifactId>
       <version>2.0.5</version>
-      <scope>provided</scope>
+      <scope>system</scope>
+      <systemPath>${basedir}/../../../../lib/optional/NetRexxC.jar</systemPath>
     </dependency>
+    -->
   </dependencies>
   <build>
     <plugins>
@@ -60,8 +63,32 @@ xsi:schemaLocation="http://maven.apache.
           <includes>
             <include>org/apache/tools/ant/taskdefs/optional/NetRexxC*</include>
           </includes>
+          <!-- Need to use this rather than system scope as above: -->
+          <compilerArguments>
+            <extdirs>${basedir}/../../../../lib/optional</extdirs>
+          </compilerArguments>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>1.4</version>
+        <executions>
+          <execution>
+            <phase>validate</phase>
+            <configuration>
+              <tasks>
+                <ant dir="${basedir}/../../../.." antfile="fetch.xml" target="netrexx">
+                  <property name="dest" value="optional"/>
+                </ant>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <sourceDirectory>../../../../src/main</sourceDirectory>
     <testSourceDirectory>../../../../src/testcases</testSourceDirectory>



Mime
View raw message