forked from getlantern/lantern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickRun.bash
executable file
·49 lines (39 loc) · 1.48 KB
/
quickRun.bash
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
46
47
48
49
#!/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
#run the minified version if available
if [ -e target/lantern*SNAPSHOT-small.jar ]
then
jar=target/lantern*SNAPSHOT-small.jar
else
jar=target/lantern*SNAPSHOT.jar
fi
# 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 -jar $jar $*"
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 -p`
javaArgs="-Djava.library.path=lib/linux/$proc $javaArgs"
fi
[ $(uname) == "Darwin" ] && extras="-XstartOnFirstThread"
echo "Running using Java on path at `which java` with args $javaArgs"
java $extras $javaArgs || die "Java process exited abnormally"
#java $javaArgs org.lantern.Launcher || die "Java process exited abnormally"