Merge remote-tracking branch 'origin/master' idea/140.563
authorVladimir.Orlov <Vladimir.Orlov@jetbrains.com>
Thu, 13 Nov 2014 14:34:00 +0000 (17:34 +0300)
committerVladimir.Orlov <Vladimir.Orlov@jetbrains.com>
Thu, 13 Nov 2014 14:34:00 +0000 (17:34 +0300)
build/conf/mac/Contents/MacOS/idea
build/scripts/utils.gant
native/MacLauncher/Launcher.m
native/MacLauncher/MacLauncher.xcodeproj/project.pbxproj

index dde4ca2a5bc7d806081cdb9c1d8581f5cdca9f6e..4ead2aba15c1ea83059785cf775ebaf555fa66b4 100755 (executable)
Binary files a/build/conf/mac/Contents/MacOS/idea and b/build/conf/mac/Contents/MacOS/idea differ
index 8e2376b71c55a89b85d7b3f6ef1a260074ca810e..b311af3d1b4cf5d793d80e5e1697aa83af1570fc 100644 (file)
@@ -643,6 +643,7 @@ private Map readIdeaProperties(Map args) {
   ideaPropertiesFile.close();
 
   def defaultProperties = ["CVS_PASSFILE": "~/.cvspass",
+                           "JVMVersion": "1.6*",
                            "com.apple.mrj.application.live-resize": "false",
                            "idea.paths.selector": args.system_selector,
                            "java.endorsed.dirs": "",
index e5083a4cf98a43b77de6df94a9a69d90d0042619..7ccae0bec4471a7248f6acdfaf96b538a6ec8ef8 100644 (file)
@@ -15,6 +15,7 @@
 typedef jint (JNICALL *fun_ptr_t_CreateJavaVM)(JavaVM **pvm, void **env, void *args);
 NSBundle *vm;
 NSString *const JVMOptions = @"JVMOptions";
+NSString *JVMVersion = NULL;
 NSString* minRequiredJavaVersion = @"1.6.0_65-b14-466.1";
 NSString* osxVersion = @"10.10";
 BOOL javaUpdateRequired = false;
@@ -128,12 +129,8 @@ void showWarning(NSString* installedJava){
 BOOL isJavaUpdateRequired(NSString *vmVersion, NSString *requiredVersion){
     BOOL needUpdate = false;
     NSString* currentOSXVersion = getOSXVersion();
-    //installedJava = vmVersion;
     if ([osxVersion compare:currentOSXVersion options:NSNumericSearch] <= 0){
-      if ([minRequiredJavaVersion compare:vmVersion options:NSNumericSearch] <= 0){
-        NSLog(@"find Java: %@", vmVersion);
-      }else{
-        //NSLog(@" --- Installed Java is not meet the requirements. Please visit http://support.apple.com/kb/DL1572 and update Java.");
+      if ([minRequiredJavaVersion compare:vmVersion options:NSNumericSearch] > 0){
         NSLog(@"find Java: %@", vmVersion);
         NSLog(@"required JavaVersion: %@", minRequiredJavaVersion);
         needUpdate = true;
@@ -167,13 +164,19 @@ void appendJvmBundlesAt(NSString *path, NSMutableArray *sink) {
 NSArray *allVms() {
     NSMutableArray *jvmBundlePaths = [NSMutableArray array];
 
+    // search java info in user's idea.properties
+    NSDictionary *inConfig = [PropertyFileReader readFile:getPropertiesFilePath()];
+    NSString* userJavaVersion = [inConfig objectForKey:@"JVMVersion"];
+    if (userJavaVersion != nil) JVMVersion = userJavaVersion;
+    NSString *required = requiredJvmVersion();
+
     NSString *explicit = [[[NSProcessInfo processInfo] environment] objectForKey:@"IDEA_JDK"];
 
     if (explicit != nil) {
         // check if IDEA_JDK value corresponds  with JVMVersion from Info.plist
         NSLog(@"value of IDEA_JDK: %@", explicit);
         NSBundle *jdkBundle = [NSBundle bundleWithPath:explicit];
-        NSString *required = requiredJvmVersion();
+        
         if (jdkBundle != nil && required != NULL) {
             if (satisfies(jvmVersion(jdkBundle), required)) {
                 appendBundle(explicit, jvmBundlePaths);
@@ -187,7 +190,7 @@ NSArray *allVms() {
         NSString *appDir = [bundle.bundlePath stringByAppendingPathComponent:@"Contents"];
 
         appendJvmBundlesAt([appDir stringByAppendingPathComponent:@"/jre"], jvmBundlePaths);
-        if (jvmBundlePaths.count > 0) return jvmBundlePaths;
+        if ((jvmBundlePaths.count > 0) && (satisfies(jvmVersion(jvmBundlePaths[jvmBundlePaths.count-1]), required))) return jvmBundlePaths;
 
         appendJvmBundlesAt([NSHomeDirectory() stringByAppendingPathComponent:@"Library/Java/JavaVirtualMachines"], jvmBundlePaths);
         appendJvmBundlesAt(@"/Library/Java/JavaVirtualMachines", jvmBundlePaths);
@@ -204,7 +207,7 @@ NSString *jvmVersion(NSBundle *bundle) {
 }
 
 NSString *requiredJvmVersion() {
-    return [[NSBundle mainBundle].infoDictionary valueForKey:@"JVMVersion" inDictionary: JVMOptions defaultObject:@"1.7*"];
+    return (JVMVersion != NULL) ? JVMVersion : [[NSBundle mainBundle].infoDictionary valueForKey:@"JVMVersion" inDictionary: JVMOptions defaultObject:@"1.7*"];
 }
 
 BOOL satisfies(NSString *vmVersion, NSString *requiredVersion) {
index 10c71f4b3829746f2a1633398854ea8dedd69d52..ad3262c6f77d7c2af7d88b75d1a15ff5a56bd8cb 100644 (file)
                                MACOSX_DEPLOYMENT_TARGET = 10.5;
                                ONLY_ACTIVE_ARCH = NO;
                                PRODUCT_NAME = "$(TARGET_NAME)";
-                               SDKROOT = macosx10.8;
+                               SDKROOT = macosx10.9;
                                WRAPPER_EXTENSION = app;
                        };
                        name = Release;
                                MACOSX_DEPLOYMENT_TARGET = 10.5;
                                ONLY_ACTIVE_ARCH = NO;
                                PRODUCT_NAME = "$(TARGET_NAME)";
-                               SDKROOT = macosx10.8;
+                               SDKROOT = macosx10.9;
                                WRAPPER_EXTENSION = app;
                        };
                        name = Debug;