<project name="Quickstart_bpel_atm" default="deploy" basedir=".">

	<description>${ant.project.name}</description>

	<!-- Import the base Ant build script... -->
	<property file="../../../install/deployment.properties" />

	<property name="version" value="1" />

	<property name="server.dir"
	          value="${org.jboss.as.home}/server/${org.jboss.as.config}" />
	<property name="conf.dir" value="${server.dir}/conf" />
	<property name="deploy.dir" value="${server.dir}/deploy" />
	<property name="server.lib.dir" value="${server.dir}/lib" />

	<property name="sample.jar.name" value="${ant.project.name}-${version}.jar" />
	<property name="war.build.dir" location="build/war/classes" />

	<path id="compile-classpath">
		<pathelement location="${org.jboss.as.home}/client/jboss-javaee.jar" />
	</path>

	<target name="makewar" description="make war">
		<!-- Compile... -->
		<mkdir dir="${war.build.dir}" />
		<javac srcdir="war/src"
		       destdir="${war.build.dir}"
		       target="1.5"
		       debug="true">
			<classpath refid="compile-classpath" />
		</javac>
		<copy todir="${war.build.dir}">
			<fileset dir="war/src" includes="**/*.xml" />
		</copy>

		<!-- War... -->
		<war warfile="build/${ant.project.name}.war"
		     webxml="${basedir}/war/resources/WEB-INF/web.xml">
			<classes dir="${war.build.dir}" />
		</war>
	</target>

	<target name="deploywar" depends="makewar">
		<copy todir="${deploy.dir}" file="build/${ant.project.name}.war" />
	</target>

	<target name="undeploywar">
		<delete file="${deploy.dir}/${ant.project.name}.war" />
	</target>

	<target name="deploy" depends="deploywar">
		<echo>Deploy ${ant.project.name}</echo>
		<jar basedir="bpel" destfile="${deploy.dir}/${sample.jar.name}" />
	</target>

	<target name="undeploy" depends="undeploywar">
		<echo>Undeploy ${ant.project.name}</echo>
		<delete file="${deploy.dir}/${sample.jar.name}" />
	</target>

</project>
