JAL-3063 - ant task for regenerating JAXB schema - could be optimised further
authorJim Procter <jprocter@issues.jalview.org>
Wed, 9 Jan 2019 16:16:45 +0000 (16:16 +0000)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 9 Jan 2019 16:16:45 +0000 (16:16 +0000)
.ant-targets-build.xml
build.xml

index 15432a1..ed220f3 100644 (file)
@@ -9,6 +9,7 @@ compileApplet
 distclean
 help
 init
+jaxb-bindings
 linkcheck
 makeApplet
 makedist
index 5ca105a..bed6d68 100755 (executable)
--- a/build.xml
+++ b/build.xml
   <delete file="in.jar" />
 </target>
 
+<target name="jaxb-bindings" depends="init" description="Generates JAXB bindings for supported Jalview XML models (needs xjc on the path)">
+  <delete>
+    <fileset dir="${sourceDir}/jalview/xml/binding/jalview">
+      <include name="*.java" />
+    </fileset>
+  </delete>
+  <exec executable="xjc">
+    <arg value="${schemaDir}/jalview.xsd"/>
+    <arg value="-d"/>
+    <arg value="${sourceDir}"/>
+    <arg value="-p"/>
+    <arg value="jalview.xml.binding.jalview"/>
+  </exec>
+  <delete>
+    <fileset dir="${sourceDir}/jalview/xml/binding/embl">
+      <include name="*.java" />
+    </fileset>
+  </delete>
+
+  <exec executable="xjc">
+    <arg value="${schemaDir}/embl.xsd"/>
+    <arg value="-d"/>
+    <arg value="${sourceDir}"/>
+    <arg value="-b"/>
+    <arg value="${schemaDir}/embl_bindings.xml"/>
+    <arg value="-p"/>
+    <arg value="jalview.xml.binding.embl"/>
+  </exec>
+
+  <delete>
+    <fileset dir="${sourceDir}/jalview/xml/binding/uniprot">
+      <include name="*.java" />
+    </fileset>
+  </delete>
+
+  <exec executable="xjc">
+    <arg value="${schemaDir}/uniprot.xsd"/>
+    <arg value="-d"/>
+    <arg value="${sourceDir}"/>
+    <arg value="-p"/>
+    <arg value="jalview.xml.binding.uniprot"/>
+  </exec>
+</target>
+
 <target name="castorbinding" depends="init" description="Generate Java bindings to supported Jalview XML models.">
   <taskdef name="castor-srcgen" classname="org.castor.anttask.CastorCodeGenTask" classpathref="build.classpath" />
   <delete>