forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell
executable file
·45 lines (34 loc) · 1.41 KB
/
shell
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
function die() {
echo $*
exit 1
}
path=`dirname $0`
# Launching lantern only works from within its directory.
cd $path
# make sure required submodules have been initialized
submodules=$(grep -o '^\[submodule "[^"]\+"\]$' .gitmodules | cut -d'"' -f2)
for i in "${submodules}"
do
ls $i/.git > /dev/null || die "Were git submodules initialized? (hint: git submodule update --init)"
done
ls *.hprof &> /dev/null && echo "don't run now, there's an hprof file:" && ls *.hprof && die
jar=`ls target/lantern-*SNAPSHOT.jar | sort | tail -n 1`
echo "Running jar $jar"
# We need to copy the bouncycastle jar in separately because it's signed.
# The shaded jar includes it in the classpath in its manifest.
test -f target/bcprov-jdk16-1.46.jar || cp install/common/bcprov-jdk16-1.46.jar target/
javaArgs="-XX:+HeapDumpOnOutOfMemoryError -Djna.nosys=true -classpath $jar:bsh-2.0b4.jar bsh.Interpreter $*"
if [ "$RUN_LANTERN_DEBUG_PORT" ]
then
javaArgs="-Xdebug -Xrunjdwp:transport=dt_socket,address=$RUN_LANTERN_DEBUG_PORT,server=y,suspend=y $javaArgs"
fi
if [ $(uname) == "Linux" ]
then
proc=`uname -m`
javaArgs="-Djava.library.path=lib/linux/$proc $javaArgs"
fi
[ $(uname) == "Darwin" ] && extras="-XstartOnFirstThread"
echo "Running: `which java` $extras $javaArgs"
java $extras $javaArgs || die "Java process exited abnormally"
#java $javaArgs org.lantern.Launcher || die "Java process exited abnormally"