<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="XEMELIOS-carte-achat" default="usage" basedir=".">
	<description>Builds, tests, and runs the project XEMELIOS carte-achat</description>
	<property file="${user.home}/.ant.properties"/>

	<target name="usage">
		<echo> Using ${ant.version} These are targets supported by this ANT build script: compile -
			compile all .java files, except thoses in ./tmp folder. clean - deletes all compiled and
			generated files and resources. jars - build jar files. Do not call this script directly,
			use the one located at root of projet (in ../..) instead. </echo>
	</target>

	<target name="compile" depends="mk-output-dirs"/>

	<target name="jars"/>

	<target name="config">
		<property file="component.properties"/>
		<property name="component.dir" value="build/config/${component.name}/${component.release}"/>
		<mkdir dir="${component.dir}"/>
		<copy todir="${component.dir}">
			<fileset dir="conf">
				<include name="CARTE_ACHAT/**"/>
				<include name="pes-releve-carteachat.xml"/>
				<exclude name="**/CVS/*"/>
			</fileset>
		</copy>
		<propertyfile file="${component.dir}/component.properties">
			<entry key="description" value="Configuration pour la carte achat"/>
			<entry key="type" value="config-updates"/>
			<entry key="base.dest" value="${xemelios.prg}/root/documents-def/"/>
			<entry key="requires" value="${component.requires}"/>
		</propertyfile>
	</target>

	<target name="clean">
		<delete dir="build"/>
		<delete file="check-result.txt"/>
	</target>

	<target name="setup">
		<!--copy todir="../../build/setup/lib">
			<fileset dir="build/jars" includes="*.jar"/>
		</copy-->
		<copy todir="../../build/setup/root/documents-def">
			<fileset dir="conf" includes="**/*" excludes="**/CVS"/>
		</copy>
	</target>

	<target name="mk-output-dirs">
		<mkdir dir="build/config"/>
	</target>
	<target name="check-config">
		<xslt style="../../utils/persistence-verifier.xsl"
			in="conf/CARTE_ACHAT/PES-Releve-CarteAchat-persist.xml" out="check-result.txt"
			force="true">
			<param name="fileName" expression="conf/CARTE_ACHAT/PES-Releve-CarteAchat-persist.xml"/>
		</xslt>
		<exec executable="more">
			<arg value="check-result.txt"/>
		</exec>
		<delete file="check-result.txt"/>
	</target>

</project>
