myantce.ant 2.38 KB
Newer Older
1
2
3
<?xml version="1.0" encoding="UTF-8"?$gt;
<project basedir="." name="myantce" default="main"$gt;
    <property file="build.properties"/$gt;
4

5
6
7
8
9
10
11
12
    <target name="start"$gt;
        <delete dir="${tmp}" failonerror="false"/$gt;
        <mkdir dir="${tmp}"/$gt;
        <delete dir="${out}" failonerror="false"/$gt;
        <mkdir dir="${out}"/$gt;
        <delete dir="${log}" failonerror="false"/$gt;
        <mkdir dir="${log}"/$gt;
    </target$gt;
13
    
14
15
16
17
    <target name="clean-tmp"$gt;
        <delete dir="${tmp}" failonerror="false"/$gt;
        <mkdir dir="${tmp}"/$gt;
    </target$gt;
qaomia's avatar
qaomia committed
18

19
20
21
22
23
    <!-- Apply Xslt --$gt;
    <target name="apply-xslt"$gt;
        <xslt classpath="lib\saxon9he.jar" in="${xsl}/html2xhtml.xsl" out="${tmp}/tmpPad.xhtml" style="${xsl}/html2xhtml.xsl" /$gt;
        <xslt in="${tmp}/tmpPad.xhtml" out="${tmp}/tozip/content.xml" style="${xsl}/xhtml2hdoc.xsl" /$gt;
    </target$gt;
24
    
25
26
27
28
    <!-- Builds Hdoc structure --$gt;
    <target name="construct_hdoc"$gt;
        <mkdir dir="${tmp}/tozip/" /$gt;
        <mkdir dir="${tmp}/tozip/META-INF" /$gt;
29
        
30
31
32
33
34
35
36
37
38
        <!-- container --$gt;
        <touch file="${tmp}/tozip/META-INF/container.xml" /$gt;
        <echo file="${tmp}/tozip/META-INF/container.xml"$gt;
            $lt;container version="1.0"$gt;
                $lt;rootfiles$gt;
                    $lt;rootfile full-path="${rootfilename}" media-type="text/xml" /$gt;
                $lt;/rootfiles$gt;
            $lt;/container$gt;
        </echoxml$gt;
39
        
40
41
42
43
        <!-- mimetype --$gt;
        <touch file="${tmp}/mimetype" /$gt;
        <echo message="application/x-hdoc+zip" file="${tmp}/tozip/mimetype" /$gt;
    </target$gt;
44
    
45
46
47
48
49
50
    <target name="jing-hdoc"$gt;
        <taskdef name="jing" classname="com.thaiopensource.relaxng.util.JingTask"$gt;
            <classpath$gt;
                <pathelement location="lib/jing.jar"/$gt;
            </classpath$gt;
        </taskdef$gt;
Jean Vintache's avatar
Jean Vintache committed
51
        
52
53
        <jing file="${tmp}/tozip/content.xml" rngfile="schema/xhtml/hdoc1-xhtml.rng"$gt;</jing$gt;
        <echo$gt;content.xml respecte le schema hdoc1-xhtml.rng</echo$gt;
Jean Vintache's avatar
Jean Vintache committed
54
        
55
    </target$gt;
Jean Vintache's avatar
Jean Vintache committed
56
    
57
58
59
60
    <!-- Zip Hdoc container --$gt;
    <target name="zip"$gt;
        <zip basedir="${tmp}/tozip/" destfile="${out}/output.hdoc" /$gt;
    </target$gt;
61
    
62
    <target name="main" depends="start,apply-xslt,construct_hdoc,jing-hdoc,zip"$gt;
Jean Vintache's avatar
Jean Vintache committed
63
        
64
    </target$gt;
qaomia's avatar
qaomia committed
65
    
66
</project$gt;