<project name="s2-dist" default="dist" basedir=".">
	<tstamp>
		<format property="releaseDate" pattern="yyyy-MM-dd" locale="ja,JP"/>
	</tstamp>
	<property name="zipDir" value="target/site/download/${releaseDate}"/>

	<target name="dist">
		<ant antfile="../build.xml" target="fix-site">
			<property name="site" value="${basedir}/target/site"/>
		</ant>
		<mkdir dir="${zipDir}"/>
		<zip zipfile="${zipDir}/S${ver}.zip">
			<zipfileset prefix="seasar2" dir="..">
				<exclude name="**/build/**"/>
				<exclude name="**/target/**"/>
				<exclude name="**/site/**"/>
				<exclude name="dbf/**"/>
				<exclude name="src/**"/>
			</zipfileset>
			<zipfileset prefix="seasar2/lib" dir="../s2-framework/target">
				<include name="s2-framework-${ver}.jar"/>
			</zipfileset>
			<zipfileset prefix="seasar2/lib" dir="../s2-extension/target">
				<include name="s2-extension-${ver}.jar"/>
			</zipfileset>
			<zipfileset prefix="seasar2/lib/sources" dir="../s2-framework/target">
				<include name="s2-framework-${ver}-sources.jar"/>
			</zipfileset>
			<zipfileset prefix="seasar2/lib/sources" dir="../s2-extension/target">
				<include name="s2-extension-${ver}-sources.jar"/>
			</zipfileset>
			<zipfileset prefix="seasar2/resources" dir="../s2-framework/src/test/resources">
				<include name="convention.dicon"/>
				<include name="creator.dicon"/>
				<include name="customizer.dicon"/>
				<include name="log4j.properties"/>
			</zipfileset>
			<zipfileset prefix="seasar2/resources" dir="../s2-extension/src/test/resources">
				<include name="jdbc.dicon"/>
				<include name="dbsession.dicon"/>
			</zipfileset>
			<zipfileset prefix="seasar2/doc" dir="../target/site">
				<exclude name="**/download/**"/>
				<exclude name="**/ja/benchmark/**"/>
				<exclude name="**/ja/demo/**"/>
				<exclude name="**/*.zip"/>
			</zipfileset>
			<zipfileset prefix="seasar2/doc/s2-framework" dir="../s2-framework/target/site"/>
			<zipfileset prefix="seasar2/doc/s2-extension" dir="../s2-extension/target/site"/>
		</zip>
		<ant dir="../../s2jdbc-tutorial" antfile="build.xml" target="dist">
			<property name="zipDir" value="../seasar2/s2-dist/${zipDir}"/>
		</ant>
	</target>
</project>
