opale_to_pdf.ant 2.78 KB
Newer Older
Raphaël's avatar
Raphaël committed
1
2
3
4
5
6
7
<project name="ProjetOpale" default="convert">

	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="lib/ant-contrib.jar" />
		</classpath>
	</taskdef>
8

Raphaël's avatar
Raphaël committed
9
10
11
12
13
14
15
	<!-- Arguments properties -->
	<property name="DocType" 			value="paper" />
	<property name="Source" 			value="none" />
	<property name="InputPath" 			value="input" />

	<!-- Beginning -->
	<target name="convert">
16
		<antcall target="clean_everything" />
Raphaël's avatar
Raphaël committed
17
18
19
20
		<antcall target="opale_to_hdoc" />
		<antcall target="hdoc_to_pdf" />
		<antcall target="copy_pdf_output" />
	</target>
21

Raphaël's avatar
Raphaël committed
22
23
24
25
26
27
	<target name="clean_everything">
		<delete dir="../opale_to_hdoc/input"/>
		<delete dir="../opale_to_hdoc/output/result.hdoc"/>
		<delete dir="../hdoc_to_pdf/input"/>
		<delete dir="../hdoc_to_pdf/output/result.pdf"/>
	</target>
28

Raphaël's avatar
Raphaël committed
29
30
31
32
33
34
35
	<target name="opale_to_hdoc">

		<!--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-->
36

Raphaël's avatar
Raphaël committed
37
38
39
			<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 -->
40
			<!--
Raphaël's avatar
Raphaël committed
41
42
43
44
			<fileset id="fileset_scar" dir="${InputPath}" casesensitive="yes">
				<include name="*.scar"/>
			</fileset>
			<pathconvert property="ScarFile" pathsep="" refid="fileset_scar" />
45
46
47
48
49
50
51
52
53
54
55
			-->

			<copy todir="../opale_to_hdoc/input">
				<fileset dir="${InputPath}" casesensitive="yes">
					<include name="*.scar"/>
				</fileset>
		  </copy>

			<!--<copy tofile="../opale_to_hdoc/input/sample.scar" file="${ScarFile}"/>-->

			<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>
Raphaël's avatar
Raphaël committed
56
57
58
		  </then>
		  <else>
			<!--There is an input-->
59

Raphaël's avatar
Raphaël committed
60
61
62
			<echo message="The value of property Source is ${Source}" />
			<echo message="The value of property DocType is ${DocType}" />
			<echo message="Executing conversion..." />
63

Raphaël's avatar
Raphaël committed
64
			<copy tofile="../opale_to_hdoc/input/sample.scar" file="${Source}"/>
65
66
			<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>

Raphaël's avatar
Raphaël committed
67
		  </else>
68
		</if>
Raphaël's avatar
Raphaël committed
69
	</target>
70

Raphaël's avatar
Raphaël committed
71
	<target name="hdoc_to_pdf">
72
73
74
75
76
77
		<!--<copy tofile="../hdoc_to_pdf/input/sample.hdoc" file="../opale_to_hdoc/output/result.hdoc"/>-->
		<copy todir="../hdoc_to_pdf/input">
			<fileset dir="../opale_to_hdoc/output" casesensitive="yes">
				<include name="*.hdoc"/>
			</fileset>
		</copy>
Raphaël's avatar
Raphaël committed
78
79
80
81
		<ant antfile="../hdoc_to_pdf/hdoc_to_pdf.ant" inheritAll="false">
			<property name="DocType" value="${DocType}"/>
		</ant>
	</target>
82

Raphaël's avatar
Raphaël committed
83
	<target name="copy_pdf_output">
84
85
86
87
88
89
		<!--<copy tofile="output/result.pdf" file="../hdoc_to_pdf/output/result.pdf"/>-->
		<copy todir="output">
			<fileset dir="../hdoc_to_pdf/output" casesensitive="yes">
				<include name="*.pdf"/>
			</fileset>
		</copy>
Raphaël's avatar
Raphaël committed
90
	</target>
91
92

</project>