opale_to_canoprof.ant 3.69 KB
Newer Older
Charlotte luszcz's avatar
Charlotte luszcz 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="opale_to_canoprof" default="main">
	<property file="opale_to_canoprof.properties"/>    

    <!-- Check the OS family -->
    <condition property="is_windows">
        <os family="windows"/>
    </condition>
    <condition property="is_unix">
        <os family="unix"/>
    </condition>

	<target name="main">
        <delete dir="${out}" failonerror="false"/>
        <mkdir dir="output"/>
        <antcall target="to_hdoc_unix"/>
        <antcall target="to_hdoc_windows"/> 
        <antcall target="to_canoprof_windows"/>
        <antcall target="to_canoprof_unix"/>       
        <antcall target="to_canoprof_end"/>       
    </target> 

    <!-- Targets if windows -->

    <!-- Conversion opale to hdoc -->
    <!-- 	1. delete the opale_to_hdoc input file -->
    <!-- 	2. copy the local input file to opale_to_hdoc -->
    <!-- 	3. run the opale_to_hdoc conversion -->
    <target name="to_hdoc_windows" if="${is_windows}">
        <delete>
            <fileset dir="${opa_in}">
                <include name="*.scar"/>
            </fileset>
        </delete>
        <copy todir="${opa_in}">
            <fileset dir="${in}">
                <include name="*.scar"/>
            </fileset>
        </copy> 
        <exec dir="../opale_to_hdoc" executable="../opale_to_hdoc/run.bat"/>
    </target>

    <!-- Conversion hdoc to canoprof -->
    <!-- 	1. delete the hdoc_to_canoprof input file -->
    <!-- 	2. copy the opale_to_hdoc's output file to hdoc_to_canoprof input folder -->
    <!-- 	3. run the hdoc_to_canoprof conversion -->
     <target name="to_canoprof_windows" if="${is_windows}">
        <delete>
            <fileset dir="${cano_in}">
                <include name="*.hdoc"/>
            </fileset>
        </delete>
        <copy todir="${cano_in}">
            <fileset dir="${opa_out}">
                <include name="*.hdoc"/>
            </fileset>
        </copy> 
        <exec dir="../hdoc_to_canoprof" executable="../hdoc_to_canoprof/run.bat"/>
    </target>
    
    <!-- Targets if unix -->

    <!-- Conversion opale to hdoc -->
    <!-- 	1. delete the opale_to_hdoc input file -->
    <!-- 	2. copy the local input file to opale_to_hdoc -->
    <!-- 	3. run the opale_to_hdoc conversion -->
    <target name="to_hdoc_unix" if="${is_unix}">
        <delete>
            <fileset dir="${opa_in}">
                <include name="*.scar"/>
            </fileset>
        </delete>
        <copy todir="${opa_in}">
            <fileset dir="${in}">
                <include name="*.scar"/>
            </fileset>
        </copy> 
        <exec executable="/bin/bash" dir="../opale_to_hdoc">
            <arg value="../opale_to_hdoc/run.sh"/>
        </exec>
    </target>
    
    <!-- Conversion hdoc to canoprof -->
    <!-- 	1. delete the hdoc_to_canoprof input file -->
    <!-- 	2. copy the opale_to_hdoc's output file to hdoc_to_canoprof input folder -->
    <!-- 	3. run the hdoc_to_canoprof conversion -->
    <target name="to_canoprof_unix" if="${is_unix}">
        <delete>
            <fileset dir="${cano_in}">
                <include name="*.hdoc"/>
            </fileset>
        </delete>
        <copy todir="${cano_in}">
            <fileset dir="${opa_out}">
                <include name="*.hdoc"/>
            </fileset>
        </copy> 
        <exec executable="/bin/bash" dir="../hdoc_to_canoprof">
            <arg value="../hdoc_to_canoprof/run.sh"/>
        </exec>
    </target>
    
    <!-- After the file is converted to canoprof, copy the resulting file to opale_to_canoprof's output folder -->
    <target name="to_canoprof_end">
        <copy todir="${out}">
            <fileset dir="${cano_out}"/>
        </copy>
    </target>

</project>