diff --git a/build/conf/mac/Contents/Info.plist b/build/conf/mac/Contents/Info.plist
index 0345101de5f6..d13854c5f77a 100644
--- a/build/conf/mac/Contents/Info.plist
+++ b/build/conf/mac/Contents/Info.plist
@@ -79,13 +79,15 @@
idea.java.redist
NoJavaDistribution
+ idea.home.path
+ $APP_PACKAGE/Contents
VMOptions
@@vmoptions@@ -Xbootclasspath/a:../lib/boot.jar
WorkingDirectory
- $APP_PACKAGE/bin
+ $APP_PACKAGE/Contents/bin
diff --git a/build/conf/mac/Contents/MacOS/idea b/build/conf/mac/Contents/MacOS/idea
index 3f5d2c46a401..dd2b1ac71099 100755
Binary files a/build/conf/mac/Contents/MacOS/idea and b/build/conf/mac/Contents/MacOS/idea differ
diff --git a/build/scripts/dist.gant b/build/scripts/dist.gant
index fef520364283..a79fb54395d0 100644
--- a/build/scripts/dist.gant
+++ b/build/scripts/dist.gant
@@ -126,8 +126,8 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps =
buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", [paths.distAll, paths.distWin])
def macAppRoot = isEap() ?
- "IntelliJ IDEA ${p("component.version.major")} CE EAP.app" :
- "IntelliJ IDEA ${p("component.version.major")} CE.app"
+ "IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents" :
+ "IntelliJ IDEA ${p("component.version.major")} CE.app/Contents"
String macZip = "$paths.artifacts/idea${args.buildNumber}.mac.zip"
buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac)
diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant
index e1f0571b9a5f..2ac5d37aaa07 100644
--- a/build/scripts/utils.gant
+++ b/build/scripts/utils.gant
@@ -310,7 +310,7 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
}
ant.copy(todir: path) {
- fileset(dir: "$ch/build/conf/mac")
+ fileset(dir: "$ch/build/conf/mac/Contents")
}
ant.tstamp() {
@@ -320,14 +320,14 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
String executable = args.executable != null ? args.executable : p("component.names.product").toLowerCase()
String helpId = args.help_id != null ? args.help_id : "IJ"
String icns = "idea.icns"
- String helpIcns = "$path/Contents/Resources/${helpId}.help/Contents/Resources/Shared/product.icns"
+ String helpIcns = "$path/Resources/${helpId}.help/Contents/Resources/Shared/product.icns"
if (args.icns != null) {
- ant.delete(file: "$path/Contents/Resources/idea.icns")
- ant.copy(file: args.icns, todir: "$path/Contents/Resources")
+ ant.delete(file: "$path/Resources/idea.icns")
+ ant.copy(file: args.icns, todir: "$path/Resources")
ant.copy(file: args.icns, tofile: helpIcns)
icns = new File((String)args.icns).getName();
} else {
- ant.copy(file: "$path/Contents/Resources/idea.icns", tofile: helpIcns)
+ ant.copy(file: "$path/Resources/idea.icns", tofile: helpIcns)
}
String fullName = args.fullName != null ? args.fullName : p("component.names.fullname")
@@ -356,7 +356,7 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
new File("$path/bin/idea.properties").text = effectiveProperties.toString()
new File("$path/bin/idea.vmoptions").text = "$mem64 -XX:+UseCompressedOops".split(" ").join("\n")
- String classPath = classPathLibs.collect {"\$APP_PACKAGE/lib/${it}" }.join(":")
+ String classPath = classPathLibs.collect {"\$APP_PACKAGE/Contents/lib/${it}" }.join(":")
String archs = """
LSArchitecturePriority
@@ -389,7 +389,7 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
"""
}
- ant.replace(file: "$path/Contents/Info.plist") {
+ ant.replace(file: "$path/Info.plist") {
replacefilter(token: "@@build@@", value: args.buildNumber)
replacefilter(token: "@@doc_types@@", value: ifNull(args.doc_types, ""))
replacefilter(token: "@@executable@@", value: executable)
@@ -408,7 +408,7 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
}
if (executable != "idea") {
- ant.move(file: "$path/Contents/MacOS/idea", tofile: "$path/Contents/MacOS/$executable")
+ ant.move(file: "$path/MacOS/idea", tofile: "$path/MacOS/$executable")
}
ant.replace(file: "$path/bin/inspect.sh") {
@@ -710,7 +710,7 @@ binding.setVariable("buildMacZip", { String zipRoot, String zipPath, List paths,
exclude(name: "bin/*.py")
exclude(name: "bin/fsnotifier")
exclude(name: "bin/restarter")
- exclude(name: "Contents/MacOS/*")
+ exclude(name: "MacOS/*")
extraBins.each {
exclude(name: it)
}
@@ -724,7 +724,7 @@ binding.setVariable("buildMacZip", { String zipRoot, String zipPath, List paths,
include(name: "bin/*.py")
include(name: "bin/fsnotifier")
include(name: "bin/restarter")
- include(name: "Contents/MacOS/*")
+ include(name: "MacOS/*")
extraBins.each {
include(name: it)
}
diff --git a/native/MacLauncher/Launcher.m b/native/MacLauncher/Launcher.m
index 716f8b7a02de..354a15c5b44e 100644
--- a/native/MacLauncher/Launcher.m
+++ b/native/MacLauncher/Launcher.m
@@ -106,9 +106,9 @@ NSArray *allVms() {
}
if (! jvmBundlePaths.count > 0 ) {
NSBundle *bundle = [NSBundle mainBundle];
- NSString *appDir = bundle.bundlePath;
+ NSString *appDir = [bundle.bundlePath stringByAppendingPathComponent:@"Contents"];
- appendJvmBundlesAt([appDir stringByAppendingPathComponent:@"jre"], jvmBundlePaths);
+ appendJvmBundlesAt([appDir stringByAppendingPathComponent:@"/jre"], jvmBundlePaths);
if (jvmBundlePaths.count > 0) return jvmBundlePaths;
appendJvmBundlesAt([NSHomeDirectory() stringByAppendingPathComponent:@"Library/Java/JavaVirtualMachines"], jvmBundlePaths);