You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by cu...@apache.org on 2009/06/17 22:14:27 UTC

svn commit: r785776 - in /hadoop/avro/trunk: CHANGES.txt build.xml ivy.xml lib/ lib/jackson-core-asl-1.0.0.jar lib/jackson-mapper-asl-1.0.0.jar lib/paranamer-1.3/ lib/slf4j-api-1.5.6.jar lib/slf4j-simple-1.5.6.jar lib/testng-5.9-jdk15.jar

Author: cutting
Date: Wed Jun 17 20:14:24 2009
New Revision: 785776

URL: http://svn.apache.org/viewvc?rev=785776&view=rev
Log:
AVRO-53.  Use Ivy to retrieve Java dependencies.

Added:
    hadoop/avro/trunk/ivy.xml
Removed:
    hadoop/avro/trunk/lib/jackson-core-asl-1.0.0.jar
    hadoop/avro/trunk/lib/jackson-mapper-asl-1.0.0.jar
    hadoop/avro/trunk/lib/paranamer-1.3/
    hadoop/avro/trunk/lib/slf4j-api-1.5.6.jar
    hadoop/avro/trunk/lib/slf4j-simple-1.5.6.jar
    hadoop/avro/trunk/lib/testng-5.9-jdk15.jar
Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/build.xml
    hadoop/avro/trunk/lib/   (props changed)

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=785776&r1=785775&r2=785776&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Wed Jun 17 20:14:24 2009
@@ -61,6 +61,8 @@
     AVRO-48. Remove unused imports and annotations.
     (Thiruvalluvan M. G. via cutting)
 
+    AVRO-53. Use Ivy to retrieve Java dependencies.  (cutting)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/avro/trunk/build.xml
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/build.xml?rev=785776&r1=785775&r2=785776&view=diff
==============================================================================
--- hadoop/avro/trunk/build.xml (original)
+++ hadoop/avro/trunk/build.xml Wed Jun 17 20:14:24 2009
@@ -17,7 +17,8 @@
    limitations under the License.
 -->
 
-<project name="Avro" default="compile">
+<project name="Avro" default="compile"
+	 xmlns:ivy="antlib:org.apache.ivy.ant">
  
   <!-- Load user's default properties. -->
   <property file="${user.home}/build.properties" />
@@ -72,6 +73,12 @@
   <property name="javac.args" value=""/>
   <property name="javac.args.warnings" value="-Xlint:unchecked"/>
 
+  <property name="ivy.version" value="2.1.0-rc1"/>
+  <property name="ivy.url"
+	    value="http://repo2.maven.org/maven2/org/apache/ivy/ivy" />
+  <property name="ivy.home" value="${user.home}/.ant" />
+  <property name="ivy.lib" value="${build.dir}/lib"/>
+
   <!-- the normal classpath -->
   <path id="java.classpath">
     <pathelement location="${build.classes}"/>
@@ -82,6 +89,9 @@
     <fileset dir="${ant.home}/lib">
       <include name="ant.jar" />
     </fileset>
+    <fileset dir="${ivy.lib}">
+      <include name="**/*.jar" />
+    </fileset>
   </path>
 
   <path id="test.java.classpath">
@@ -95,16 +105,37 @@
  
     <mkdir dir="${test.java.build.dir}"/>
     <mkdir dir="${test.java.classes}"/>
+
+    <mkdir dir="${ivy.lib}"/>
+    <condition property="ivy.jar.exists">
+      <available file="${lib.dir}/ivy-${ivy.version}.jar"/>
+    </condition>
   </target>
 
   <target name="compile" depends="compile-java,compile-c"/>
 
-  <target name="compile-java" depends="init,schemata">
+  <target name="compile-java" depends="init,schemata,ivy-retrieve">
     <java-compiler excludes="**/ipc/** **/*Requestor.java **/*Responder.java"/>
     <java-avro-compiler/>
     <java-compiler/>
   </target>
 
+  <target name="ivy-download" unless="ivy.jar.exists" depends="init">
+    <delete dir="${lib.dir}"
+	    includes="ivy-*.jar" excludes="ivy-${ivy.version}.jar"/>
+    <get src="${ivy.url}/${ivy.version}/ivy-${ivy.version}.jar"
+         dest="${lib.dir}/ivy-${ivy.version}.jar" usetimestamp="true"/>
+  </target>
+
+  <target name="ivy-init" depends="ivy-download">
+    <taskdef resource="org/apache/ivy/ant/antlib.xml"
+             uri="antlib:org.apache.ivy.ant" classpathref="java.classpath"/>
+  </target>
+
+  <target name="ivy-retrieve" depends="ivy-init">
+    <ivy:retrieve type="jar" pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
+  </target>
+
   <macrodef name="java-compiler">
     <attribute name="src" default="${java.src.dir}"/>
     <attribute name="dest" default="${build.classes}"/>
