myantce.ant 2.21 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
    </target>
    
Jean Vintache's avatar
Jean Vintache committed
45
46
47
48
49
50
51
52
53
54
55
56
    <target name="jing-hdoc">
        <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask">
            <classpath>
                <pathelement location="lib/jing.jar"/>
            </classpath>
        </taskdef>
        
        <jing file="${tmp}/tozip/content.xml" rngfile="schema/xhtml/hdoc1-xhtml.rng"></jing>
        <echo>content.xml respecte le schema hdoc1-xhtml.rng</echo>
        
    </target>
    
57
58
    <!-- Zip Hdoc container -->
    <target name="zip">
qaomia's avatar
qaomia committed
59
        <zip basedir="${tmp}/tozip/" destfile="${out}/output.hdoc" />
60
61
    </target>
    
Jean Vintache's avatar
Jean Vintache committed
62
63
64
    <target name="main" depends="start,apply-xslt,construct_hdoc,jing-hdoc,zip">
        
    </target>
qaomia's avatar
qaomia committed
65
66
    
</project>