Commit b2a05fc1 authored by Anna Lainé's avatar Anna Lainé

Init folder, run files and ant files

parent cdc7cd5f
<?xml version="1.0" encoding="UTF-8"?>
<project name="wikiToCanoprof" default="main" basedir="..">
<!-- inputFile is the only required parameter to run the script -->
<property name="inputFile" value="input/source.xml"/>
<!-- Name of the output file -->
<basename property="filename" file="${inputFile}" suffix=".xml"/>
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
<antcall target="move_input_xml_wikipediaToCanoprof_into_input_wikipediaToHdoc"/>
<antcall target="wiki_to_hdoc"/>
<antcall target="move_output_hdoc_wikipediaToHdoc_into_input_hdocToCanoprof"/>
<antcall target="hdoc_to_canoprof"/>
<antcall target="move_output_hdocToCanoprof_into_ouput_wikipediaToCanoprof"/>
</target>
<target name="move_input_xml_wikipediaToCanoprof_into_input_wikipediaToHdoc">
<copy todir="../wikipedia_to_hdoc/input" file="input/source.xml"/>
</target>
<target name="wiki_to_hdoc">
<!-- First: wiki to Hdoc -->
<ant antfile="../wikipedia_to_hdoc/ant/wiki_to_hdoc.ant" dir="../wikipedia_to_hdoc"/>
</target>
<target name="move_output_hdoc_wikipediaToHdoc_into_input_hdocToCanoprof">
<!--copy .hdoc file from wikipedia_to_hdoc_result into input of hdoc_to_canoprof -->
<!-- <delete dir="../hdoc_to_canoprof/input"/>
<mkdir dir="../hdoc_to_canoprof/input"/>
<copy todir="../hdoc_to_canoprof/input" file="../wikipedia_to_hdoc/result/${filename}/${filename}.hdoc"/> -->
<mkdir dir="./testing_ant"/>
<copy todir="./testing_ant" file="../wikipedia_to_hdoc/result/${filename}/${filename}.hdoc"/>
</target>
<target name="hdoc_to_canoprof">
<!-- Mandatory ressource to use if conditions -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="lib"/>
</classpath>
</taskdef>
<!-- Check for family OS -->
<condition property="is_windows">
<os family="windows"/>
</condition>
<condition property="is_unix">
<os family="unix"/>
</condition>
<antcall target="run_hdoc_to_canoprof_unix"/>
<antcall target="run_hdoc_to_canoprof_windows"/>
</target>
<!-- Run hdoc_to_canoprof bat -->
<target name="run_hdoc_to_canoprof_windows" if="${is_windows}">
<!-- <exec executable="cmd" dir="${hdoc_to_canoprof}">
<arg value="/c"/>
<arg value="${hdoc_to_canoprof}/run.bat"/>
</exec> -->
</target>
<!-- Run hdoc_to_canoprof sh -->
<target name="run_hdoc_to_canoprof_unix" if="${is_unix}">
<!-- <exec executable="/bin/bash" dir="${hdoc_to_canoprof}">
<arg value="${hdoc_to_canoprof}/run.sh"/>
</exec> -->
</target>
<target name="move_output_hdocToCanoprof_into_ouput_wikipediaToCanoprof">
<!-- <copy todir="${resultPath}" failonerror="false">
<fileset dir="../hdoc_to_canoprof/output" includes="**"/>
</copy> -->
</target>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project name="wikiToCanoprof" default="main" basedir="..">
<!-- Path -->
<property name="resultPath" value="${basedir}/result"/>
<property name="hdoc_to_canoprof" location="${basedir}/../hdoc_to_canoprof"/>
<target name="main">
<antcall target="wiki_to_hdoc"/>
<antcall target="move_output_hdoc_wikipediaToHdoc_into_input_hdocToCanoprof"/>
<antcall target="hdoc_to_canoprof"/>
<antcall target="move_output_hdocToCanoprof_into_ouput_wikipediaToCanoprof"/>
</target>
<target name="wiki_to_hdoc">
<!-- First: wiki to Hdoc -->
<ant antfile="../wikipedia_to_hdoc/ant/wiki_to_hdoc_fetcher.ant" dir="../wikipedia_to_hdoc"/>
</target>
<target name="move_output_hdoc_wikipediaToHdoc_into_input_hdocToCanoprof">
<!--copy .hdoc file from wikipedia_to_hdoc_result into input of hdoc_to_opale -->
<!--<delete dir="../hdoc_to_canoprof/input"/>
<mkdir dir="../hdoc_to_canoprof/input"/>
<copy todir="../hdoc_to_canoprof/input" file="../wikipedia_to_hdoc/result/${filename}/${filename}.hdoc"/> -->
<mkdir dir="./testing_ant"/>
<copy todir="./testing_ant" file="../wikipedia_to_hdoc/result/${filename}/${filename}.hdoc"/>
</target>
<target name="hdoc_to_canoprof">
<!-- Mandatory ressource to use if conditions -->
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="lib"/>
</classpath>
</taskdef>
<!-- Check for family OS -->
<condition property="is_windows">
<os family="windows"/>
</condition>
<condition property="is_unix">
<os family="unix"/>
</condition>
<antcall target="run_hdoc_to_canoprof_unix"/>
<antcall target="run_hdoc_to_canoprof_windows"/>
</target>
<!-- Run hdoc_to_canoprof bat -->
<target name="run_hdoc_to_canoprof_windows" if="${is_windows}">
<!--<exec executable="cmd" dir="${hdoc_to_canoprof}">
<arg value="/c"/>
<arg value="${hdoc_to_canoprof}/run.bat"/>
</exec>-->
</target>
<!-- Run hdoc_to_canoprof sh -->
<target name="run_hdoc_to_canoprof_unix" if="${is_unix}">
<!--<exec executable="/bin/bash" dir="${hdoc_to_canoprof}">
<arg value="${hdoc_to_canoprof}/run.sh"/>
</exec>-->
</target>
<target name="move_output_hdocToCanoprof_into_ouput_wikipediaToCanoprof">
<!--<copy todir="${resultPath}" failonerror="false">
<fileset dir="../hdoc_to_canoprof/output" includes="**"/>
</copy>-->
</target>
</project>
\ No newline at end of file
@echo off
set lib=lib
set ant=ant/wiki_to_canoprof.ant
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="ant/wiki_to_canoprof.ant"
#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
@echo off
set lib=lib
set ant=ant/wiki_to_canoprof_fetcher.ant
set url=%1
set filename=%2
set scJarList=%lib%\*
java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% -DwikipediaUrl %url% -Dfilename %filename%
pause
REM start /MIN java.exe -classpath "%scJarList%" -Xmx150m org.apache.tools.ant.Main -buildfile %ant% %antparam%
#!/bin/sh
lib="lib"
ant="ant/wiki_to_canoprof_fetcher.ant"
url="$1"
filename="$2"
#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 -DwikipediaUrl $url -Dfilename $filename
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