avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r898991 - in /hadoop/avro/trunk: ./ lang/java/ lang/java/src/java/org/apache/avro/specific/ lang/java/src/java/org/apache/avro/tool/ lang/java/src/test/bin/ lang/java/src/test/java/org/apache/avro/ipc/stats/
Date Wed, 13 Jan 2010 23:08:15 GMT
Author: cutting
Date: Wed Jan 13 23:08:14 2010
New Revision: 898991

URL: http://svn.apache.org/viewvc?rev=898991&view=rev
Log:
AVRO-320. Rename avroj to be avro-tools.

Added:
    hadoop/avro/trunk/lang/java/src/test/bin/test_tools.sh
      - copied, changed from r898919, hadoop/avro/trunk/lang/java/src/test/bin/test_avroj.sh
Removed:
    hadoop/avro/trunk/lang/java/src/test/bin/test_avroj.sh
Modified:
    hadoop/avro/trunk/CHANGES.txt
    hadoop/avro/trunk/lang/java/build.xml
    hadoop/avro/trunk/lang/java/ivy.xml
    hadoop/avro/trunk/lang/java/src/java/org/apache/avro/specific/SpecificCompiler.java
    hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java
    hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java
    hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Tool.java
    hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java

Modified: hadoop/avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/CHANGES.txt?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/CHANGES.txt (original)
+++ hadoop/avro/trunk/CHANGES.txt Wed Jan 13 23:08:14 2010
@@ -208,6 +208,10 @@
 
     AVRO-317. Restore Java data interop tests. (cutting)
 
+    AVRO-320. Rename avroj to be avro-tools.  Also add LICENSE.txt and
+    NOTICE.txt to it, print the NOTICE.txt and version in help, and
+    include the tools jar in distributions.  (cutting)
+
   OPTIMIZATIONS
 
     AVRO-172. More efficient schema processing (massie)

Modified: hadoop/avro/trunk/lang/java/build.xml
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/build.xml?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/build.xml (original)
+++ hadoop/avro/trunk/lang/java/build.xml Wed Jan 13 23:08:14 2010
@@ -155,6 +155,10 @@
       <src path="${build.dir}/src"/>
       <src path="${java.src.dir}"/>
     </java-compiler>
+    <copy todir="${build.classes}"> 
+      <fileset file="${basedir}/../../NOTICE.txt"/>
+      <fileset file="${basedir}/../../share/VERSION.txt"/>
+    </copy>
   </target>
 
   <target name="ivy-download" unless="ivy.jar.exists" depends="init">
@@ -176,11 +180,11 @@
 		  pattern="${ivy.lib}/[artifact]-[revision].[ext]"/>
   </target>
 
-  <target name="ivy-retrieve-avroj" depends="init,ivy-init">
+  <target name="ivy-retrieve-tools" depends="init,ivy-init">
     <!-- Place in separate directory, since these artificats will
-         be packaged in the avroj jar. -->
-    <ivy:retrieve type="jar" conf="avroj"
-		  pattern="${ivy.lib}/avroj/[artifact]-[revision].[ext]"/>
+         be packaged in the tools jar. -->
+    <ivy:retrieve type="jar" conf="tools"
+		  pattern="${ivy.lib}/tools/[artifact]-[revision].[ext]"/>
   </target>
 
   <target name="ivy-retrieve-test" depends="init,ivy-init">
@@ -301,7 +305,7 @@
     </sequential>
   </macrodef>
 
-  <target name="test" depends="test-java,test-avroj"/>
+  <target name="test" depends="test-java,test-tools"/>
 
   <target name="rat" depends="ivy-retrieve-test">
     <typedef resource="org/apache/rat/anttasks/antlib.xml"
@@ -403,9 +407,9 @@
     <test-runner files.location="${test.java.classes}" tests.pattern="**/TestProtocolSpecific$InteropTest.class"
/>
   </target>
 
-  <target name="avroj" depends="compile,ivy-retrieve-avroj"
-	  description="Build standalone avroj jar file">
-    <jar jarfile="${build.dir}/avroj-${version}.jar">
+  <target name="tools" depends="compile,ivy-retrieve-tools"
+	  description="Build standalone tools jar file">
+    <jar jarfile="${build.dir}/avro-tools-${version}.jar">
       <manifest>
         <attribute name="Main-Class" value="org.apache.avro.tool.Main"/>
         <attribute name="Implementation-Title" value="${Name}"/>
