From 443f78fcdff99e313001a7dc06026c70f71e8792 Mon Sep 17 00:00:00 2001 From: Dave MacLachlan Date: Thu, 10 Mar 2016 15:16:49 +0000 Subject: Simplify LaunchStoryboard plist generation to make it less error prone. Simplify automatic entries creation. -- MOS_MIGRATED_REVID=116866524 --- .../lib/rules/objc/ReleaseBundlingSupport.java | 24 +++++++--------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/main/java/com') 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 = - "\n" - + "\n" - + "\n" - + "\n" - + " UILaunchStoryboardName\n" - + " " - + launchStoryboardName - + "\n" - + "\n" - + "\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; } -- cgit v1.2.3