opale_to_neo4j.ant 2.16 KB
Newer Older
Tyrannas's avatar
Tyrannas committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<project name="ProjetOpale" default="convert">

	<taskdef resource="net/sf/antcontrib/antcontrib.properties">
		<classpath>
			<pathelement location="lib/ant-contrib.jar" />
		</classpath>
	</taskdef>
	
	<!-- Arguments properties -->
	<property name="Node" 				value="false" />
	<property name="Source" 			value="none" />
	<property name="InputPath" 			value="input" />

	<!-- Beginning -->
	<target name="convert">
		<antcall target="clean_everything" />	  	
		<antcall target="opale_to_hdoc" />
		<antcall target="hdoc_to_neo4j" />
		<antcall target="copy_cql_output" />
	</target>
	
	<target name="clean_everything">
		<delete dir="../opale_to_hdoc/input"/>
24
		<delete dir="../opale_to_hdoc/output/"/>
Tyrannas's avatar
Tyrannas committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
		<delete dir="../hdoc_to_neo4j/input"/>
		<delete dir="../hdoc_to_neo4j/output/"/>
	</target>
	
	<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-->
			
			<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 -->
			
41
			<copy todir="../opale_to_hdoc/input/">
Tyrannas's avatar
Tyrannas committed
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 68 69 70 71 72 73 74 75
				<fileset dir="${InputPath}"/>
			</copy>
			<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>   
	</target>
	
	<target name="hdoc_to_neo4j">
		<copy todir="../hdoc_to_neo4j/input/">
			<fileset dir="../opale_to_hdoc/output/"/>
		</copy>
		<ant antfile="../hdoc_to_neo4j/hdoc_to_neo4j.ant" inheritAll="false">
			<property name="Node" value="${Node}"/>
		</ant>
	</target>
	
	<target name="copy_cql_output">
		<copy todir="output/">
			<fileset dir="../hdoc_to_neo4j/output"/>
		</copy>
	</target>
	
</project>