From ddb8c0a3ed6a5b69d3acb0b9ed5232e9e6286ba5 Mon Sep 17 00:00:00 2001 From: Tomski Date: Thu, 5 Mar 2020 06:18:54 -0500 Subject: [PATCH] Fixes min OS version checks and removes hardcoded values (#463) * Fixes min OS version checks and removes hardcoded values * Use getInfoPlist(9 on FrameworkTarget * Use getMinimumIosVersion() --- .../compiler/target/framework/FrameworkTarget.java | 10 +++++----- .../java/org/robovm/compiler/target/ios/IOSTarget.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/compiler/src/main/java/org/robovm/compiler/target/framework/FrameworkTarget.java b/compiler/compiler/src/main/java/org/robovm/compiler/target/framework/FrameworkTarget.java index 9be62d9ae..5bc20c400 100644 --- a/compiler/compiler/src/main/java/org/robovm/compiler/target/framework/FrameworkTarget.java +++ b/compiler/compiler/src/main/java/org/robovm/compiler/target/framework/FrameworkTarget.java @@ -120,12 +120,12 @@ public String getInstallRelativeArchivePath(Path path) { protected List getTargetExportedSymbols() { return Arrays.asList("JNI_*", "rvmInstantiateFramework"); } - + private String getMinimumOSVersion() { - NSObject minimumOSVersion = config.getInfoPList().getDictionary().objectForKey("MinimumOSVersion"); + String minimumOSVersion = config.getInfoPList().getMinimumOSVersion(); if (minimumOSVersion != null) - return minimumOSVersion.toString(); - return "8.0"; + return minimumOSVersion; + return config.getOs().getMinVersion(); } @Override @@ -202,7 +202,7 @@ protected void doInstall(File installDir, String image, File resourcesDir) throw NSDictionary infoPlist = config.getInfoPList().getDictionary(); if (infoPlist.objectForKey("MinimumOSVersion") == null) - infoPlist.put("MinimumOSVersion", "8.0"); + infoPlist.put("MinimumOSVersion", config.getOs().getMinVersion()); File infoPlistBin = new File(frameworkDir, "Info.plist"); config.getLogger().info("Installing Info.plist to: %s", infoPlistBin); diff --git a/compiler/compiler/src/main/java/org/robovm/compiler/target/ios/IOSTarget.java b/compiler/compiler/src/main/java/org/robovm/compiler/target/ios/IOSTarget.java index 2ff9a7b0e..61e018a5c 100755 --- a/compiler/compiler/src/main/java/org/robovm/compiler/target/ios/IOSTarget.java +++ b/compiler/compiler/src/main/java/org/robovm/compiler/target/ios/IOSTarget.java @@ -276,7 +276,7 @@ protected void doBuild(File outFile, List ccArgs, int majorVersionNumber = -1; try { majorVersionNumber = Integer.parseInt(minVersion.substring(0, minVersion.indexOf('.'))); - int minMajorSupportedVersion = Integer.parseInt(minVersion.substring(0, config.getOs().getMinVersion().indexOf('.'))); + int minMajorSupportedVersion = Integer.parseInt(config.getOs().getMinVersion().substring(0, config.getOs().getMinVersion().indexOf('.'))); if (majorVersionNumber < minMajorSupportedVersion) { throw new CompilerException("MinimumOSVersion of " + minVersion + " is not supported. " @@ -937,7 +937,7 @@ protected void createInfoPList(File dir) throws IOException { if (dict.objectForKey("MinimumOSVersion") == null) { // This is required - dict.put("MinimumOSVersion", "6.0"); + dict.put("MinimumOSVersion", config.getOs().getMinVersion()); } customizeInfoPList(dict);