Commit 9870e0e3 authored by Jean-Baptiste Martin's avatar Jean-Baptiste Martin

Ant script now can be run on multiple OS

parent 355e15ff
......@@ -21,10 +21,23 @@
</taskdef>
<!-- CHECK FOR WINDOWS FAMILY OS -->
<condition property="is_windows">
<os family="windows"/>
</condition>
<condition property="is_unix">
<os family="unix"/>
</condition>
<!-- Main target -->
<target name="main">
<antcall target="clean"/>
<!-- Check that the input directory is not empty -->
<if>
<length length="0" when="greater">
<fileset dir="${in}" followsymlinks="false"/>
......@@ -53,6 +66,8 @@
<!-- optim_to_hdoc -->
<!-- Moves files in optim_to_hdoc hierarchy -->
<target name="prepare_optim_to_hdoc">
<antcall target="add_log">
......@@ -66,9 +81,37 @@
<!-- Simply run optim_to_hdoc script -->
<target name="run_optim_to_hdoc">
<antcall target="run_optim_to_hdoc_unix"/>
<antcall target="run_optim_to_hdoc_windows"/>
</target>
<!-- Run optim_to_hdoc bat -->
<target name="run_optim_to_hdoc_windows" if="${is_windows}">
<antcall target="add_log">
<param name="msg" value="Running optim_to_hdoc bat script"/>
</antcall>
<exec executable="cmd">
<arg value="${optim_to_hdoc}/run.bat"/>
</exec>
</target>
<!-- Run optim_to_hdoc sh -->
<target name="run_optim_to_hdoc_unix" if="${is_unix}">
<antcall target="add_log">
<param name="msg" value="Running optim_to_hdoc shell script"/>
</antcall>
<exec executable="/bin/bash">
<arg value="${optim_to_hdoc}/run.sh"/>
</exec>
</target>
<!-- hdoc_to_opale -->
<!-- Moves files in hdoc_to_opale hierarchy -->
<target name="prepare_hdoc_to_opale">
<antcall target="add_log">
......@@ -81,7 +124,32 @@
</target>
<!-- Simply run hdoc_to_opale script -->
<target name="run_hdoc_to_opale"></target>
<target name="run_hdoc_to_opale">
<antcall target="run_hdoc_to_opale_unix"/>
<antcall target="run_hdoc_to_opale_windows"/>
</target>
<!-- Run hdoc_to_opale bat -->
<target name="run_hdoc_to_opale_windows" if="${is_windows}">
<antcall target="add_log">
<param name="msg" value="Running hdoc_to_opale bat script"/>
</antcall>
<exec executable="cmd">
<arg value="${hdoc_to_opale}/run.bat"/>
</exec>
</target>
<!-- Run hdoc_to_opale sh -->
<target name="run_hdoc_to_opale_unix" if="${is_unix}">
<antcall target="add_log">
<param name="msg" value="Running hdoc_to_opale shell script"/>
</antcall>
<exec executable="/bin/bash">
<arg value="${hdoc_to_opale}/run.sh"/>
</exec>
</target>
<!-- Move files to the outut directory -->
<target name="output_files">
......@@ -95,6 +163,12 @@
</target>
<!-- Some basic functions -->
<!-- Print a line both on screen and in log/execution.log file -->
<target name="add_log">
<tstamp>
<format property="now" pattern="HH:mm:ss:sss" locale="fr,FR"/>
......@@ -104,7 +178,7 @@
<echo message="${msg}"/>
</target>
<!-- Cleaning directories -->
<target name="clean">
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment