Commit a38f331c authored by simei.yin's avatar simei.yin
Browse files

Add comments to ant file and include build.properties

parent f846480b
libdir=${basedir}/lib lib=${basedir}/lib
rngdir=${basedir}/rng log=${basedir}/log
xsldir=${basedir}/xsl xsl=${basedir}/xsl
srcdir=${basedir}/in in=${basedir}/input
outdir=${basedir}/out out=${basedir}/output
InputPath=${basedir}/input tmp=${basedir}/tmp
OutputPath=${basedir}/output \ No newline at end of file
...@@ -3,49 +3,42 @@ ...@@ -3,49 +3,42 @@
<taskdef resource="net/sf/antcontrib/antlib.xml"/> <taskdef resource="net/sf/antcontrib/antlib.xml"/>
<property name="in" location="${basedir}/input"/> <property file="build.properties"/>
<property name="out" location="${basedir}/output"/>
<property name="tmp" location="${basedir}/tmp"/> <target name="convert">
<property name="xsl" location="${basedir}/xsl"/> <!-- Preparation for the file transformation : delete old folders and create new folders -->
<property name="lib" location="${basedir}/lib"/> <mkdir dir="${tmp}"/>
<property name="log" location="${basedir}/log"/> <delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
<target name="convert"> <delete dir="${log}" failonerror="false"/>
<echo message="DEBUT"/> <mkdir dir="${log}"/>
<echo message="DEBUT"/>
<!-- Convert all the hdoc files in the directory ${in} to data xml files that will be imported to basex later.
<mkdir dir="${tmp}"/> Fonctions "UnzipHdocFile" and "content" will be called. -->
<delete dir="${out}" failonerror="false"/> <for param="inputFile">
<path>
<mkdir dir="${out}"/> <fileset dir="${in}" includes="**/*.hdoc"/>
<delete dir="${log}" failonerror="false"/> </path>
<mkdir dir="${log}"/> <sequential>
<local name="filename"/>
<basename property="filename" file="@{inputFile}"/>
<for param="inputFile">
<path> <antcall target="UnzipHdocFile">
<fileset dir="${in}" includes="**/*.hdoc"/> <param name="filename" value="${filename}"/>
</path> </antcall>
<antcall target="content">
<sequential> <param name="filename" value="${filename}"/>
<local name="filename"/> </antcall>
<basename property="filename" file="@{inputFile}"/> <echo message="FIN"/>
</sequential>
<antcall target="UnzipHdocFile"> </for>
<param name="filename" value="${filename}"/>
</antcall> <!-- Clean-->
<delete dir="${tmp}" failonerror="false"/>
<antcall target="content"> </target>
<param name="filename" value="${filename}"/>
</antcall>
<echo message="FIN"/>
</sequential>
</for>
</target>
<target name="UnzipHdocFile"> <target name="UnzipHdocFile">
<!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which <!-- Unzip the input hdoc file. Decompressed folder is named "decompressedHdoc" : this name is the only one which
...@@ -56,15 +49,13 @@ ...@@ -56,15 +49,13 @@
</target> </target>
<target name="content" > <target name="content" >
<xslt in="${tmp}/${filename}/decompressedHdoc/content.xml" out="${out}/${filename}_data.xml" style="${xsl}/transformation.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison"> <!-- Transformation of a xml file decompressed from hdoc file to data xml file to be imported to basex.
The transformation will be done in terms of the xsl file in ${xsl}.-->
<param name="filename" expression="${filename}"/> <xslt in="${tmp}/${filename}/decompressedHdoc/content.xml" out="${out}/${filename}_data.xml" style="${xsl}/transformation.xsl" processor="org.apache.tools.ant.taskdefs.optional.TraXLiaison">
<param name="lib" expression="${lib}"/> <param name="filename" expression="${filename}"/>
</xslt> <param name="lib" expression="${lib}"/>
<echo message="${filename}" /> </xslt>
<delete dir="${tmp}" failonerror="false"/> <echo message="${filename}" />
</target> </target>
</project> </project>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment