lexique_to_opale.ant 2.14 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
<?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>

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

27
	<target name="init" depends="rmOutputDir">
Antoine's avatar
Antoine committed
28
29
30
31
		<mkdir dir="${outdir}"/>
		<chmod perm="777" dir="${outdir}"></chmod>
		<mkdir dir="${srcdir}"/>
		<chmod perm="777" dir="${srcdir}"></chmod>
32
33
		<mkdir dir="${OutputPath}"/>
		<chmod perm="777" dir="${OutputPath}"></chmod>
Antoine's avatar
Antoine committed
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
	</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}/termToRef.xsl" basedir="${srcdir}" destdir="${OutputPath}" followsymlinks="false" extension=".ref">
		    <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>

</project>