diff options
author | 2016-03-10 15:16:49 +0000 | |
---|---|---|
committer | 2016-03-11 21:29:12 +0000 | |
commit | 443f78fcdff99e313001a7dc06026c70f71e8792 (patch) | |
tree | a4a88279f5958aad1dcd4db86cdcc918e29f7b9d /src/main/java/com | |
parent | 830b21ba97b4fa816480ff6b48771430f8b828df (diff) |
Simplify LaunchStoryboard plist generation to make it less error prone.
Simplify automatic entries creation.
--
MOS_MIGRATED_REVID=116866524
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java index 9c6fcc9a48..64109672e5 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ReleaseBundlingSupport.java @@ -344,19 +344,9 @@ public final class ReleaseBundlingSupport { private void registerLaunchStoryboardPlistAction() { String launchStoryboard = attributes.launchStoryboard().getFilename(); String launchStoryboardName = launchStoryboard.substring(0, launchStoryboard.lastIndexOf('.')); - String contents = - "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" - + "<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" " - + "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n" - + "<plist version=\"1.0\">\n" - + "<dict>\n" - + " <key>UILaunchStoryboardName</key>\n" - + " <string>" - + launchStoryboardName - + "</string>\n" - + "</dict>\n" - + "</plist>\n"; - + NSDictionary result = new NSDictionary(); + result.put("UILaunchStoryboardName", launchStoryboardName); + String contents = result.toGnuStepASCIIPropertyList(); ruleContext.registerAction( new FileWriteAction( ruleContext.getActionOwner(), getLaunchStoryboardPlist(), contents, false)); @@ -405,14 +395,14 @@ public final class ReleaseBundlingSupport { NSDictionary result = new NSDictionary(); if (uiDeviceFamily != null) { - result.put("UIDeviceFamily", NSObject.wrap(uiDeviceFamily.toArray())); + result.put("UIDeviceFamily", uiDeviceFamily.toArray()); } - result.put("DTPlatformName", NSObject.wrap(platform.getLowerCaseNameInPlist())); + result.put("DTPlatformName", platform.getLowerCaseNameInPlist()); result.put( "DTSDKName", - NSObject.wrap(platform.getLowerCaseNameInPlist() + appleConfiguration.getIosSdkVersion())); + platform.getLowerCaseNameInPlist() + appleConfiguration.getIosSdkVersion()); result.put("CFBundleSupportedPlatforms", new NSArray(NSObject.wrap(platform.getNameInPlist()))); - result.put("MinimumOSVersion", NSObject.wrap(bundling.getMinimumOsVersion().toString())); + result.put("MinimumOSVersion", bundling.getMinimumOsVersion().toString()); return result; } |