misc/decompile
author Christian Urban <urbanc@in.tum.de>
Fri, 22 Nov 2019 17:01:55 +0000
changeset 324 37c86984ecdc
parent 323 93b6c16dded8
child 329 828326d1b3b2
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
323
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
set -euo pipefail
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
trap "exit" INT
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
324
37c86984ecdc updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
     6
files=${1:-assignment2019scala-*}
323
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
function scala_compile {
93b6c16dded8 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) 
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
}
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
for sd in $files; do
324
37c86984ecdc updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
    13
  cd $sd/Part7
323
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  echo $sd
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  if (scala_compile docdiff.scala)
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  then    
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
    scalac -g:notailcalls -d docdiff-decompiled.jar docdiff.scala
93b6c16dded8 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 .
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
    rm CW7a.java
324
37c86984ecdc updated
Christian Urban <urbanc@in.tum.de>
parents: 323
diff changeset
    20
    mv CW7a$.java $sd-CW7a.java
323
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  else
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
    echo -e "  --> SCALA DID NOT RUN docdiff.scala" 
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
  fi  
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
  cd ..
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
  cd ..
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
done
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
93b6c16dded8 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28