optim_to_lexique.ant 2.25 KB
Newer Older
Antoine's avatar
Antoine committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="clean" basedir=".">

	<property file="build.properties"/>
	
	<taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
		<classpath>
			<pathelement location="${libdir}/jing.jar"/>
		</classpath>
	</taskdef>
	
	<taskdef resource="net/sf/antcontrib/antlib.xml">
		  	<classpath>
		    	<pathelement location="lib/ant-contrib.jar"/>
			</classpath>
	</taskdef>

	
19 20 21 22 23 24 25 26
	<target name="rmOutputDir">
	    <if>
	        <available file="${OutputPath}" type="dir"/>
	        <then>
	            <delete dir="${OutputPath}"/>
	        </then>
	    </if>
	</target>	
Antoine's avatar
Antoine committed
27

28
	<target name="init" depends="rmOutputDir">
Antoine's avatar
Antoine committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
		<mkdir dir="${outdir}"/>
		<chmod perm="777" dir="${outdir}"></chmod>
		<mkdir dir="${srcdir}"/>
		<chmod perm="777" dir="${srcdir}"></chmod>
	</target>
	
	<target name="unzipSource" depends="init">
		<for param="file">
			<path>
				<fileset dir="${InputPath}" id="inputsId">
					<include name="*.zip"/>
					<include name="*.scar"/>
				</fileset>   
			</path>   
			<sequential>
				<local name="TODAY_MY"/>
				<tstamp>
				      <format property="TODAY_MY" pattern="yyyyMMdd-HHmmss"  locale="en,UK" />
				  </tstamp>
				<var name="name" unset="true"/>
			    <basename file="@{file}" property="name" />
				<unzip src="${InputPath}/${name}" dest="${srcdir}/${TODAY_MY}"></unzip>
				<sleep seconds="1"> </sleep>
			</sequential>
		</for>
	</target>
	
	<target name="buildOutput" depends="unzipSource">
		<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/refsToTerm.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".term">
		    <include name="**/*.refs"/>
		</xslt>
		<copy file="lexique.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
		<!--<jing rngfile="${rngdir}/lx_term.rng">
			<fileset dir="${outdir}">
				<include name="**/*.term"/>
			</fileset>
		</jing>-->
	</target>

	<target name="imageCopy" depends="unzipSource">
		<copy todir="${OutputPath}">
			<fileset dir="${srcdir}">
				<include name="**/*.jpg"/>
				<include name="**/*.png"/>
				<include name="**/*.gif"/>
			</fileset>
		</copy>		
	</target>
				

	<target name="clean" depends="buildOutput,imageCopy">
		<delete dir="${srcdir}" />
		<delete dir="${outdir}" />
	</target>
	
</project>