misc/decompile
author Christian Urban <urbanc@in.tum.de>
Fri, 22 Nov 2019 17:01:55 +0000
changeset 324 2969ee4a6cee
parent 323 1f8005b4cdf6
child 329 8a34b2ebc8cc
permissions -rwxr-xr-x
updated

#!/bin/bash
set -euo pipefail

trap "exit" INT

files=${1:-assignment2019scala-*}

function scala_compile {
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> /dev/null 1>> /dev/null) 
}

for sd in $files; do
  cd $sd/Part7
  echo $sd
  if (scala_compile docdiff.scala)
  then    
    scalac -g:notailcalls -d docdiff-decompiled.jar docdiff.scala
    java -jar ~/pep-material/procyon-decompiler-0.5.36.jar -ln -jar docdiff-decompiled.jar -o .
    rm CW7a.java
    mv CW7a$.java $sd-CW7a.java
  else
    echo -e "  --> SCALA DID NOT RUN docdiff.scala" 
  fi  
  cd ..
  cd ..
done