opale_to_optim.ant 2.36 KB
Newer Older
1
<project name="ProjetOpale" default="convert">
2

3
4
5
6
7
8
9
10
11
12
13
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="lib/ant-contrib.jar" />
		</classpath>
	</taskdef>
	
	<!-- Arguments properties -->
	<property name="DocType" 			value="paper" />
	<property name="Source" 			value="none" />
	<property name="InputPath" 			value="input" />

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
	<!-- Beginning -->
	<target name="convert">
		<antcall target="clean_everything" />	  	
		<antcall target="opale_to_hdoc" />
		<antcall target="hdoc_to_optim" />
		<antcall target="copy_optim_output" />
	</target>
	
	<target name="clean_everything">
		<delete dir="../opale_to_hdoc/input"/>
		<delete dir="../opale_to_hdoc/output/result.hdoc"/>
		<delete dir="../hdoc_to_optim/input"/>
		<delete dir="../hdoc_to_optim/output/result.scar"/>
	</target>
	
	<target name="opale_to_hdoc">
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

		<!--Check wether there is an input using command line or not-->
	    <if>
		  <equals arg1="${Source}" arg2="none" />
		  <then>
			<!--There is no input, check the input folder-->
			
			<echo message="The value of property InputFile is ${Source} ... Checking the input folder" />
			<echo message="The value of property DocType is ${DocType}" />
			<!-- get input hdoc file path -->
			<fileset id="fileset_scar" dir="${InputPath}" casesensitive="yes">
				<include name="*.scar"/>
			</fileset>
			<pathconvert property="ScarFile" pathsep="" refid="fileset_scar" />
			
			<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>
			<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>		
		  </then>
		  <else>
			<!--There is an input-->
			
			<echo message="The value of property Source is ${Source}" />
			<echo message="The value of property DocType is ${DocType}" />
			<echo message="Executing conversion..." />
		
			<copy tofile="../opale_to_hdoc/input/sample.scar" file="${Source}"/>
			<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>	
			
		  </else>
		</if>   
60
61
62
63
	</target>
	
	<target name="hdoc_to_optim">
		<copy tofile="../hdoc_to_optim/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>
64
65
66
		<ant antfile="../hdoc_to_optim/hdoc_to_optim.ant" inheritAll="false">
			<property name="DocType" value="${DocType}"/>
		</ant>
67
68
69
70
71
72
73
	</target>
	
	<target name="copy_optim_output">
		<copy tofile="output/result.scar" file="../hdoc_to_optim/output/result.scar"/>
	</target>
	
</project>