<project name="s2dao" default="dist" basedir=".">

	<property file="project.properties" />
	
	<fileset id="classpath" dir="${lib}">
		<include name="*" />
	</fileset>

	<target name="compile">
		<javac srcdir="${src}" destdir="${build}" debug="on">
			<classpath>
				<fileset refid="classpath" />
			</classpath>
		</javac>
	</target>

	<target name="copy" depends="compile">
		<copy todir="${build}">
			<fileset dir="${src}">
				<include name="**/*.properties" />
				<include name="**/*.xml" />
				<include name="**/*.dtd" />
				<exclude name="build.xml" />
			</fileset>
		</copy>
	</target>

	<target name="dist" depends="compile,copy,cleantargetjarfile">
		<jar jarfile="${lib}/${jarfile}" basedir="${build}" includes="${package}, DAO*.properties, dbms.properties" />
	</target>

	<target name="cleanbuild">
		<delete dir="${build}/${package}" />
	</target>

	<target name="clean" depends="cleanbuild">
		<delete file="${dist}/${jarfile}" />
	</target>

	<target name="cleantargetjarfile">
		<delete>
			<fileset dir="${lib}" defaultexcludes="no">
				<include name="s2-dao-*.jar" />
			</fileset>
		</delete>
	</target>

	<target name="setup" depends="dist">
		<delete>
			<fileset dir="${setupdir}" />
		</delete>
		<copy todir="${setupdir}">
			<fileset dir=".">
				<exclude name="**/CVS/**" />
				<exclude name="${build}/**" />
				<exclude name="doc/**" />
			</fileset>
			<fileset dir="../seasar2/">
				<include name="doc/" />
			</fileset>
		</copy>
		<delete dir="${setupdir}build" />
		<mkdir dir="${setupdir}build" />
		<zip zipfile="${releasejarfile}" basedir="../setup2" includes="s2dao/" />
	</target>

</project>

