myantce.ant 1.65 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">
Jean Vintache's avatar
antce    
Jean Vintache committed
21
        <xslt in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" />
qaomia's avatar
fixes    
qaomia committed
22
        <xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/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">
27
28
29
30
31
        <mkdir dir="${tmp}/META-INF" />
        
        <!-- container -->
        <touch file="${tmp}/META-INF/container.xml" />
        <echoxml file="${tmp}/META-INF/container.xml">
32
33
            <container version="1.0">
                <rootfiles>
34
                    <rootfile full-path="${rootfilename}" media-type="text/xml" />
35
36
37
                </rootfiles>
            </container>
        </echoxml>
38
39
40
41
        
        <!-- mimetype -->
        <touch file="${tmp}/mimetype" />
        <echo message="application/x-hdoc+zip" file="${tmp}/mimetype" />
42
43
44
45
    </target>
    
    <!-- Zip Hdoc container -->
    <target name="zip">
46
        <zip basedir="${tmp}" destfile="${out}/output.hdoc" />
47
48
    </target>
    
49
    <target name="main" depends="start,apply-xslt,construct_hdoc,zip" />
qaomia's avatar
qaomia committed
50
    
qaomia's avatar
fixes    
qaomia committed
51
</project>