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

	<property name="src" value="src" />
	<property name="build" value="build" />
	<property name="ver" value="RC6" />

	<property name="jarfile" value="s2-jsf-${ver}.jar" />
	<property name="package" value="org/seasar/jsf/" />
	<property name="releasejarfile" value="../setup2/S2JSFV${ver}.zip" />
	<property name="lib" value="lib" />
	<property name="setupdir" value="../setup2/s2jsf/" />

	<fileset id="classpath" dir="${lib}">
		<include name="*" />
		<exclude name="s2*" />
	</fileset>
	<fileset id="s2classpath" dir="../seasar2/lib">
		<include name="*" />
	</fileset>

	<target name="compile">
		<javac srcdir="${src}" destdir="${build}" debug="on">
			<classpath>
				<fileset refid="classpath" />
				<fileset refid="s2classpath" />
			</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,cleanjarfile">
		<jar jarfile="${lib}/${jarfile}" basedir="${build}" includes="${package}, META-INF/" />
	</target>

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

	<target name="setup" depends="dist">
		<delete includeemptydirs="true">
			<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="s2jsf/"/>
	</target>

</project>

