lexique_to_rdf.ant 2.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 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
<?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>

	<target name="rmOutputDir">
	    <if>
	        <available file="${OutputPath}" type="dir"/>
	        <then>
	            <delete dir="${OutputPath}"/>
	        </then>
	    </if>
	</target>	

	<target name="init" depends="rmOutputDir">
		<mkdir dir="${outdir}"/>
		<chmod perm="777" dir="${outdir}"></chmod>
		<mkdir dir="${srcdir}"/>
		<chmod perm="777" dir="${srcdir}"></chmod>
		<mkdir dir="${OutputPath}"/>
		<chmod perm="777" dir="${OutputPath}"></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">
Antoine's avatar
Antoine committed
58
		<xslt classpath="${libdir}/saxon9he.jar" style="${xsldir}/termToRdf.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".rdf">
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
		    <include name="**/*.term"/>
		</xslt>
		<copy file="opale.wspmeta" tofile="${OutputPath}/.wspmeta"></copy>
		<!--<jing rngfile="${rngdir}/op_glos.rng">
			<fileset dir="${outdir}">
				<include name="**/*.ref"/>
			</fileset>
		</jing>-->
	</target>
		
	<target name="clean" depends="buildOutput">
		<delete dir="${srcdir}" />
		<delete dir="${outdir}" />
	</target>

Antoine's avatar
Antoine committed
74
</project>