mindmapping_to_opale.ant 3.55 KB
Newer Older
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
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="default">
    <property name="module" value="default"/>
    <!--
  only for the debug
  <property name="inputPath" value="test.mm"></property>
      <property name="outputPath" value="content.xml"/>
  <property name="converting" value="yes"/> 
    -->

    <property name="resultFile" value="${basedir}/result"/>
    
    <target name="default" depends="preparation">
        <echo>----------------------------Begin of conversion----------------------------------</echo>


  <!-- Sect Schema : only sect element -->
        <antcall target="Makehdoc">
            <param name="hdocName" value="sect"/>
        </antcall>

        <delete dir="${basedir}/temp"/>
        <echo>----------------------------End of conversion----------------------------------</echo>
    </target>
    
    <target name="preparation">
        <echo>Setting up the conversion</echo>
        <delete dir="${basedir}/temp"></delete>
        <mkdir dir="${basedir}/temp" />
        <delete dir="${resultFile}/hdoc"></delete>
        <mkdir dir="${resultFile}/hdoc" />
        <delete dir="${resultFile}/scar"></delete>
        <mkdir dir="${resultFile}/scar" />
        <!--<condition>
          <equals arg1="${foo}" arg2=""/>
        </condition> -->
        <!-- //delete temp -->  
        <echo>--- End ----</echo>
    </target>
    
   <!-- Convert a mindMap file into a hdoc, with a xsl schema specified in the parameter -->
   <target name="Makehdoc" >
       <echo>Begin data conversion</echo>
      <!-- to generate scar files -->
      <antcall target="hdoc_conversion"/>
      <antcall target="opale_conversion"/>
    <!-- </condition> -->
       
        <!--<delete dir="${resultFile}/hdoc"></delete>-->
       <echo>end data conversion</echo>
   </target>

  <target name="hdoc_conversion">
      <!-- <condition property="converting.set" else="false"> -->
       <ant antfile="${basedir}/../mindmapping_to_hdoc/mindmapping_to_hdoc.ant" dir="${basedir}/../mindmapping_to_hdoc">
            <property name="InputPath" value="${inputPath}"/>
        </ant>
   </target>

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
	<target depends="ifOSWindows, ifOSUnix" name="opale_conversion"/>
		
	<condition property="isOSUnix">
		<os family="unix" />
	</condition>
	
	<condition property="isOSWindows">
		<os family="windows" />
	</condition>
	
	<!-- if the OS is windows call the target run.script.windows -->
	<target name="ifOSWindows" if="isOSWindows">
		<echo>is Windows........</echo>
		<antcall target="opale_conversion.windows"/>
	</target>
	
	<!-- if the OS is not windows call the target run.script.unix-->
	<target name="ifOSUnix" if="isOSUnix">
		<echo>is Unix........</echo>
		<antcall target="opale_conversion.unix"/>
	</target>
	
	<target name="opale_conversion.windows">
		<echo>This is a Windows machine.</echo>
84
		<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
85
		<exec dir="${basedir}/../hdoc_to_opale" executable="cmd">
86
87
88
89
90
91
92
			<arg value="${basedir}/../hdoc_to_opale/run.bat"/>
		</exec>
			<!-- <copy file="${basedir}/../hdoc_to_opale/output/output.scar" todir="${resultFile}/scar/${hdocName}.scar"/>-->
	</target>
	
	<target name="opale_conversion.unix">
		<echo>This is an Unix machine.</echo>
93
	   	<copy file="${resultFile}/hdoc/${hdocName}.hdoc" todir="${basedir}/../hdoc_to_opale/input"/>
94
		<exec dir="${basedir}/../hdoc_to_opale" executable="/bin/sh">
95
96
97
98
			<arg value="${basedir}/../hdoc_to_opale/run.sh"/>
		</exec>
			<!-- <copy file="${basedir}/../hdoc_to_opale/output/output.scar" todir="${resultFile}/scar/${hdocName}.scar"/>-->
	</target>
99
100
101
102
103
104
</project>