<?xml version="1.0" encoding="UTF-8"?>
<project name="s2jdbc-it" default="check-database" basedir=".">

	<taskdef name="exec-sql" classname="org.seasar.extension.jdbc.it.util.ExecuteSqlTask" classpath="${classpath}"/>

	<target name="setup-data" if="isTargetDatabase" depends="check-database">
		<exec-sql 
			haltOnError="false"
			sqlFile="sql/drop_${database}.sql"/>
		<exec-sql 
			haltOnError="true"
			sqlFile="sql/create_${database}.sql"/>
	</target>

	<target name="check-database">
		<echo message="database=${database}"/>
		<condition property="isTargetDatabase">
			<or>
				<equals arg1="${database}" arg2="db2"/>
				<equals arg1="${database}" arg2="mssql2005"/>
				<equals arg1="${database}" arg2="mysql"/>
				<equals arg1="${database}" arg2="oracle"/>
				<equals arg1="${database}" arg2="postgre"/>
			</or>
		</condition>
	</target>

</project>
