DevKit: IDEA-128345 Can't create plugin SDK on OS X + friendly sdk name for CLion

This commit is contained in:
Anton Makeev
2014-09-03 10:52:00 +02:00
parent 620027a429
commit c633f5c01f
@@ -86,6 +86,15 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType {
return PathManager.getHomePath().replace(File.separatorChar, '/');
}
@Override
public String adjustSelectedSdkHome(String homePath) {
if (SystemInfo.isMac) {
File home = new File(homePath, "Contents");
if (home.exists()) return home.getPath();
}
return super.adjustSelectedSdkHome(homePath);
}
public boolean isValidSdkHome(String path) {
if (isFromIDEAProject(path)) {
return true;
@@ -153,6 +162,9 @@ public class IdeaJdk extends JavaDependentSdkType implements JavaSdkType {
else if (new File(sdkHome, "license/AppCode_license.txt").exists()) {
productName = "AppCode ";
}
else if (new File(sdkHome, "license/CLion_Preview_License.txt").exists()) {
productName = "CLion ";
}
else {
productName = "IDEA ";
}