Commit e79ad03f authored by Neveux Anais's avatar Neveux Anais

Create an ant file which read a scar in the input folder, create temporary...

Create an ant file which read a scar in the input folder, create temporary folders, unzip the scar, check if the scar is a canoprof scar and not an opale one for example. We create a file in output with OK in it
parent f47813e9
......@@ -7,4 +7,4 @@
-Il ne touche pas aux options
-Il sauvegarde le .SCAR dans le dossier input du convertisseur
-Il lance le fichier run.bat (run.sh sous linux)
-Il récupère le hdoc créé dans le dossier output
-Il récupère le hdoc créé dans le dossier output
\ No newline at end of file
<project name="ProjetOpale" default="convert" xmlns:if="ant:if"
xmlns:unless="ant:unless">
<property file="canoprof_to_hdoc.properties" />
<!-- Main target -->
<target name="convert">
<antcall target="init" />
<antcall target="unzip_scar" />
<antcall target="process_canoscar"/>
<echo message="OK" file="${out}/testfile"/>
<antcall target="zip" />
<antcall target="clean"/>
</target>
<!-- Initialize folders -->
<target name="init">
<!-- create folders (to be sure) -->
<mkdir dir="${unzipfolder}"/>
<mkdir dir="${tmp}"/>
<mkdir dir="${out}"/>
<touch file="get_ressources.ant"/>
</target>
<!-- Clean : delete old files -->
<target name="clean">
<!-- delete folders -->
<delete dir="${unzipfolder}"/>
<delete dir="${tmp}"/>
<delete file="get_ressources.ant"/>
</target>
<!-- Check if the scar input is a Canoprof one or not -->
<target name="check_scar">
<xmlproperty semanticattributes="true" file="${unzipfolder}/.wspmeta" keeproot="true"/>
<condition property="canoprof.is_canoprof_scar">
<equals arg1="${wspType.defaultCode}" arg2="${canoprof_code}"/>
</condition>
</target>
<target name="process_canoscar" depends="check_scar" if="${canoprof.is_canoprof_scar}">
<!-- TODO traitement du fichier -->
<echo file="${tmp}/toto.xml" message="C'est un scar canoprof"/>
</target>
<!-- Unzip the scar -->
<target name="unzip_scar">
<!-- get scar file path -->
<fileset id="fileset_scar" dir="input" casesensitive="yes">
<include name="*.scar"/>
</fileset>
<pathconvert property="scar.path" pathsep="" refid="fileset_scar" />
<unzip src="${scar.path}" dest="${unzipfolder}"/>
</target>
<!-- Zip the final content into a scar file -->
<target name="zip">
<!-- TODO zip the output files -->
</target>
</project>
\ No newline at end of file
in = ${basedir}/input
out = ${basedir}/output
tmp = ${basedir}/tmp
xsl = ${basedir}/xsl
lib = ${basedir}/lib
log = ${basedir}/log
unzipfolder = ${basedir}/unzip
cano_in = ../canoprof_to_hdoc/input
cano_out = ../canoprof_to_hdoc/output
rootfilename = content.xml
canoprof_code= canoprof
\ 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