<?xml version="1.0"?>

<project name="portal-test-tomcat" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
	<import file="build-test.xml" />

	<target name="prepare-db-sharding">
		<echo file="create-mysql-sharded.sql">drop database if exists lportal;
create database lportal character set utf8;

drop database if exists lportal1;
create database lportal1 character set utf8;

drop database if exists lportal2;
create database lportal2 character set utf8;</echo>

		<exec executable="cmd.exe">
			<arg line="/c mysql &lt; create-mysql-sharded.sql" />
		</exec>

		<delete file="create-mysql-sharded.sql" />
	</target>

	<target name="prepare-sharding-properties">
		<echo file="portal-impl/src/portal-ext.properties" append="true"><![CDATA[

jdbc.one.driverClassName=com.mysql.jdbc.Driver
jdbc.one.url=jdbc:mysql://${db.mysql.host}/lportal1?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.one.username=
jdbc.one.password=

jdbc.two.driverClassName=com.mysql.jdbc.Driver
jdbc.two.url=jdbc:mysql://${db.mysql.host}/lportal2?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.two.username=
jdbc.two.password=

spring.configs=\
	META-INF/base-spring.xml,\
	\
	META-INF/hibernate-spring.xml,\
	META-INF/infrastructure-spring.xml,\
	META-INF/management-spring.xml,\
	\
	META-INF/util-spring.xml,\
	\
	META-INF/jpa-spring.xml,\
	\
	META-INF/executor-spring.xml,\
	\
	META-INF/audit-spring.xml,\
	META-INF/cluster-spring.xml,\
	META-INF/editor-spring.xml,\
	META-INF/jcr-spring.xml,\
	META-INF/ldap-spring.xml,\
	META-INF/messaging-core-spring.xml,\
	META-INF/messaging-misc-spring.xml,\
	META-INF/mobile-device-spring.xml,\
	META-INF/notifications-spring.xml,\
	META-INF/poller-spring.xml,\
	META-INF/rules-spring.xml,\
	META-INF/scheduler-spring.xml,\
	META-INF/scripting-spring.xml,\
	META-INF/search-spring.xml,\
	META-INF/workflow-spring.xml,\
	\
	META-INF/counter-spring.xml,\
	META-INF/mail-spring.xml,\
	META-INF/portal-spring.xml,\
	META-INF/portlet-container-spring.xml,\
	META-INF/staging-spring.xml,\
	META-INF/virtual-layouts-spring.xml,\
	\
	META-INF/dynamic-data-source-spring.xml,\
	META-INF/shard-data-source-spring.xml,\
	#META-INF/memcached-spring.xml,\
	#META-INF/monitoring-spring.xml,\
	\
	META-INF/ext-spring.xml]]></echo>
	</target>
</project>