-
Notifications
You must be signed in to change notification settings - Fork 18
/
include.sh
30 lines (26 loc) · 718 Bytes
/
include.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
gapt_version="2.16.0"
heap_size="2g"
stack_size="20m"
for _binary in "$JAVA_HOME/bin/java" "$(which java)"; do
if [[ -x "$_binary" ]]; then
java="$_binary"
break
fi
done
if [[ -z "$java" ]]; then
echo "Java executable not found, please check your path and maybe set JAVA_HOME correctly." >&2
exit 1
fi
for _jar in "$basedir/gapt-$gapt_version.jar" "$basedir/target/scala-2.13/root-assembly-$gapt_version.jar"; do
if [[ -f "$_jar" ]]; then
gapt_jar="$_jar"
break
fi
done
if [[ -z "$gapt_jar" ]]; then
echo "Could not find gapt jar. Run sbt assembly." >&2
exit 1
fi
run_gapt() {
"$java" -Xmx"$heap_size" -Xss"$stack_size" -cp ".:$gapt_jar" "$@"
}