323
|
1 |
#!/bin/bash
|
|
2 |
set -euo pipefail
|
|
3 |
|
|
4 |
trap "exit" INT
|
|
5 |
|
324
|
6 |
files=${1:-assignment2019scala-*}
|
323
|
7 |
|
|
8 |
function scala_compile {
|
|
9 |
(ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2>> /dev/null 1>> /dev/null)
|
|
10 |
}
|
|
11 |
|
329
|
12 |
|
|
13 |
#for sd in $files; do
|
|
14 |
# cd $sd/Part7
|
|
15 |
# echo $sd
|
|
16 |
# if (scala_compile docdiff.scala)
|
|
17 |
# then
|
|
18 |
# scalac -g:notailcalls -d docdiff-decompiled.jar docdiff.scala
|
|
19 |
# java -jar ~/pep-material/procyon-decompiler-0.5.36.jar -ln -jar docdiff-decompiled.jar -o .
|
|
20 |
# rm CW7a.java
|
|
21 |
# mv CW7a$.java $sd-CW7a.java
|
|
22 |
# else
|
|
23 |
# echo -e " --> SCALA DID NOT RUN docdiff.scala"
|
|
24 |
# fi
|
|
25 |
# cd ..
|
|
26 |
# cd ..
|
|
27 |
#done
|
|
28 |
|
|
29 |
|
|
30 |
|
323
|
31 |
for sd in $files; do
|
329
|
32 |
cd $sd/Part9
|
323
|
33 |
echo $sd
|
329
|
34 |
if (scala_compile postfix2.scala)
|
323
|
35 |
then
|
329
|
36 |
scalac -g:notailcalls -d docdiff-decompiled.jar postfix2.scala
|
323
|
37 |
java -jar ~/pep-material/procyon-decompiler-0.5.36.jar -ln -jar docdiff-decompiled.jar -o .
|
329
|
38 |
rm CW9b.java
|
|
39 |
mv CW9b$.java $sd-CW9b.java
|
323
|
40 |
else
|
|
41 |
echo -e " --> SCALA DID NOT RUN docdiff.scala"
|
|
42 |
fi
|
|
43 |
cd ..
|
|
44 |
cd ..
|
|
45 |
done
|