<project name="seasar2" default="dist" basedir=".">
	<tstamp>
		<format property="releaseDate" pattern="yyyy-MM-dd" locale="ja,JP"/>
	</tstamp>
	<property name="newVersion" value="2.4.49-SNAPSHOT" />

	<target name="update-pom">
		<replaceregexp
			match="(&lt;artifactId&gt;s2-container-project&lt;/artifactId&gt;\s*&lt;version&gt;)(?:[^&lt;]+)(&lt;/version&gt;)"
			replace="\1${newVersion}\2" encoding="UTF-8">
			<fileset dir="." includes="**/pom.xml" />
			<fileset dir="../s2-tiger" includes="**/pom.xml" />
			<fileset dir="../s2jdbc-it" includes="**/pom.xml" />
			<fileset dir="../s2jdbc-tutorial" includes="**/pom.xml" />
			<fileset dir="../s2jdbc-gen" includes="**/pom.xml" />
			<fileset dir="../s2jdbc-gen-it" includes="**/pom.xml" />
		</replaceregexp>
	</target>

	<target name="dist">
		<antcall target="fix-site">
			<param name="site" value="${basedir}/target/site"/>
		</antcall>
	</target>

	<target name="make-reference">
		<ant antfile="build.xml" dir="src/docbook" target="build" />
		<mkdir dir="target/site/ja/reference" />
		<copy todir="target/site/ja/reference">
			<fileset dir="target/docbook/reference">
				<exclude name="tmp/**" />
			</fileset>
		</copy>
	</target>

	<target name="fix-site">
		<mkdir dir="${site}/en"/>
		<move todir="${site}/en">
			<fileset dir="${site}">
				<exclude name="apidocs/**"/>
				<exclude name="en/**"/>
				<exclude name="ja/**"/>
				<exclude name="zh/**"/>
				<exclude name="index.html.en"/>
				<exclude name="index.html.ja"/>
			</fileset>
		</move>
		<move file="${site}/apidocs" todir="${site}/ja" failonerror="false"/>
		<delete file="${site}/ja/index.html.en"/>
		<delete file="${site}/ja/index.html.ja"/>
	</target>
</project>
