<?xml version="1.0" encoding="UTF-8"?>


<project name="kxml2" default="build" basedir=".">

  <property name="version" value="2.3.0" />	
	
  
  <target name="javadoc">
    <delete dir="www/kxml2/javadoc"/>
    <mkdir dir="www/kxml2/javadoc"/>    
    <javadoc packagenames="org.kxml2.*" classpath="lib/xmlpull_1_1_3_1.jar"
             public="yes"
             sourcepath="src"
             destdir="www/kxml2/javadoc"
             author="true"
             version="true"
             use="true"
             windowtitle="kxml API"
             doctitle="kxml API"
    />
  </target>
  
    
    <target name="build_src" depends="build_jar,javadoc">
		<zip zipfile="dist/kxml2-src-${version}.zip">
		  <fileset dir=".">
		    <include name="*/**" />
		    <exclude name=".*" />
		    <exclude name="classes/**" />
		    <exclude name="tmpclasses/**" />
		    <exclude name="dist/kxml2-src-*.zip"/>
		   </fileset>
		</zip>    
    
    </target>


    <target name="build_jar">

    	<delete dir="tmpclasses"/>
    	<mkdir dir="tmpclasses"/>

    	<unzip src="lib/xmlpull_1_1_3_1.jar" dest="tmpclasses" overwrite="true"/>
    
    <!-- 	       debug="off" -->
    	
    	<javac srcdir="src" verbose="true"
    	       destdir="tmpclasses"
    	       optimize="true"
    		   target="1.2"
    		   source="1.2"
    	       debuglevel="none"/>
	
        <mkdir dir="dist"/>
            
    	
		<jar jarfile="dist/kxml2-${version}.jar" >
			<fileset dir="tmpclasses">
				<include name="**/*.class"/>
				<include name="META-INF/**"/>
			</fileset>
			<fileset dir="src">
				<include name="META-INF/**"/>
			</fileset>			
		</jar>

		<jar jarfile="dist/kxml2-min-${version}.jar">
			<fileset dir="tmpclasses">
		<!--		<include name="META-INF/**"/>  -->
				<include name="org/xmlpull/v1/XmlPullParser.class"/>
				<include name="org/xmlpull/v1/XmlPullParserException.class"/>
				<include name="org/kxml2/io/KXmlParser.class"/>
			</fileset>
		</jar>

    	<delete dir="tmpclasses"/>
	</target>


    <target name="build" depends="build_src" />

	
    
</project>
