Skip to content

Commit

Permalink
Fixes min OS version checks and removes hardcoded values (#463)
Browse files Browse the repository at this point in the history
* Fixes min OS version checks and removes hardcoded values

* Use getInfoPlist(9 on FrameworkTarget

* Use getMinimumIosVersion()
  • Loading branch information
Tom-Ski authored Mar 5, 2020
1 parent 3249ac5 commit ddb8c0a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ public String getInstallRelativeArchivePath(Path path) {
protected List<String> 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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ protected void doBuild(File outFile, List<String> 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. "
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ddb8c0a

Please sign in to comment.