diff options
author | Chris Parsons <cparsons@google.com> | 2015-10-30 18:32:25 +0000 |
---|---|---|
committer | Florian Weikert <fwe@google.com> | 2015-11-02 16:54:14 +0000 |
commit | 43bc404c4983a902964573ab13b44a6bde7920b3 (patch) | |
tree | 8be44c666745021227f6ede427d7b0c61c2c45c8 /src/objc_tools | |
parent | 28759f18067f474899941156c9312d6aacab8557 (diff) |
Strict matching of architecture name to ios platform. Also refactor Platform into a new .apple package, as it is not relevant for solely objc rules.
--
MOS_MIGRATED_REVID=106709486
Diffstat (limited to 'src/objc_tools')
-rw-r--r-- | src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java b/src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java index 4523db2d26..c402f60a96 100644 --- a/src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java +++ b/src/objc_tools/bundlemerge/java/com/google/devtools/build/xcode/bundlemerge/BundleMerging.java @@ -88,6 +88,21 @@ public final class BundleMerging { private static final String PKGINFO_FILENAME = "PkgInfo"; /** + * A hack needed briefly to maintain backwards compatibility during rename of {@link Platform} + * enums. Except for backwards-compatible names, falls back to usage of {@link Platform#valueOf}. + */ + // TODO(bazel-team): Remove this hack. + private static Platform platformFromName(String platformName) { + if ("SIMULATOR".equals(platformName)) { + return Platform.IOS_SIMULATOR; + } else if ("DEVICE".equals(platformName)) { + return Platform.IOS_DEVICE; + } else { + return Platform.valueOf(platformName); + } + } + + /** * Adds merge artifacts from the given {@code control} into builders that collect merge zips and * individual files. {@code bundleRoot} is prepended to each path, except the paths in the merge * zips. @@ -113,7 +128,7 @@ public final class BundleMerging { sourcePlistFiles, PlistMerging.automaticEntries( control.getTargetDeviceFamilyList(), - Platform.valueOf(control.getPlatform()), + platformFromName(control.getPlatform()), control.getSdkVersion(), control.getMinimumOsVersion()), substitutionMap.build(), |