Commit 93d733a9 authored by Jean Vintache's avatar Jean Vintache

ant build processes only one file, which must be located in the input folder and named pad.html

parent 02bb24fa
in = ${basedir}/input in = ${basedir}/input
out = ${basedir}/output out = ${basedir}/output
tmp = ${basedir}/tmp tmp = ${basedir}/tmp
xsl = ${basedir}/xsl xsl = ${basedir}/xsl
lib = ${basedir}/lib lib = ${basedir}/lib
log = ${basedir}/log log = ${basedir}/log
\ No newline at end of file
rootfilename = content.xml
\ No newline at end of file
...@@ -2,46 +2,50 @@ ...@@ -2,46 +2,50 @@
<project basedir="." name="myantce" default="main"> <project basedir="." name="myantce" default="main">
<property file=""/> <property file=""/>
<delete dir="${tmp}" failonerror="false"/> <target name="start">
<mkdir dir="${tmp}"/> <delete dir="${tmp}" failonerror="false"/>
<delete dir="${out}" failonerror="false"/> <mkdir dir="${tmp}"/>
<mkdir dir="${out}"/> <delete dir="${out}" failonerror="false"/>
<delete dir="${log}" failonerror="false"/> <mkdir dir="${out}"/>
<mkdir dir="${log}"/> <delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
<target name="clean-tmp">
<delete dir="${tmp}" failonerror="false"/>
<mkdir dir="${tmp}"/>
<!-- Apply Xslt --> <!-- Apply Xslt -->
<target name="tranformation"> <target name="apply-xslt">
<xslt in="${xsl}/etherpad2hdoc.xsl" out="${out}/etherpad.xml" style="${xsl}/etherpad2hdoc.xsl"/> <xslt in="${in}/pad.html" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
<xslt in="${tmp}/tmpPad.html" out="${tmp}/content.xml" style="${xsl}/xhtml2hdoc.xsl" />
</target> </target>
<!-- Builds Hdoc structure --> <!-- Builds Hdoc structure -->
<target name="construct_hdoc"> <target name="construct_hdoc">
<delete dir="${emplacement_hdoc}" failonerror="false"/> <mkdir dir="${tmp}/META-INF" />
<mkdir dir="${emplacement_hdoc}" />
<mkdir dir="${emplacement_hdoc}/META-INF" /> <!-- container -->
<touch file="${emplacement_hdoc}/META-INF/container.xml" /> <touch file="${tmp}/META-INF/container.xml" />
<touch file="${emplacement_hdoc}/mimetype" /> <echoxml file="${tmp}/META-INF/container.xml">
<echo message="application/x-hdoc+zip" file="${emplacement_hdoc}/mimetype" />
<!-- Fill Hdoc container -->
<target name="fill_container" depends="construct_hdoc">
<echoxml file="${emplacement_hdoc}/META-INF/container.xml">
<container version="1.0"> <container version="1.0">
<rootfiles> <rootfiles>
<rootfile full-path="${rootfile}" media-type="text/xml" /> <rootfile full-path="${rootfilename}" media-type="text/xml" />
</rootfiles> </rootfiles>
</container> </container>
</echoxml> </echoxml>
<!-- mimetype -->
<touch file="${tmp}/mimetype" />
<echo message="application/x-hdoc+zip" file="${tmp}/mimetype" />
</target> </target>
<!-- Zip Hdoc container --> <!-- Zip Hdoc container -->
<target name="zip"> <target name="zip">
<zip basedir="${emplacement_hdoc}" destfile="outputHdoc.hdoc" /> <zip basedir="${tmp}" destfile="${out}/output.hdoc" />
</target> </target>
<target name="main" depends="tranformation,fill_container,zip"> <target name="main" depends="start,apply-xslt,construct_hdoc,zip" />
</project> </project>
\ No newline at end of file
...@@ -4,4 +4,12 @@ ...@@ -4,4 +4,12 @@
exclude-result-prefixes="xs" exclude-result-prefixes="xs"
version="2.0"> version="2.0">
<xsl:output method="xml" indent="yes" />
<!-- identity -->
<xsl:template match="@*|node()">
<xsl:apply-templates select="@*|node()"/>
</xsl:stylesheet> </xsl:stylesheet>
\ 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