@@ -140,7 +171,7 @@
   </target>
 
   <target name="jar" depends="compile-java" description="Build jar file.">
-    <jar jarfile="${build.dir}/${fullname}-java.jar"
+    <jar jarfile="${build.dir}/${fullname}.jar"
          basedir="${build.classes}">
       <manifest>
         <section name="org/${org}/${name}">
@@ -159,7 +190,9 @@
 			classpath="test.java.classpath"/>
     <java-compiler src="${test.java.src.dir}"
 		   dest="${test.java.classes}"
-		   classpath="test.java.classpath"/>
+		   classpath="test.java.classpath"
+		   excludes="org/apache/avro/test/**.java"/>
+    <taskdef resource="testngtasks" classpathref="java.classpath"/>
   </target>
 
   <macrodef name="java-avro-compiler">
@@ -204,9 +237,6 @@
 
   <target name="test" depends="test-java,test-py,test-c,test-interop"/>
 
-  <!-- Define TestNG task for all targets that might need it-->
-  <taskdef resource="testngtasks" classpathref="java.classpath"/>
-
   <target name="test-java" depends="compile-test-java"
           description="Run java unit tests with TestNG">
 
@@ -214,8 +244,8 @@
             sourcedir="${test.java.src.dir}"
             outputdir="${build.dir}/test-output"
             suitename="AvroTestNG"
-            listeners="org.apache.avro.test.TestOutputInterceptor, org.apache.avro.test.TestSuiteInterceptor"
             haltOnfailure="true">
+            <!-- listeners="org.apache.avro.test.TestOutputInterceptor, org.apache.avro.test.TestSuiteInterceptor" -->
       <sysproperty key="test.count" value="${test.count}"/>
       <sysproperty key="test.dir" value="${test.java.build.dir}"/>
       <sysproperty key="test.validate" value="${test.validate}"/>
@@ -437,6 +467,7 @@
 
     <copy todir="${dist.dir}/lib" includeEmptyDirs="false">
       <fileset dir="lib"/>
+      <fileset dir="${ivy.lib}"/>
     </copy>
 
     <copy todir="${dist.dir}/c" includeEmptyDirs="false">
@@ -444,9 +475,17 @@
     </copy>
 
     <copy todir="${dist.dir}"> 
-      <fileset file="${build.dir}/${fullname}-*.jar"/>
+      <fileset file="${build.dir}/${fullname}.jar"/>
     </copy>
 
+    <checksum file="${dist.dir}/${fullname}.jar" algorithm="md5"/>
+    <checksum file="${dist.dir}/${fullname}.jar" algorithm="sha1"/>
+
+    <ivy:makepom ivyfile="${basedir}/ivy.xml"
+		 pomfile="${dist.dir}/${fullname}.pom">
+      <mapping conf="default" scope="compile"/>
+    </ivy:makepom>
+
     <copy todir="${dist.dir}/doc">
       <fileset dir="${build.doc}"/>
     </copy>

Added: hadoop/avro/trunk/ivy.xml
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/ivy.xml?rev=785776&view=auto
==============================================================================
--- hadoop/avro/trunk/ivy.xml (added)
+++ hadoop/avro/trunk/ivy.xml Wed Jun 17 20:14:24 2009
@@ -0,0 +1,25 @@
+<ivy-module version="2.0"
+            xmlns:e="http://ant.apache.org/ivy/extra">
+
+  <info organisation="org.apache.hadoop"
+	module="${name}" revision="${version}">
+    <license name="Apache 2.0"/>
+    <ivyauthor name="Apache Hadoop" url="http://hadoop.apache.org"/>
+    <description>Avro</description>
+  </info>
+
+  <dependencies>
+    <dependency org="org.codehaus.jackson" name="jackson-mapper-asl"
+		rev="1.0.1"/>
+    <dependency org="org.slf4j" name="slf4j-simple"
+		rev="1.5.8"/>
+    <dependency org="com.thoughtworks.paranamer" name="paranamer"
+		rev="1.5"/>
+    <dependency org="com.thoughtworks.paranamer" name="paranamer-ant"
+		rev="1.5"/>
+    <dependency org="org.testng" name="testng" rev="5.8" transitive="false">
+      <artifact name="testng" type="jar" ext="jar" e:classifier="jdk15"/>
+    </dependency>
+  </dependencies>
+
+</ivy-module>

Propchange: hadoop/avro/trunk/lib/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jun 17 20:14:24 2009
@@ -0,0 +1 @@
+ivy-*.jar