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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
set -euo pipefail
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
trap "exit" INT
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
324
2969ee4a6cee updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
     6
files=${1:-assignment2019scala-*}
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
function scala_compile {
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> /dev/null 1>> /dev/null) 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
}
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
for sd in $files; do
324
2969ee4a6cee updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
    13
  cd $sd/Part7
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  echo $sd
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  if (scala_compile docdiff.scala)
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  then    
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
    scalac -g:notailcalls -d docdiff-decompiled.jar docdiff.scala
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
    java -jar ~/pep-material/procyon-decompiler-0.5.36.jar -ln -jar docdiff-decompiled.jar -o .
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
    rm CW7a.java
324
2969ee4a6cee updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
    20
    mv CW7a$.java $sd-CW7a.java
323
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  else
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
    echo -e "  --> SCALA DID NOT RUN docdiff.scala" 
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
  fi  
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
  cd ..
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
  cd ..
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
done
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
1f8005b4cdf6 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28