myantce.ant 1.75 KB
Newer Older
qaomia's avatar
qaomia committed
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
4
<project basedir="." name="myantce" default="main">
    <property file="build.properties"/>

5
6
7
8
9
10
11
12
13
14
15
16
17
    <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>
qaomia's avatar
qaomia committed
18

Jean Vintache's avatar
Jean Vintache committed
19
    <!-- Apply Xslt -->
20
    <target name="apply-xslt">
21
        <xslt classpath="lib\saxon9he.jar" in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
Jean Vintache's avatar
Jean Vintache committed
22
        <xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/tozip/content.xml" style="${xsl}/xhtml2hdoc.xsl" />
Jean Vintache's avatar
Jean Vintache committed
23
    </target>
24
25
26
    
    <!-- Builds Hdoc structure -->
    <target name="construct_hdoc">
Jean Vintache's avatar
Jean Vintache committed
27
28
        <mkdir dir="${tmp}/tozip/" />
        <mkdir dir="${tmp}/tozip/META-INF" />
29
30
        
        <!-- container -->
Jean Vintache's avatar
Jean Vintache committed
31
32
        <touch file="${tmp}/tozip/META-INF/container.xml" />
        <echoxml file="${tmp}/tozip/META-INF/container.xml">
33
34
            <container version="1.0">
                <rootfiles>
35
                    <rootfile full-path="${rootfilename}" media-type="text/xml" />
36
37
38
                </rootfiles>
            </container>
        </echoxml>
39
40
41
        
        <!-- mimetype -->
        <touch file="${tmp}/mimetype" />
Jean Vintache's avatar
Jean Vintache committed
42
        <echo message="application/x-hdoc+zip" file="${tmp}/tozip/mimetype" />
43
44
45
46
    </target>
    
    <!-- Zip Hdoc container -->
    <target name="zip">
qaomia's avatar
qaomia committed
47
        <zip basedir="${tmp}/tozip/" destfile="${out}/output.hdoc" />
48
49
    </target>
    
50
    <target name="main" depends="start,apply-xslt,construct_hdoc,zip" />
qaomia's avatar
qaomia committed
51
52
    
</project>