<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="XEMELIOS-APXS-signature" default="usage" basedir=".">
	<description>Builds, tests the  signature plugin</description>
	<property file="${user.home}/.ant.properties"/>
	<property name="compile.debug" value="true"/>
	<property file="build.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">
		<javac srcdir="java" destdir="build/classes" debug="${compile.debug}" encoding="ISO-8859-1">
			<classpath>
				<pathelement path="../../xml-marshall/build/classes"/>
                <pathelement path="../../xemelios-core/build/classes"/>
                <pathelement path="../signature-verifier/build/classes"/>
                <fileset dir="../../core/lib" includes="*.jar"/>
                <fileset dir="../../plugin-signerfichier-pes/lib" includes="*.jar"/>
                <fileset dir="../../xemelios-core/lib" includes="*.jar"/>
			</classpath>
		</javac>
		<copy todir="build/classes">
			<fileset dir="java">
				<include name="**/*"/>
				<exclude name="**/*.java"/>
				<exclude name="**/CVS/*"/>
                <exclude name="**/*.form"/>
                <exclude name="**/*.class"/>
			</fileset>
		</copy>
	</target>
	
	<target name="jars" depends="compile">
            <property file="component.properties"/>
            <copy file="manifest/manifest.txt" tofile="build/manifest.txt">
                <filterset>
                    <filter token="version" value="${component.release}"/>
                    <filter token="name" value="${element.name}"/>
                </filterset>
            </copy>
            <jar destfile="build/jars/${element.name}.jar" basedir="build/classes" manifest="build/manifest.txt"/>
	</target>
	
	<target name="clean">
		<delete dir="build"/>
	</target>
	
	
	<target name="mk-output-dirs">
		<mkdir dir="build/classes"/>
		<mkdir dir="build/jars"/>
	</target>
        
    <!--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="lib" includes="*.dll"/>
            <fileset dir="../build/jars" includes="*.jar"/>
		</copy>
		<propertyfile file="${component.dir}/component.properties">
			<entry key="description" value="Plugin de verification de signature"/>
			<entry key="type" value="features-updates"/>
			<entry key="base.dest" value="${xemelios.prg}/root/tools/"/>
			<entry key="requires" value="${component.requires}"/>
            <entry key="VerifyXmlsec.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="iconv.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="libeay32.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="libxml2.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="libxmlsec.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="libxmlsec-openssl.dll.dest" value="${xemelios.prg}/root"/>
            <entry key="zlib1.dll.dest" value="${xemelios.prg}/root"/>
        </propertyfile>
    </target>
	
	<target name="setup">
		<copy todir="../../build/setup/tools">
			<fileset dir="../build/jars" includes="*.jar"/>
		</copy>
		<copy todir="../../build/setup">
			<fileset dir="lib" includes="*.dll"/>
		</copy>
	</target-->
       
</project>
 
