<?xml version="1.0"?>

<project name="CastorExample" default="castor-gen-src" basedir=".">

    <!-- ****************** Project Standard Properties ******************* -->
    <property environment="env" />

	<property name="castor.sarv.configuration.dir" location="${basedir}/conf"/>

    <!-- =================================================================== -->
    <!-- Building some pathes                                                -->
    <!-- =================================================================== -->
    <path id="castor.classpath">
        <pathelement location="${basedir}/lib/castor-1.0.1-xml.jar" />
        <pathelement location="${basedir}/lib/castor-1.0.1-srcgen-ant-task.jar" />
    </path>
    <path id="commons.classpath">
        <pathelement location="${basedir}/lib/commons-logging-1.1.jar" />
    </path>
<!-- Weblogic library for modified xerces parser
    <path id="weblogic.classpath">
        <pathelement location="${basedir}/lib/weblogic.jar" />
    </path>
-->
	<path id="build.classpath">
        <path refid="castor.classpath" />
        <path refid="commons.classpath" />
<!--
        <path refid="weblogic.classpath" />
-->
	</path>

	<target name="init">
        <tstamp />
    </target>

	<target name="castor-gen-src" depends="init"
	             description="Generate Java source files from XSD.">

		<echo message="${castor.sarv.configuration.dir}/castor.properties"></echo>
	    <taskdef name="castor-srcgen"
	                classname="org.exolab.castor.tools.ant.taskdefs.CastorSourceGenTask"
	                classpathref="build.classpath" />
	    <mkdir dir="generated" />
	    <castor-srcgen file="${castor.sarv.configuration.dir}/test.xsd"
	                      todir="generated"
	                      package="de.test.castor.example.schema"
	                      types="j2"
				          warnings="true"
	    	bindingfile="${castor.sarv.configuration.dir}/binding.xml"

	    	
			properties="${castor.sarv.configuration.dir}/castor.properties"/>
<!--	    only working if 
	you copy ${castor.sarv.configuration.dir}/castor.properties to ${basedir}
	
	    properties="castor.properties"/>
		properties="${castor.sarv.configuration.dir}/castor.properties"/>
-->
	</target>
	
</project>
