opale_to_elasticsearch.ant 1.85 KB
Newer Older
Gregory's avatar
Gregory committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
60
61
62
63
64
65
66
67
<project name="hdoc_to_elasticsearch" default="clean"> 
	
	<!-- -->
	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
	  <classpath>
		<pathelement location="lib/ant-contrib-0.3.jar"/>
	  </classpath>
	</taskdef>

	<property file="build.properties"/>     
		
	
	<!-- Parcours la liste des fichiers pour les transformer -->
	<target name="targetAllFiles">
		<delete>
		   <fileset dir="${outputPath}">
			  <include name="*.json"/>
		   </fileset>
		</delete>
		<!-- Copy files in opale_to_hdoc input dir -->
		<copy todir="${inputOpaleToHdoc}">
			<fileset dir="${inputPath}"/>
		</copy>
		<!-- Use ant transo opale_to_hdoc -->
		<ant antfile="../opale_to_hdoc/opale_to_hdoc.ant" inheritAll="false"/>	
		<!-- Copy files in hdoc_to_elasticSearch input dir -->
		<copy todir="${inputHdocToElasticSearch}">
			<fileset dir="${outputOpaleToHdoc}"/>
		</copy>
		<!-- Use ant transo opale_to_hdoc -->
		<ant antfile="../hdoc_to_elasticSearch/hdoc_to_elasticsearch.ant" inheritAll="false"/>
		<copy todir="${outputPath}" >
			<fileset dir="${outputHdocToElasticSearch}"/>
		</copy>
		
	</target> 
	
	
	<!-- Clear tmp files --> 	
	<target name="clean" depends="targetAllFiles">         
		<echo message="Clean files" />
		<!-- -->
		<delete includeemptydirs="true" verbose="true">
			<fileset dir="${inputOpaleToHdoc}"> 
				 <include name="*.scar"/>
			</fileset>
		</delete>
		<delete includeemptydirs="true" verbose="true">
			<fileset dir="${outputOpaleToHdoc}"> 
				 <include name="*.hdoc"/>
			</fileset>
		</delete>
		<delete includeemptydirs="true" verbose="true">
			<fileset dir="${inputHdocToElasticSearch}">
				 <include name="*.hdoc"/>
			</fileset>
		</delete>
		<delete includeemptydirs="true" verbose="true">
			<fileset dir="${outputHdocToElasticSearch}"> 
				 <include name="*.json"/>
			</fileset>
		</delete>
		<echo message="Clean end" />
	</target> 	

</project>