<?xml version="1.0" ?>
<project xmlns:ant="jelly:ant" xmlns:artifact="artifact" >
	<goal name="s2:compile">
		<ant:fileset id="classpath" dir="${lib}">
			<ant:include name="*" />
			<ant:exclude name="s2*" />
		</ant:fileset>

		<ant:javac srcdir="${src}" destdir="${build}" debug="on">
			<ant:classpath>
				<ant:fileset refid="classpath" />
			</ant:classpath>
		</ant:javac>
	</goal>

	<goal name="s2:copy" prereqs="s2:compile">
		<ant:copy todir="${build}">
			<ant:fileset dir="${src}">
				<ant:include name="**/*.properties" />
				<ant:include name="**/*.xml" />
				<ant:include name="**/*.dtd" />
				<ant:exclude name="build.xml" />
			</ant:fileset>
		</ant:copy>
	</goal>

	<goal name="s2:dist" prereqs="s2:compile,s2:copy,s2:cleans2jarfile">
		<ant:jar jarfile="${lib}/${frameworkjarfile}" basedir="${build}" includes="${frameworkpackage}, SSR*.properties, s2*.properties" />
		<ant:jar jarfile="${lib}/${extensionjarfile}" basedir="${build}" includes="${extensionpackage}" />
	</goal>

	<goal name="s2:cleanbuild">
		<ant:delete dir="${lib}/${frameworkpackage}" />
		<ant:delete dir="${lib}/${extensionpackage}" />
	</goal>

	<goal name="s2:clean" prereqs="s2:cleanbuild">
		<ant:delete file="${lib}/${frameworkjarfile}" />
		<ant:delete file="${lib}/${extensionjarfile}" />
	</goal>

	<goal name="s2:cleans2jarfile">
		<ant:delete>
			<ant:fileset dir="${lib}" defaultexcludes="no">
				<ant:include name="s2*.jar" />
			</ant:fileset>
		</ant:delete>
	</goal>

	<goal name="s2:setup" prereqs="dist">
		<ant:delete>
			<ant:fileset dir="${setupdir}" />
		</ant:delete>
		<ant:copy todir="${setupdir}">
			<ant:fileset dir=".">
				<ant:exclude name="**/CVS/**" />
				<ant:exclude name="${build}/**" />
				<ant:exclude name="${lib}/classes12.zip" />
			</ant:fileset>
		</ant:copy>
		<ant:delete dir="${setupdir}build"/>
		<ant:mkdir dir="${setupdir}build"/>
		<ant:zip zipfile="${releasejarfile}" basedir="../setup2" includes="seasar2/"/>
	</goal>


	<goal name="s2-framework:install">
		<attainGoal name="s2:dist" /> 
		<artifact:install
			artifact= "${lib}/${frameworkjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-framework:deploy">
		<attainGoal name="s2:dist" /> 
		<artifact:deploy 
			artifact= "${lib}/${frameworkjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-framework:install-snapshot">
		<attainGoal name="s2:dist" /> 
		<artifact:install-snapshot 
			artifact= "${lib}/${frameworkjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-framework:deploy-snapshot">
		<attainGoal name="s2:dist" /> 
		<artifact:deploy-snapshot
			artifact= "${lib}/${frameworkjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-extension:install">
		<attainGoal name="s2:dist" /> 
		<artifact:install
			artifact= "${lib}/${extensionjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-extension:deploy">
		<attainGoal name="s2:dist" /> 
		<artifact:deploy 
			artifact= "${lib}/${extensionjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-extension:install-snapshot">
		<attainGoal name="s2:dist" /> 
		<artifact:install-snapshot 
			artifact= "${lib}/${extensionjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

	<goal name="s2-extension:deploy-snapshot">
		<attainGoal name="s2:dist" /> 
		<artifact:deploy-snapshot 
			artifact= "${lib}/${extensionjarfile}"
			type= "jar" 
			project= "${pom}" /> 
	</goal>

</project>
