1) bye-bye idea.properties in MacOS ides bundles 2) [ide_name].sh scripts were updated to work on MacOS + fetch system and vmoptions from Info.plist

This commit is contained in:
Roman Chernyatchik
2011-05-06 20:47:22 +04:00
parent 82ab67d384
commit 17d2b5d003
2 changed files with 39 additions and 7 deletions

View File

@@ -9,18 +9,32 @@
# Before you run PyCharm specify the location of the
# JDK 1.6 installation directory which will be used for running PyCharm
# ---------------------------------------------------------------------
[[ `uname -s` = "Darwin" ]] && OS_TYPE="MAC" || OS_TYPE="NOT_MAC"
if [ -z "$PYCHARM_JDK" ]; then
PYCHARM_JDK=$JDK_HOME
if [ -z "$PYCHARM_JDK" -a -e "$JAVA_HOME/lib/tools.jar" ]; then
# if jdk still isn't defined and JAVA_HOME looks correct. "tools.jar" isn't included in Mac OS Java bundle
if [ -z "$PYCHARM_JDK" ] && ([ "$OS_TYPE" = "MAC" -a -e "$JAVA_HOME/bin/java" ] || [ -e "$JAVA_HOME/lib/tools.jar" ]); then
PYCHARM_JDK=$JAVA_HOME
fi
if [ -z "$PYCHARM_JDK" ]; then
# Try to get the jdk path from java binary path
JAVA_BIN_PATH=`which java`
if [ -n "$JAVA_BIN_PATH" ]; then
JAVA_LOCATION=`readlink -f $JAVA_BIN_PATH | xargs dirname | xargs dirname | xargs dirname`
if [ -x "$JAVA_LOCATION/bin/java" ]; then
PYCHARM_JDK=$JAVA_LOCATION
# Mac readlink doesn't support -f option.
[[ "$OS_TYPE" = "MAC" ]] && CANONICALIZE_OPTION="" || CANONICALIZE_OPTION="-f"
JAVA_LOCATION=`readlink $CANONICALIZE_OPTION $JAVA_BIN_PATH | xargs dirname | xargs dirname | xargs dirname`
if [ "$OS_TYPE" = "MAC" ]; then
# Current MacOS jdk:
if [ -x "$JAVA_LOCATION/CurrentJDK/Home/bin/java" ]; then
PYCHARM_JDK="$JAVA_LOCATION/CurrentJDK/Home"
fi
else
if [ -x "$JAVA_LOCATION/bin/java" ]; then
PYCHARM_JDK="$JAVA_LOCATION"
fi
fi
fi
fi
@@ -91,8 +105,22 @@ if [ "@@isEap@@" = "true" ]; then
AGENT="-agentlib:yjpagent$BITS=disablej2ee,sessionname=pycharm"
fi
REQUIRED_JVM_ARGS="-Xbootclasspath/a:../lib/boot.jar -Didea.platform.prefix=Python -Didea.no.jre.check=true -Didea.paths.selector=@@system_selector@@ $AGENT $PYCHARM_PROPERTIES_PROPERTY $REQUIRED_JVM_ARGS"
JVM_ARGS=`tr '\n' ' ' < "$PYCHARM_VM_OPTIONS"`
[[ -e $PYCHARM_HOME/Contents/Info.plist ]] && BUNDLE_TYPE="MAC" || BUNDLE_TYPE="NOT_MAC"
# If vmoptions file exists - use it
if [ -e "$PYCHARM_VM_OPTIONS" ]; then
JVM_ARGS=`tr '\n' ' ' < "$PYCHARM_VM_OPTIONS"`
# don't extract vm options from Info.plist in mac bundle
INFO_PLIST_PARSER_OPTIONS=""
else
[[ "$BUNDLE_TYPE" = "MAC" ]] && [[ "$BITS" == "64" ]] && INFO_PLIST_PARSER_OPTIONS=" 64" || INFO_PLIST_PARSER_OPTIONS=" 32"
fi
# In MacOS ./Contents/Info.plist describes all vm options & system properties
[[ "$OS_TYPE" = "MAC" ]] && [[ "$BUNDLE_TYPE" = "MAC" ]] && [[ -z "$PYCHARM_PROPERTIES_PROPERTY" ]] && MAC_IDEA_PROPERTIES="`\"osascript $PYCHARM_BIN_HOME/info_plist_parser.scpt\"$INFO_PLIST_PARSER_OPTIONS`" || MAC_IDEA_PROPERTIES=""
REQUIRED_JVM_ARGS="-Xbootclasspath/a:../lib/boot.jar -Didea.platform.prefix=Python -Didea.no.jre.check=true -Didea.paths.selector=@@system_selector@@ $MAC_IDEA_PROPERTIES $AGENT $PYCHARM_PROPERTIES_PROPERTY $REQUIRED_JVM_ARGS"
JVM_ARGS="$JVM_ARGS $REQUIRED_JVM_ARGS"
CLASSPATH=../lib/bootstrap.jar

View File

@@ -228,9 +228,12 @@ target('default': "Build artifacts") {
def root = isEap() ? "PyCharm-${buildNumber}.app" : "PyCharm ${p("component.version.major")}.${p("component.version.minor")}.app"
ant.zip(zipfile: "${paths.artifacts}/pycharm${buildName}.sit") {
tarfileset(dir: paths.distAll, prefix: root)
tarfileset(dir: paths.distAll, prefix: root) {
exclude(name: "bin/idea.properties")
}
tarfileset(dir: paths.distMac, prefix: root) {
exclude(name: "bin/*.sh")
exclude(name: "bin/idea.properties")
exclude(name: "Contents/MacOS/idea")
}
tarfileset(dir: paths.distMac, filemode: "755", prefix: root) {
@@ -509,6 +512,7 @@ def layoutMac(Map args, String target) {
args["bundle_name"] = "PyCharm"
args["bundleIdentifier"] = "com.jetbrains.pycharm"
args["platform_prefix"] = "Python"
args["idea.properties.path"] = "$home/python/build/idea.properties"
layoutMacApp(target, "$home/community", args)