Commit 66cd5e33 authored by Baptiste Perraud's avatar Baptiste Perraud

Revert opale to hdoc commit

parent b268a89e
<project name="ProjetOpale" default="convert">
<!-- additionnal lib -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="lib/ant-contrib.jar"/>
</classpath>
</taskdef>
</taskdef>
<!-- Other properties -->
<property name="ScarPath" value="input" />
......@@ -16,15 +16,13 @@
<property name="RacineFile" value="content.xml" />
<property name="OutputPath" value="output" />
<property name="HdocPath" value="${OutputPath}/hdoc" />
<!-- Others properties (in another file) currently empty -->
<property file="opale_to_hdoc.properties" />
<!-- Beginning -->
<target name="convert">
<delete>
<fileset dir="${OutputPath}" excludes=".gitkeep"/>
</delete>
<delete dir="${OutputPath}"/>
<mkdir dir="${OutputPath}"/>
<for param="filename">
<path>
......@@ -34,9 +32,9 @@
<var name="newFileName" unset="true"/>
<basename property="newFileName" file="@{filename}"/>
<antcall target="clean" />
<antcall target="unzip_scar">
<antcall target="unzip_scar">
<param name="file" value="${newFileName}"/>
</antcall>
</antcall>
<antcall target="check_source_xml" />
<antcall target="hdoc_structure" />
<antcall target="fusion_xml" />
......@@ -49,7 +47,7 @@
</for>
<antcall target="clean" />
</target>
<!-- Clean : delete old files -->
<target name="clean">
<!-- delete folders -->
......@@ -58,33 +56,33 @@
<delete dir="${HdocPath}"/>
<delete file="get_ressources.ant"></delete>
</target>
<!-- Check if only one xml file -->
<target name="check_source_xml">
<!-- count xml files -->
<resourcecount property="xml.count">
<fileset dir="${UnzipSourcePath}" casesensitive="yes">
<include name="*.xml"/>
</fileset>
</resourcecount>
<!-- check if only one xml file -->
<condition property="xml.onlyone">
<equals arg1="${xml.count}" arg2="1"/>
</condition>
<!-- fail if more than one -->
<fail message="Error : too many source file (${xml.count}), source file not found or unreadable." unless="xml.onlyone"/>
</target>
<!-- Unzip scar source file -->
<target name="unzip_scar">
<!-- get scar file path -->
<unzip src="${ScarPath}/${file}" dest="./${UnzipSourcePath}"/>
</target>
<!-- Create the hdoc structure -->
<target name="hdoc_structure">
<mkdir dir="${HdocPath}"/>
......@@ -103,38 +101,38 @@
<!-- Make a unique xml source file -->
<target name="fusion_xml">
<!-- get xml source file path -->
<fileset id="fileset_source_xml" dir="${UnzipSourcePath}" casesensitive="yes">
<include name="*.xml"/>
</fileset>
<pathconvert property="xml.path" pathsep="" refid="fileset_source_xml" />
<!-- xsl -->
<xslt style="xsl/opale_to_hdoc_regle1.xsl" in="${xml.path}" out="./${TmpPath}/${TmpFile1}" classpath="./lib/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
<!-- Copy ressources -->
<target name="copy_ressources">
<target name="copy_ressources">
<xslt style="xsl/find_ressources.xsl" in="./${TmpPath}/${TmpFile1}" out="./get_ressources.ant" classpath="./lib/saxon9he.jar" >
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
<chmod file="get_ressources.ant" perm="777"/>
<ant antfile="get_ressources.ant"/>
</target>
<!-- Create content.xml -->
<target name="content_xml">
<target name="content_xml">
<xslt style="xsl/opale_to_hdoc_regle2.xsl" in="./${TmpPath}/${TmpFile1}" out="./${HdocPath}/${RacineFile}" classpath="./lib/saxon9he.jar">
<factory name="net.sf.saxon.TransformerFactoryImpl"/>
</xslt>
</target>
<!-- Zip Hdoc -->
<target name="zip">
<zip destfile="${OutputPath}/${file}.hdoc" basedir="${HdocPath}"/>
</target>
</project>
\ No newline at end of file
</project>
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