Remove --ios_multi_cpus (simulator & device) restriction on the objc_bundle_library rule

--
PiperOrigin-RevId: 145834899
MOS_MIGRATED_REVID=145834899
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
index b6cfa55..ab2bc95 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/BundleSupport.java
@@ -131,7 +131,13 @@
     return this;
   }
 
-  private void validatePlatform() {
+  /**
+   * Validates the platform for this build is either simulator or device, and does not
+   * contain architectures for both platforms.
+   *
+   * @return this bundle support
+   */
+  public BundleSupport validatePlatform() {
     Platform platform = null;
     for (String architecture : appleConfiguration.getIosMultiCpus()) {
       if (platform == null) {
@@ -143,9 +149,16 @@
                 appleConfiguration.getIosMultiCpus()));
       }
     }
+    return this;
   }
 
-  private void validateResources(ObjcProvider objcProvider) {
+  /**
+   * Validates that resources defined in this rule and its dependencies and written to this
+   * bundle are legal (for example that they are not mapped to the same bundle location).
+   *
+   * @return this bundle support
+   */
+  public BundleSupport validateResources(ObjcProvider objcProvider) {
     Map<String, Artifact> bundlePathToFile = new HashMap<>();
     NestedSet<Artifact> artifacts = objcProvider.get(STRINGS);
 
@@ -187,25 +200,8 @@
         bundlePathToFile.put(bundlePath, bundled);
       }
     }
-
     // TODO(bazel-team): Do the same validation for storyboards and datamodels which could also be
     // generated by genrules or doubly defined.
-  }
-
-  /**
-   * Validates bundle support.
-   * <ul>
-   * <li>Validates that resources defined in this rule and its dependencies and written to this
-   *     bundle are legal (for example that they are not mapped to the same bundle location)
-   * <li>Validates the platform for this build is either simulator or device, and does not
-   *     contain architectures for both platforms
-   * </ul>
-   *
-   * @return this bundle support
-   */
-  BundleSupport validate(ObjcProvider objcProvider) {
-    validatePlatform();
-    validateResources(objcProvider);
 
     return this;
   }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcBundleLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcBundleLibrary.java
index c7ae890..46b0a21 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcBundleLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcBundleLibrary.java
@@ -58,13 +58,16 @@
     }
 
     AppleConfiguration appleConfiguration = ruleContext.getFragment(AppleConfiguration.class);
+
+    // Platform is purposefully not validated on this BundleSupport. Multi-arch validation and
+    // resource de-duplication should only take place at the level of the bundling rule.
     new BundleSupport(ruleContext,
             appleConfiguration,
             appleConfiguration.getMultiArchPlatform(PlatformType.IOS),
             bundling,
             new ExtraActoolArgs())
+        .validateResources(common.getObjcProvider())
         .registerActions(common.getObjcProvider())
-        .validate(common.getObjcProvider())
         .addXcodeSettings(xcodeProviderBuilder);
 
     if (ruleContext.hasErrors()) {
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 661994a..fc2a6ad 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
@@ -281,7 +281,9 @@
    * @return this release bundling support
    */
   ReleaseBundlingSupport validateResources() {
-    bundleSupport.validate(objcProvider);
+    bundleSupport
+        .validatePlatform()
+        .validateResources(objcProvider);
     return this;
   }