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

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

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