<?xml version="1.0"?> <project basedir="." default="jar"> <!-- JiBX binding compiler task definition --> <property environment="env"/> <property name="jibxhome" value="${env.JIBX_HOME}"/> <taskdef name="bind" classname="org.jibx.binding.ant.CompileTask"> <classpath> <pathelement location="${jibxhome}/lib/bcel.jar"/> <pathelement location="${jibxhome}/lib/jibx-bind.jar"/> <pathelement location="${jibxhome}/lib/jibx-run.jar"/> <pathelement location="${jibxhome}/lib/jibx-extras.jar"/> <pathelement location="${jibxhome}/lib/xpp3.jar"/> </classpath> </taskdef> <!-- compile the class files --> <target name="compile"> <delete quiet="true" dir="${basedir}/classes"/> <mkdir dir="${basedir}/classes"/> <javac srcdir="${basedir}/src/main" destdir="${basedir}/classes" excludes="org/jibx/xsd2jibx/GeneratorAntTask.java" debug="true" deprecation="on"> <classpath> <fileset dir="${basedir}/lib"> <include name="*.jar"/> </fileset> <fileset dir="${jibxhome}/lib"> <include name="jibx-run.jar"/> <include name="xpp3.jar"/> </fileset> </classpath> </javac> <copy todir="${basedir}/classes/org/jibx/xsd2jibx"> <fileset dir="${basedir}/src/main/org/jibx/xsd2jibx" includes="**/*.xsl"/> </copy> </target> <!-- bind the class files --> <target name="bind" depends="compile"> <echo message="Running binding compiler..."/> <bind verbose="true" load="true"> <bindingfileset dir="${basedir}/src/main/org/jibx/xsd2jibx"> <include name="xsd.jibx.xml"/> <include name="jibx.jibx.xml"/> </bindingfileset> <classpathset dir="${basedir}/classes"/> </bind> </target> <!-- Build the jar files for the distribution --> <target name="jar" depends="bind"> <delete file="${basedir}/lib/xsd2jibx.jar" quiet="true"/> <jar jarfile="${basedir}/lib/xsd2jibx.jar" basedir="${basedir}/classes"> <manifest> <attribute name="Main-Class" value="org/jibx/xsd2jibx/Generate"/> <attribute name="Class-Path" value="commons-lang-2.0.jar commons-logging-1.0.4.jar jaxme-js-0.3.jar log4j-1.2.8.jar jibx-run.jar xpp3.jar"/> </manifest> </jar> </target> </project>