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

Revert opale to hdoc commit

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