Source

syntactic / bin / convert.sh

Full commit
#!/bin/bash

cd $(dirname $0)
cd ..

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home/"

CP="parser/output/ant/classes/parser:convert/output/ant/classes/main"
for JAR in lib/core/*.jar
do
    CP="${CP}:${JAR}"
done

for JAR in lib/samples/*.jar
do
    if [ -z "${CP2}" ]
    then
        CP2="${JAR}"
    else
        CP2="${CP2}:${JAR}"
    fi
done

MAIN="org.adjective.syntactic.convert.j8to7.Main"

OUTPUT="output/convert"
mkdir -p ${OUTPUT}

for FILE in "$@"
do
    java -cp "${CP}" "${MAIN}" --source "${FILE}" --output "${OUTPUT}" --classpath "${CP2}"
    if [ -f ${FILE} ]
    then
        show "${OUTPUT}/$( basename ${FILE} )"
    else
        show ${OUTPUT}
    fi
done