60 lines
2.0 KiB
XML
60 lines
2.0 KiB
XML
<project name="castorBuild" default="main" basedir=".">
|
|
|
|
<property name="jarName" value="${dest.jar}"/>
|
|
<property name="packageName" value="${rootPackage}"/>
|
|
<property name="xsd.files" value="${xsdDir}"/>
|
|
|
|
<property name="temp.class.path" value="./temp-class"/>
|
|
<property name="temp.source.path" value="./temp-source"/>
|
|
<property name="jar.path" value="./xml-generated-jar"/>
|
|
<property name="lib.dir" value="lib"/>
|
|
|
|
<path id="castor.util.path">
|
|
<fileset dir="${lib.dir}" includes="**/*.jar"/>
|
|
</path>
|
|
|
|
<!-- target di default-->
|
|
<target name="main" depends="javaCompile">
|
|
<echo>BUILDING.....</echo>
|
|
<jar destfile="${jar.path}/${dest.jar}">
|
|
<fileset dir="${temp.class.path}" includes="**/*.class"/>
|
|
<fileset dir="${temp.source.path}" includes="**/*.castor.cdr"/>
|
|
</jar>
|
|
<delete dir="${temp.class.path}"/>
|
|
<delete dir="${temp.source.path}"/>
|
|
</target>
|
|
|
|
<!-- compilazione sorgenti -->
|
|
<target name="javaCompile" depends="castor:gen:src">
|
|
<javac srcdir="${temp.source.path}" destdir="${temp.class.path}" debug="on" deprecation="off" failonerror="true">
|
|
<!-- <classpath refid="all.classpath"/> -->
|
|
<classpath refid="castor.util.path"/>
|
|
</javac>
|
|
</target>
|
|
|
|
<!-- binding degli xsd -->
|
|
<target name="castor:gen:src" depends="init" description="Generate Java source files from XSD.....">
|
|
<taskdef name="castor-srcgen"
|
|
classname="org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask" classpathref="castor.util.path" />
|
|
|
|
<castor-srcgen todir="${temp.source.path}"
|
|
package="${packageName}"
|
|
types="j2"
|
|
warnings="false" >
|
|
<fileset dir="${xsd.files}">
|
|
<include name="**/*.xsd"/>
|
|
</fileset>
|
|
</castor-srcgen>
|
|
</target>
|
|
|
|
<!-- creazione cartelle -->
|
|
<target name="init">
|
|
<delete dir="${temp.source.path}"/>
|
|
<delete dir="${temp.class.path}"/>
|
|
<delete dir="${jar.path}"/>
|
|
<mkdir dir="${temp.source.path}"/>
|
|
<mkdir dir="${temp.class.path}"/>
|
|
<mkdir dir="${jar.path}"/>
|
|
</target>
|
|
|
|
</project> |