-
Notifications
You must be signed in to change notification settings - Fork 288
/
mps.sh
58 lines (52 loc) · 1.96 KB
/
mps.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
UNAME=`uname`
SCRIPT_PATH="$0"
if [ "${UNAME}" = "Linux" ]; then
# readlink resolves symbolic links, but on linux only
SCRIPT_PATH=`readlink -f "$0"`
fi
PROJECT_HOME=`dirname "${SCRIPT_PATH}"`
PROJECT_HOME_FROM_STARTUP_DIR=..
if [ -z "${JDK_HOME}" ]; then
JAVA=java
else
JAVA="${JDK_HOME}/bin/java"
echo "$0 info: Using jdk located in ${JDK_HOME}."
fi
MAIN_CLASS=jetbrains.mps.Launcher
if [ -z "${MPS_VM_OPTIONS}" ]; then
MPS_VM_OPTIONS="${PROJECT_HOME}/bin/mps.vmoptions"
else
echo "$0 info: Using vmoptions defined in ${MPS_VM_OPTIONS}."
fi
JVM_ARGS=`tr '\n' ' ' <${MPS_VM_OPTIONS} | tr '\r' ' '`
# ADDITIONAL_JVM_ARGS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
CLASSPATH=""
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/idea-patch.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/mps.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/jdom/jdom.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/jetbrains-ideframework/boot.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/jetbrains-ideframework/bootstrap.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/jetbrains-ideframework/extensions.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/jetbrains-ideframework/util.jar
CLASSPATH=${CLASSPATH}:${PROJECT_HOME_FROM_STARTUP_DIR}/lib/log4j/log4j.jar
cd ${PROJECT_HOME}
cd bin
if [ "${UNAME}" = "Darwin" ]; then
if [ -z ${DYLD_LIBRARY_PATH} ]; then
DYLD_LIBRARY_PATH=${PWD}
else
DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${PWD}
fi
export DYLD_LIBRARY_PATH
elif [ "${UNAME}" = "Linux" ]; then
if [ -z ${LD_LIBRARY_PATH} ]; then
LD_LIBRARY_PATH=${PWD}
else
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PWD}
fi
export LD_LIBRARY_PATH
else
echo "$0 warning: Unknown operating system ${UNAME}. Do not know how to add PWD to libraries path."
fi
${JAVA} ${JVM_ARGS} ${ADDITIONAL_JVM_ARGS} -classpath ${CLASSPATH} ${MAIN_CLASS} $*