mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-04 23:39:07 +07:00
[platform] arbitrary VM options for macOS launcher: sources (IDEA-279731)
GitOrigin-RevId: 58ad65ef86387f3a52a475d57729936c7f41a96b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e37d9b879b
commit
6f0f249ce1
@@ -30,6 +30,7 @@ NSString* minRequiredJavaVersion = @"1.8";
|
||||
|
||||
@interface NSDictionary (TypedGetters)
|
||||
- (NSDictionary *)dictionaryForKey:(id)key;
|
||||
- (NSArray *)arrayForKey:(id)key;
|
||||
- (id)valueForKey:(NSString *)key inDictionary:(NSString *)dictKey defaultObject:(NSString *)defaultValue;
|
||||
@end
|
||||
|
||||
@@ -42,6 +43,11 @@ NSString* minRequiredJavaVersion = @"1.8";
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *)arrayForKey:(id)key {
|
||||
id answer = self[key];
|
||||
return [answer isKindOfClass:[NSArray class]] ? answer : nil;
|
||||
}
|
||||
|
||||
- (id)valueForKey:(NSString *)key inDictionary:(NSString *)dictKey defaultObject: (NSString*) defaultValue {
|
||||
NSDictionary *dict = [self dictionaryForKey:dictKey];
|
||||
if (dict == nil) return nil;
|
||||
@@ -403,7 +409,12 @@ NSString *getOverridePropertiesPath() {
|
||||
return [[NSProcessInfo processInfo] environment][variable];
|
||||
}
|
||||
|
||||
- (void)fillArgs:(NSMutableArray *)args_array fromProperties:(NSDictionary *)properties {
|
||||
- (void)fillArgs:(NSMutableArray *)args_array fromOptions:(NSArray *)options fromProperties:(NSDictionary *)properties {
|
||||
if (options != nil) {
|
||||
for (id value in options) {
|
||||
[args_array addObject:value];
|
||||
}
|
||||
}
|
||||
if (properties != nil) {
|
||||
for (id key in properties) {
|
||||
[args_array addObject:[NSString stringWithFormat:@"-D%@=%@", key, properties[key]]];
|
||||
@@ -429,7 +440,7 @@ NSString *getOverridePropertiesPath() {
|
||||
[args_array addObject:[NSString stringWithFormat:@"-Didea.properties.file=%@", properties]];
|
||||
}
|
||||
|
||||
[self fillArgs:args_array fromProperties:[jvmInfo dictionaryForKey:@"Properties"]];
|
||||
[self fillArgs:args_array fromOptions:[jvmInfo arrayForKey:@"Options"] fromProperties:[jvmInfo dictionaryForKey:@"Properties"]];
|
||||
|
||||
JavaVMInitArgs args;
|
||||
args.version = JNI_VERSION_1_6;
|
||||
|
||||
Reference in New Issue
Block a user