341
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
#!/bin/sh
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
###set -e
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
4 |
trap "exit" INT
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
5 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
6 |
function scala_compile {
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
7 |
(ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
}
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
9 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
11 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
12 |
files=${1:-assignment2019scala-*/Part10}
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
14 |
name="bf.scala"
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
15 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
16 |
for sd in $files; do
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
17 |
scalafix -r DisableSyntax --settings.DisableSyntax.noVars=true --settings.DisableSyntax.noReturns=true --settings.DisableSyntax.noWhileLoops=true $sd/$name 2> /dev/null 1> /dev/null
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
18 |
ts=$(( $? ))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
19 |
if [ $ts -ne 0 ]
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
20 |
then
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
21 |
echo $sd
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
22 |
echo $ts
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
23 |
else
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
24 |
if (scala_compile $sd/$name)
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
25 |
then
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
26 |
ts=$(( 0 ))
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
27 |
else
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
28 |
echo $sd
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
29 |
echo $ts
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
30 |
fi
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
31 |
fi
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
32 |
done
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
33 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
34 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
35 |
|