<?xml version="1.0" encoding="Shift_JIS" ?>
<project name="JunkUtil" default="test" basedir="../">
	<property name="src" value="src" />
	<property name="test" value="test" />
	<property name="bin" value="bin" />
	<property name="testbin" value="testbin" />
	<property name="lib" value="lib" />
	<property name="build" value="build" />
	<property name="release" value="release" />
	<property name="javadoc" value="javadoc" />
	<property name="version" value="1.0.9" />
	<tstamp />

	<target name="buildSrc">
		<delete dir="${bin}"/>
		<mkdir dir="${bin}"/>
		<javac srcdir="${src}" destdir="${bin}" debug="on">
			<classpath>
				<pathelement location="${lib}/poi-3.7-20101029.jar"/>
			</classpath>
		</javac>
	</target>

	<target name="buildTest"  depends="buildSrc">
		<delete dir="${testbin}"/>
		<mkdir dir="${testbin}"/>
		<javac srcdir="${test}" destdir="${testbin}" debug="on">
			<classpath>
				<pathelement location="${bin}"/>
				<pathelement location="${lib}/poi-3.7-20101029.jar"/>
				<pathelement location="${lib}/junit-4.8.1.jar"/>
			</classpath>
		</javac>
	</target>

	<target name="test" depends="buildTest">
		<junit haltonfailure="false" fork="true" printsummary="yes" dir="${basedir}">
			<!--formatter type="plain"/-->
			<classpath>
				<pathelement location="${bin}"/>
				<pathelement location="${testbin}"/>
				<pathelement location="${lib}/poi-3.7-20101029.jar"/>
				<pathelement location="${lib}/junit-4.8.1.jar"/>
			</classpath>
			<test name="junkutil.common.DataDumperTest"/>
			<test name="junkutil.common.OptGetsTest"/>
			<test name="junkutil.common.StringUtilTest"/>
			<test name="junkutil.common.FileUtilTest"/>
			<!--test name="junkutil.android.AndroidFileUtilTest"/-->
			<test name="junkutil.common.NullUtilTest"/>
			<test name="junkutil.common.ConfigTest"/>
			<test name="junkutil.crypt.MD5Test"/>
			<test name="junkutil.crypt.DESTest"/>
			<test name="junkutil.excel.ExcelUtilTest"/>
			<test name="junkutil.excel.CSVTest"/>
			<test name="junkutil.set.LzListTest"/>
			<test name="junkutil.set.LzMapTest"/>
			<test name="junkutil.text.RegExpUtilTest"/>
		</junit>
		<echo>All Test Completed.</echo>
	</target>

	<target name="javadoc" depends="buildSrc">
		<echo message="Javadocģ¬" />
		<delete dir="${javadoc}" />
		<mkdir dir="${javadoc}" />
		<javadoc packagenames="*" sourcepath="${src}" destdir="${javadoc}" encoding="Shift_JIS" charset="Shift_JIS">
			<classpath>
				<fileset dir="${lib}">
					<include name="*.jar" />
				</fileset>
			</classpath>
		</javadoc>
	</target>

	<target name="release" depends="buildSrc">
		<delete dir="${release}" />
		<mkdir dir="${release}" />
		<!--jar jarfile="${release}/junkutil-${DSTAMP}.jar" basedir="${bin}" manifest="${build}/META-INF/MANIFEST.MF"-->
		<jar jarfile="${release}/junkutil-${version}.jar" basedir="${bin}" manifest="${build}/META-INF/MANIFEST.MF">
		</jar>
	</target>

	<target name="zip" depends="release,javadoc">
		<!--zip destfile="junkutil-${DSTAMP}.zip"-->
		<zip destfile="junkutil-${version}.zip">
			<fileset dir="." includes="build/**"/>
			<fileset dir="." includes="src/**"/>
			<fileset dir="." includes="test/**"/>
			<fileset dir="." includes="testdata/**"/>
			<fileset dir="." includes="lib/**"/>
			<fileset dir="." includes="release/**"/>
			<fileset dir="." includes="javadoc/**"/>
			<fileset dir="${build}" includes="README.txt"/>
			<fileset dir="${build}" includes="LICENSE.txt"/>
			<fileset dir="${build}" includes="CHANGELOG.txt"/>
		</zip>
		<tar destfile="junkutil-${version}.tar.gz" compression="gzip">
			<tarfileset dir="." includes="build/**"/>
			<tarfileset dir="." includes="src/**"/>
			<tarfileset dir="." includes="test/**"/>
			<tarfileset dir="." includes="testdata/**"/>
			<tarfileset dir="." includes="lib/**"/>
			<tarfileset dir="." includes="release/**"/>
			<tarfileset dir="." includes="javadoc/**"/>
			<tarfileset dir="${build}" includes="README.txt"/>
			<tarfileset dir="${build}" includes="LICENSE.txt"/>
			<tarfileset dir="${build}" includes="CHANGELOG.txt"/>
		</tar>
		<copy file="${release}/junkutil-${version}.jar" todir="."/>
	</target>
</project>