Merge branch 'master' of https://Governor-Tarkin@bitbucket.org/Governor-Tarkin/swg...
[swg-src.git] / utils / build_java.sh
blobbee823887c35a4944c55c5cea4602f54ea9abee5
1 #/bin/bash
3 DIR="$( dirname "${BASH_SOURCE[0]}" )"
5 destination="data/sku.0/sys.server/compiled/game"
6 sourcepath="dsrc/sku.0/sys.server/compiled/game"
8 mkdir -p $destination/script
10 filenames=$(find $sourcepath -name '*.java')
11 spinstr='|/-\'
12 i=0
13 current=0
14 total=$(ls ${filenames[@]} | wc -l)
16 for filename in $filenames; do
17 OFILENAME=${filename/$sourcepath/$destination}
18 OFILENAME=${OFILENAME/java/class}
20 if [[ -e $OFILENAME && $filename -nt $OFILENAME ]] || [ ! -e $OFILENAME ]; then
21 result=$(${DIR}/build_java_single.sh $filename 2>&1)
24 if [[ ! -z $result ]]; then
25 printf "\r$filename\n"
26 printf "$result\n\n"
29 current=$((current+1))
30 i=$(( (i+1) %4 ))
31 perc=$(bc -l <<< "scale=0; $current*100/$total")
32 printf "\rCompiling java scripts: [${spinstr:$i:1}] $perc%%"
33 done
35 echo ""