Author: jens
Date: Thu Dec  2 16:34:16 2010
New Revision: 1041437

URL: http://svn.apache.org/viewvc?rev=1041437&view=rev
Log:
improve build, fix usage

Added:
    incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/start.bat
Modified:
    incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/build.xml
    
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/src/java/org/apache/chemistry/opencmis/orderly/validate/Validator.java

Modified: 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/build.xml
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/build.xml?rev=1041437&r1=1041436&r2=1041437&view=diff
==============================================================================
--- 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/build.xml 
(original)
+++ 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/build.xml 
Thu Dec  2 16:34:16 2010
@@ -37,15 +37,19 @@
        
     <!-- Path settings used for classpath and execution  -->
     <path id="base.path">
-      <pathelement path="${classpath}"/>
+        <pathelement path="${classpath}"/>
            <fileset dir="${antlr.jar.dir}">
                  <include name="${antlr.jar.file}"/>           
            </fileset>
                
-        <fileset dir="${jackson.dir}">
+        <fileset id="jackson.jars" dir="${jackson.dir}">
           <include name="jackson-core-asl-1.5.6.jar" />
           <include name="jackson-mapper-asl-1.5.6.jar" />
         </fileset>
+       
+       <fileset id="lib.jars" dir="lib">
+               <include name="*.jar" />
+       </fileset>
       <!-- <pathelement location="$classes"/> -->
     </path>
 
@@ -53,11 +57,9 @@
          compilation, jar creation and running of the tests -->
     <target name="clean">
         <delete dir="${build.dir}"/>
+       <delete file="OrderlyValidator.zip"/>
     </target>
 
-    <property name="antlr.libdir" location="./antlr3" />
-    
-    <property name="antlr.libdir" location="./antlr3" />
     <patternset id="antlr.libs">
         <include name="antlr-3.2.jar" />
     </patternset>
@@ -79,8 +81,8 @@
                report="false"
                profile="false">
         </antlr:antlr3>
-    </target>
-       
+    </target>  
+       
     <target name="compile" depends="antlr">
         <mkdir dir="${classes.dir}"/>
         <javac srcdir="${antgen.src.dir}" destdir="${classes.dir}">
@@ -95,17 +97,28 @@
         <mkdir dir="${jar.dir}"/>
         <jar destfile="${jar.dir}/${ant.project.name}.jar" 
basedir="${classes.dir}">
 <!--           
-            <manifest>
-                <attribute name="Main-Class" value="${main-class}"/>
+        <manifest>
+            <attribute name="Main-Class" value="${main-class}"/>
                        <attribute name="Class-Path" value="${antlr.jar}" />
                </manifest>
 -->            
            <fileset dir="${antgen.src.dir}" />
         </jar>
     </target>
+       
+    <property name="maven-repo.dir" value="C:/Java/maven-repository"/>
 
-    <target name="run" depends="jar">
-           <java jar="${jar.dir}/${ant.project.name}.jar" fork="true" 
input="${test-file}"/>
+    <target name="package" depends="jar">
+         <zip destfile="OrderlyValidator.zip">
+               <zipfileset refid="jackson.jars" prefix="lib"/>
+           <zipfileset dir="${jar.dir}" includes="${ant.project.name}.jar" 
fullpath="lib/${ant.project.name}.jar"/>
+           <zipfileset dir="${maven-repo.dir}/org/antlr/antlr-runtime/3.2" 
includes="antlr-runtime-3.2.jar" prefix="lib"/>
+           <zipfileset dir="${maven-repo.dir}/org/slf4j/slf4j-api/1.5.11" 
includes="slf4j-api-1.5.11.jar" prefix="lib"/>
+           <zipfileset 
dir="${maven-repo.dir}/ch/qos/logback/logback-classic/0.9.20/" 
includes="logback-classic-0.9.20.jar" prefix="lib"/>
+           <zipfileset 
dir="${maven-repo.dir}/ch/qos/logback/logback-core/0.9.20/" 
includes="logback-core-0.9.20.jar" prefix="lib"/>
+               <zipfileset dir="lib" 
includes="json-schema-validator-0.0.1-SNAPSHOT.jar" prefix="lib"/>
+               <zipfileset dir="." includes="start.bat" />
+         </zip>
     </target>
 
     <target name="clean-build" depends="clean,jar"/>

Modified: 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/src/java/org/apache/chemistry/opencmis/orderly/validate/Validator.java
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/src/java/org/apache/chemistry/opencmis/orderly/validate/Validator.java?rev=1041437&r1=1041436&r2=1041437&view=diff
==============================================================================
--- 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/src/java/org/apache/chemistry/opencmis/orderly/validate/Validator.java
 (original)
+++ 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/src/java/org/apache/chemistry/opencmis/orderly/validate/Validator.java
 Thu Dec  2 16:34:16 2010
@@ -121,7 +121,7 @@ public class Validator {
     public static void usage() {
             System.out.println("Usage: Validator transform <file-name>");
             System.out.println("       Transform orderly file <file-name> to 
json-schema");
-            System.out.println("Usage: Validator vaildate <json-file-name> 
<orderly-file-name>");
+            System.out.println("Usage: Validator validate <json-file-name> 
<orderly-file-name>");
             System.out.println("       Validate json-file <file-name> against 
orderly schema <orderly-file-name>");
             System.exit(1);
     }
@@ -150,6 +150,8 @@ public class Validator {
              String jsonFile = args[1];
              String schemaFile = args[2];
              validate(jsonFile, schemaFile);
+         } else {
+             usage();
          }
     }
 

Added: 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/start.bat
URL: 
http://svn.apache.org/viewvc/incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/start.bat?rev=1041437&view=auto
==============================================================================
--- 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/start.bat 
(added)
+++ 
incubator/chemistry/playground/chemistry-opencmis-orderlyvalidator/start.bat 
Thu Dec  2 16:34:16 2010
@@ -0,0 +1,2 @@
+call _setenv.bat
+java -cp "lib/*" org.apache.chemistry.opencmis.orderly.validate.Validator %*
\ No newline at end of file


Reply via email to