use of com.dd.plist.NSString in project robovm by robovm.
the class IOSTarget method customizeInfoPList.
protected void customizeInfoPList(NSDictionary dict) {
if (isSimulatorArch(arch)) {
dict.put("CFBundleSupportedPlatforms", new NSArray(new NSString("iPhoneSimulator")));
} else {
dict.put("CFBundleSupportedPlatforms", new NSArray(new NSString("iPhoneOS")));
dict.put("DTPlatformVersion", sdk.getPlatformVersion());
dict.put("DTPlatformBuild", sdk.getPlatformBuild());
dict.put("DTSDKBuild", sdk.getBuild());
// them from the installed Xcode.
try {
File versionPListFile = new File(new File(ToolchainUtil.findXcodePath()).getParentFile(), "version.plist");
NSDictionary versionPList = (NSDictionary) PropertyListParser.parse(versionPListFile);
File xcodeInfoPListFile = new File(new File(ToolchainUtil.findXcodePath()).getParentFile(), "Info.plist");
NSDictionary xcodeInfoPList = (NSDictionary) PropertyListParser.parse(xcodeInfoPListFile);
NSString dtXcodeBuild = (NSString) versionPList.objectForKey("ProductBuildVersion");
if (dtXcodeBuild == null) {
throw new NoSuchElementException("No ProductBuildVersion in " + versionPListFile.getAbsolutePath());
}
NSString dtXcode = (NSString) xcodeInfoPList.objectForKey("DTXcode");
if (dtXcode == null) {
throw new NoSuchElementException("No DTXcode in " + xcodeInfoPListFile.getAbsolutePath());
}
putIfAbsent(dict, "DTXcode", dtXcode.toString());
putIfAbsent(dict, "DTXcodeBuild", dtXcodeBuild.toString());
} catch (Exception e) {
config.getLogger().warn("Failed to read DTXcodeBuild/DTXcode from current Xcode install. Will use fake values. (%s: %s)", e.getClass().getName(), e.getMessage());
}
// Fake Xcode 6.1.1 values if the above fails.
putIfAbsent(dict, "DTXcode", "0611");
putIfAbsent(dict, "DTXcodeBuild", "6A2008a");
}
}
Aggregations