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

Ant script now can be run on multiple OS

parent 355e15ff
......@@ -21,10 +21,23 @@
<condition property="is_windows">
<os family="windows"/>
<condition property="is_unix">
<os family="unix"/>
<!-- Main target -->
<target name="main">
<antcall target="clean"/>
<!-- Check that the input directory is not empty -->
<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"/>
<!-- 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"/>
<exec executable="cmd">
<arg value="${optim_to_hdoc}/run.bat"/>
<!-- 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"/>
<exec executable="/bin/bash">
<arg value="${optim_to_hdoc}/"/>
<!-- hdoc_to_opale -->
<!-- Moves files in hdoc_to_opale hierarchy -->
<target name="prepare_hdoc_to_opale">
<antcall target="add_log">
......@@ -81,7 +124,32 @@
<!-- 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"/>
<!-- 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"/>
<exec executable="cmd">
<arg value="${hdoc_to_opale}/run.bat"/>
<!-- 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"/>
<exec executable="/bin/bash">
<arg value="${hdoc_to_opale}/"/>
<!-- Move files to the outut directory -->
<target name="output_files">
......@@ -95,6 +163,12 @@
<!-- Some basic functions -->
<!-- Print a line both on screen and in log/execution.log file -->
<target name="add_log">
<format property="now" pattern="HH:mm:ss:sss" locale="fr,FR"/>
......@@ -104,7 +178,7 @@
<echo message="${msg}"/>
<!-- Cleaning directories -->
<target name="clean">
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
Supports Markdown
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