@@ -413,17 +417,17 @@
         <attribute name="Implementation-Vendor" value="${Org}"/>
       </manifest>
       <fileset dir="${build.classes}" />
-      <zipgroupfileset dir="${ivy.lib}/avroj" includes="*.jar"/>
+      <zipgroupfileset dir="${ivy.lib}/tools" includes="*.jar"/>
     </jar>
-    <chmod file="${build.dir}/avroj-${version}.jar" perm="ugo+x"/>
+    <chmod file="${build.dir}/avro-tools-${version}.jar" perm="ugo+x"/>
   </target>
 
-  <target name="test-avroj" depends="avroj,compile-test-java"
-   description="Tests avroj commands">
-    <exec executable="${basedir}/src/test/bin/test_avroj.sh"
+  <target name="test-tools" depends="tools,compile-test-java"
+   description="Tests tools">
+    <exec executable="${basedir}/src/test/bin/test_tools.sh"
           failonerror="true">
-      <env key="AVROJ" value="${build.dir}/avroj-${version}.jar"/>
-      <env key="TMPDIR" value="${test.java.build.dir}/avroj"/>
+      <env key="TOOLS" value="${build.dir}/avro-tools-${version}.jar"/>
+      <env key="TMPDIR" value="${test.java.build.dir}/tools"/>
     </exec>
   </target>
 
@@ -461,17 +465,22 @@
     <fail if="javadoc.warnings">Javadoc warnings!</fail>
   </target>
 
-  <target name="dist" depends="jar, avroj, javadoc"
+  <target name="dist" depends="jar, tools, javadoc"
 	  description="Build distribution">
     <mkdir dir="${dist.dir}"/>
 
     <copy todir="${dist.dir}"> 
       <fileset file="${build.dir}/${fullname}.jar"/>
+      <fileset file="${build.dir}/avro-tools-${version}.jar"/>
     </copy>
+    <chmod file="${dist.dir}/avro-tools-${version}.jar" perm="ugo+x"/>
 
     <checksum file="${dist.dir}/${fullname}.jar" algorithm="md5"/>
     <checksum file="${dist.dir}/${fullname}.jar" algorithm="sha1"/>
 
+    <checksum file="${dist.dir}/avro-tools-${version}.jar" algorithm="md5"/>
+    <checksum file="${dist.dir}/avro-tools-${version}.jar" algorithm="sha1"/>
+
     <ivy:makepom ivyfile="${basedir}/ivy.xml"
 		 pomfile="${dist.dir}/${fullname}.pom">
       <mapping conf="default" scope="compile"/>

Modified: hadoop/avro/trunk/lang/java/ivy.xml
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/ivy.xml?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/ivy.xml (original)
+++ hadoop/avro/trunk/lang/java/ivy.xml Wed Jan 13 23:08:14 2010
@@ -29,7 +29,7 @@
     <conf name="default"/> <!-- "runtime" configuration -->
     <conf name="test"/>
     <conf name="eclipse"/>
-    <conf name="avroj" extends="default"/>
+    <conf name="tools" extends="default"/>
     <conf name="build" extends="default"/>
   </configurations>
 
@@ -38,7 +38,7 @@
         rev="1.4.0"/>
     <dependency org="org.slf4j" name="slf4j-api" rev="1.5.8"/>
     <dependency org="org.slf4j" name="slf4j-simple" rev="1.5.8"
-        conf="test->default;avroj->default"/>
+        conf="test->default;tools->default"/>
     <dependency org="com.thoughtworks.paranamer" name="paranamer"
         rev="2.1"/>
     <dependency org="com.thoughtworks.paranamer" name="paranamer-ant"

Modified: hadoop/avro/trunk/lang/java/src/java/org/apache/avro/specific/SpecificCompiler.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/specific/SpecificCompiler.java?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/java/org/apache/avro/specific/SpecificCompiler.java (original)
+++ hadoop/avro/trunk/lang/java/src/java/org/apache/avro/specific/SpecificCompiler.java Wed
Jan 13 23:08:14 2010
@@ -384,8 +384,7 @@
   }
 
   /**
-   * Implementation of Tool for inclusion by the "avroj"
-   * runner.
+   * Implementation of Tool for inclusion by the "avro-tools" runner.
    */
   public static class SpecificCompilerTool implements Tool {
     @Override

Modified: hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java (original)
+++ hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/GenAvroTool.java Wed Jan 13
23:08:14 2010
@@ -28,7 +28,7 @@
 import java.util.List;
 
 /**
- * Avroj Tool implementation for generating Avro JSON schemata from
+ * Tool implementation for generating Avro JSON schemata from
  * genavro format files.
  */
 public class GenAvroTool implements Tool {

Modified: hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java (original)
+++ hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Main.java Wed Jan 13 23:08:14
2010
@@ -21,6 +21,8 @@
 import java.util.Map;
 import java.util.TreeMap;
 
+import java.io.InputStream;
+
 import org.apache.avro.reflect.InduceSchemaTool;
 import org.apache.avro.specific.SpecificCompiler.SpecificCompilerTool;
 
@@ -72,10 +74,24 @@
           System.in, System.out, System.err, Arrays.asList(args).subList(1, args.length));
       }
     }
+    System.err.print("Version ");
+    printStream(Main.class.getClassLoader().getResourceAsStream("VERSION.txt"));
+    System.err.print(" of ");
+    printStream(Main.class.getClassLoader().getResourceAsStream("NOTICE.txt"));
+    System.err.println("----------------");
+
     System.err.println("Available tools:");
     for (Tool k : tools.values()) {
       System.err.printf("%" + maxLen + "s  %s\n", k.getName(), k.getShortDescription());
     }
+
     return 1;
   }
+
+  private static void printStream(InputStream in) throws Exception {
+    byte[] buffer = new byte[1024];
+    for (int i = in.read(buffer); i != -1; i = in.read(buffer))
+      System.err.write(buffer, 0, i);
+  }
+
 }

Modified: hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Tool.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Tool.java?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Tool.java (original)
+++ hadoop/avro/trunk/lang/java/src/java/org/apache/avro/tool/Tool.java Wed Jan 13 23:08:14
2010
@@ -22,7 +22,7 @@
 import java.util.List;
 
 /**
- * Command-line "avroj" utilities should implement this
+ * Command-line "avro-tools" utilities should implement this
  * interface for delegation by {@link Main}.
  */
 public interface Tool {

Copied: hadoop/avro/trunk/lang/java/src/test/bin/test_tools.sh (from r898919, hadoop/avro/trunk/lang/java/src/test/bin/test_avroj.sh)
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/test/bin/test_tools.sh?p2=hadoop/avro/trunk/lang/java/src/test/bin/test_tools.sh&p1=hadoop/avro/trunk/lang/java/src/test/bin/test_avroj.sh&r1=898919&r2=898991&rev=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/test/bin/test_avroj.sh (original)
+++ hadoop/avro/trunk/lang/java/src/test/bin/test_tools.sh Wed Jan 13 23:08:14 2010
@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Tests "avroj" script and commands.
+# Tests avro-tools commands.
 
 # Echo all commands, so that test failure location is clear.
 set -o xtrace
@@ -27,8 +27,8 @@
   exit 1
 fi
 
-if [ "$AVROJ" = "" ]; then
-  echo "Error: AVROJ is not set."
+if [ "$TOOLS" = "" ]; then
+  echo "Error: TOOLS is not set."
   exit 1
 fi
 
@@ -37,7 +37,7 @@
   exit 1
 fi
 
-CMD="$JAVA_HOME/bin/java -jar $AVROJ"
+CMD="$JAVA_HOME/bin/java -jar $TOOLS"
 
 ######################################################################
 # Clean up temp directory.

Modified: hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
URL: http://svn.apache.org/viewvc/hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java?rev=898991&r1=898990&r2=898991&view=diff
==============================================================================
--- hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
(original)
+++ hadoop/avro/trunk/lang/java/src/test/java/org/apache/avro/ipc/stats/TestStatsPluginAndServlet.java
Wed Jan 13 23:08:14 2010
@@ -144,10 +144,10 @@
   }
 
   /**
-   * Demo program for using RPC stats.  avroj can be used (as below)
+   * Demo program for using RPC stats.  Tool can be used (as below)
    * to trigger RPCs.
    * <pre>
-   * java -jar build/avroj-1.2.0-dev.jar rpcsend '{"protocol":"sleepy","namespace":null,"types":[],"messages":{"sleep":{"request":[{"name":"millis","type":"long"}],"response":"null"}}}'
sleep localhost 7002 '{"millis": 20000}'
+   * java -jar build/avro-tools-*.jar rpcsend '{"protocol":"sleepy","namespace":null,"types":[],"messages":{"sleep":{"request":[{"name":"millis","type":"long"}],"response":"null"}}}'
sleep localhost 7002 '{"millis": 20000}'
    * </pre>
    * @param args
    * @throws Exception



Mime
View raw message