hdoc_to_optim.ant 1.4 KB
Newer Older
Drain's avatar
Drain committed
1
<project name="hdoc_to_optim" default="convert">
2
3
4
5
6
7

	<!-- Arguments properties -->
	<property name="InputPath" 			value="input" />
	<property name="OutputPath" 		value="output" />
	<property name="OutputScarPath" 			value="${OutputPath}/result.scar" />
	
Drain's avatar
Drain committed
8
    <target name="convert">
9
10
11
12
13
14
15
	
		<!-- get input hdoc file path -->
		<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
			<include name="*.hdoc"/>
		</fileset>
		<pathconvert property="HdocPath" pathsep="" refid="fileset_hdoc" />
		
Drain's avatar
Drain committed
16
        <!--unzips the hdoc to be converted-->
17
18
19
        <unzip dest="hdoc" src ="${HdocPath}"/>
        
		<!--gives all rights to avoid bugs-->
Drain's avatar
Drain committed
20
        <chmod dir="hdoc" perm="777"/>
21
22
23
        
		<!--launches the XSLT find_content to retrieve the content path-->
        <xslt in="hdoc/META-INF/container.xml" out="get_content.ant" style="xsl/find_content.xsl"/>
Drain's avatar
Drain committed
24
        <chmod file="get_content.ant" perm="777"/>
25
26

		<!--launches the ANT get_content resulting from the previous XSLT in order to launch the conversion-->
Drain's avatar
Drain committed
27
        <ant antfile="get_content.ant"/>
28
		<!--once the conversion is complete, the result is zipped-->
29
        <zip basedir="result" destfile="${OutputScarPath}" encoding="UTF-8"/>
30
31
        
		<!--temporary files and folders are deleted-->
Drain's avatar
Drain committed
32
33
34
35
        <delete dir="hdoc"/>
        <delete dir="result"/>
        <delete file="get_content.ant"/>
        <delete file="get_ressources.ant"/>
36
		
Drain's avatar
Drain committed
37
38
    </target>
</project>