Commit 34894f9e authored by Jean-Baptiste Martin's avatar Jean-Baptiste Martin

optim_to_opale skeleton

parent 9f598be8
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." name="myantce" default="main">
<property name="in" location="${basedir}/input"/>
<property name="out" location="${basedir}/output"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="xsl" location="${basedir}/xsl"/>
<property name="lib" location="${basedir}/lib"/>
<property name="log" location="${basedir}/log"/>
<property name="optim_to_hdoc" location="${basedir}/../optim_to_hdoc"/>
<property name="hdoc_to_opale" location="${basedir}/../hdoc_to_opale"/>
<property name="optim_to_hdoc_in" location="${basedir}/../optim_to_hdoc/input"/>
<property name="hdoc_to_opale_in" location="${basedir}/../hdoc_to_opale/input"/>
<property name="optim_to_hdoc_out" location="${basedir}/../optim_to_hdoc/output"/>
<property name="hdoc_to_opale_out" location="${basedir}/../hdoc_to_opale/output"/>
<!-- Mandatory ressource to use if conditions -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="${lib}"/>
</classpath>
</taskdef>
<!-- Main target -->
<target name="main">
<antcall target="clean"/>
<if>
<length length="0" when="greater">
<fileset dir="${in}" followsymlinks="false"/>
</length>
<then>
<!-- input Dir Not Empty -->
<antcall target="add_log">
<param name="msg" value="input directory is not empty"/>
</antcall>
<antcall target="prepare_optim_to_hdoc"/>
<antcall target="run_optim_to_hdoc"/>
<antcall target="prepare_hdoc_to_opale"/>
<antcall target="run_hdoc_to_opale"/>
</then>
<else>
<!-- input Dir Empty -->
<antcall target="add_log">
<param name="msg" value="input directory is empty"/>
</antcall>
</else>
</if>
</target>
<!-- Moves files in optim_to_hdoc hierarchy -->
<target name="prepare_optim_to_hdoc">
<antcall target="add_log">
<param name="msg" value="Copying input files into optim_to_hdoc input directory"/>
</antcall>
<copy todir="${optim_to_hdoc_in}">
<fileset dir="${in}"/>
</copy>
</target>
<!-- Simply run optim_to_hdoc script -->
<target name="run_optim_to_hdoc">
</target>
<!-- Moves files in hdoc_to_opale hierarchy -->
<target name="prepare_hdoc_to_opale">
<antcall target="add_log">
<param name="msg" value="Copying optim_to_hdoc output files into hdoc_to_opale input directory"/>
</antcall>
<copy todir="${hdoc_to_opale_in}">
<fileset dir="${optim_to_hdoc_out}"/>
</copy>
</target>
<!-- Simply run hdoc_to_opale script -->
<target name="run_hdoc_to_opale"></target>
<!-- Move files to the outut directory -->
<target name="output_files">
<antcall target="add_log">
<param name="msg" value="Copying hdoc_to_opale output files into optim_to_opale output directory"/>
</antcall>
<copy todir="${out}">
<fileset dir="${hdoc_to_opale_out}"/>
</copy>
</target>
<target name="add_log">
<tstamp>
<format property="now" pattern="HH:mm:ss:sss" locale="fr,FR"/>
</tstamp>
<echo message="[${now}] ${msg}&#xa;" file="${log}/execution.log" append="true"/>
<echo message="${msg}"/>
</target>
<target name="clean">
<delete dir="${log}" failonerror="false"/>
<mkdir dir="${log}"/>
<antcall target="add_log">
<param name="msg" value="Cleaning directories"/>
</antcall>
<delete dir="${tmp}" failonerror="false"/>
<mkdir dir="${tmp}"/>
<delete dir="${out}" failonerror="false"/>
<mkdir dir="${out}"/>
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=myantce.ant
set antparam=-Dprogram.param=%1
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="myantce.ant"
antparam="-Dprogram.param=$1"
#Recherche de java et controle que se soit une version SUN
vJavaCmd="java"
xCheckJava () {
vInputVarName=\$"$1"
vInputVarVal=`eval "expr \"$vInputVarName\" "`
if [ -z "$vInputVarVal" ];then
eval "$1=false"
return
fi
vSunJavaFound=`$vInputVarVal -version 2>&1 | grep -Eo -m 1 "(HotSpot)|(OpenJDK)"`
if [ "$vSunJavaFound" != "HotSpot" ] && [ "$vSunJavaFound" != "OpenJDK" ] ; then
eval "$1=false"
return
fi
}
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
vJavaCmd="$JAVA_HOME/bin/java"
xCheckJava vJavaCmd
if [ "$vJavaCmd" = "false" ]; then
echo "ERREUR: JRE de SUN introuvable. Veuillez déclarer la variable d'environnement JAVA_HOME."
exit 1
fi
fi
#Lancer la commande
scJarList="$lib/*"
$vJavaCmd -classpath "$scJarList:" -Xmx150m org.apache.tools.ant.Main -buildfile $ant $antparam
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