#! /usr/bin/env dash
# shellcheck disable=SC2086

. ./lib
cd ..

export CLASSPATH=
scr=$(mktemp)

while IFS= read -r a;do
    export CLASSPATH=$CLASSPATH$a:
done < "$(tmp "find libs/ | sed 1d")"

while IFS= read -r a;do
    echo "$a" >> $scr
done < "$(tmp "find scr/ | sed 1d")"

javac -d target/ $(cat $scr | tr '\n' ' ')
../jj target/ libs/
[ "$1" = "r" ] && java -jar out/myJar.jar

rm $scr