diff options
author | cpeyser <cpeyser@google.com> | 2017-04-26 00:48:30 +0200 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-04-26 12:44:17 +0200 |
commit | 9158362a3256e8ab15f6484e4801092d2a164dfe (patch) | |
tree | 529846fdd013161896b643678c696880efcbe3e4 /src/main/java/com/google/devtools | |
parent | 6547bde3e348d2fcf1aed00c171ba3337a7ca0e7 (diff) |
Remove AppleCrosstoolSplitTransition.
PiperOrigin-RevId: 154232604
Diffstat (limited to 'src/main/java/com/google/devtools')
3 files changed, 0 insertions, 120 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfigurationCollection.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfigurationCollection.java index d5b9522973..038b060cbb 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfigurationCollection.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelConfigurationCollection.java @@ -17,10 +17,8 @@ package com.google.devtools.build.lib.bazel.rules; import com.google.common.cache.Cache; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashBasedTable; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableListMultimap; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Iterables; import com.google.common.collect.ListMultimap; import com.google.common.collect.Table; import com.google.devtools.build.lib.analysis.ConfigurationCollectionFactory; @@ -36,11 +34,7 @@ import com.google.devtools.build.lib.events.EventHandler; import com.google.devtools.build.lib.packages.Attribute.ConfigurationTransition; import com.google.devtools.build.lib.packages.Attribute.SplitTransition; import com.google.devtools.build.lib.packages.Attribute.Transition; -import com.google.devtools.build.lib.packages.Target; -import com.google.devtools.build.lib.rules.apple.AppleConfiguration; import com.google.devtools.build.lib.rules.cpp.CppRuleClasses.LipoTransition; -import com.google.devtools.build.lib.rules.objc.AppleCrosstoolSplitTransition; -import com.google.devtools.build.lib.rules.objc.AppleCrosstoolTransition; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; @@ -110,23 +104,6 @@ public class BazelConfigurationCollection implements ConfigurationCollectionFact return super.getDynamicTransition(configurationTransition); } } - - @Override - public BuildConfiguration toplevelConfigurationHook(Target toTarget) { - ImmutableList<String> appleCrosstoolRuleClasses = - AppleCrosstoolTransition.appleCrosstoolTransitionIsAppliedForAllObjc( - configuration.getOptions()) - ? AppleConfiguration.APPLE_CROSSTOOL_RULE_CLASSES - : AppleConfiguration.APPLE_CROSSTOOL_RULE_CLASSES_FOR_STATIC_CONFIGS; - - return (appleCrosstoolRuleClasses.contains(toTarget.getAssociatedRule().getRuleClass())) - ? Iterables.getOnlyElement( - configuration - .getTransitions() - .getSplitConfigurations( - AppleCrosstoolSplitTransition.APPLE_CROSSTOOL_SPLIT_TRANSITION)) - : configuration; - } } @Override diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java index da76148b03..35c42677f8 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java @@ -64,36 +64,6 @@ public class AppleConfiguration extends BuildConfiguration.Fragment { **/ public static final String APPLE_SDK_PLATFORM_ENV_NAME = "APPLE_SDK_PLATFORM"; - /** - * Rule classes that need a top level transition to the apple crosstool if static configurations - * are being used. - * - * <p>This list must not contain any rule classes that require some other split transition, as - * that transition would be suppressed by the top level transition to the apple crosstool. For - * example, if "apple_binary" were in this list, the multi-arch transition would not occur. - */ - public static final ImmutableList<String> APPLE_CROSSTOOL_RULE_CLASSES_FOR_STATIC_CONFIGS = - ImmutableList.of( - "objc_library", - "objc_binary", - "experimental_objc_library"); - - /** - * Rule classes that need a top level transition to the apple crosstool. Dynamic configurations - * must be in place until these can be used - for static configurations, use - * {@code APPLE_CROSSTOOL_RULE_CLASSES_FOR_STATIC_CONFIGS}. - */ - public static final ImmutableList<String> APPLE_CROSSTOOL_RULE_CLASSES = - ImmutableList.of( - "apple_binary", - "apple_static_library", - "apple_watch_extension_binary", - "experimental_objc_library", - "ios_extension_binary", - "ios_test", - "objc_binary", - "objc_library"); - private static final DottedVersion MINIMUM_BITCODE_XCODE_VERSION = DottedVersion.fromString("7"); @Nullable private final DottedVersion xcodeVersion; diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolSplitTransition.java b/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolSplitTransition.java deleted file mode 100644 index 89df5b521f..0000000000 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/AppleCrosstoolSplitTransition.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2017 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.rules.objc; - -import com.google.common.collect.ImmutableList; -import com.google.devtools.build.lib.analysis.config.BuildOptions; -import com.google.devtools.build.lib.packages.Attribute.SplitTransition; -import com.google.devtools.build.lib.rules.apple.AppleCommandLineOptions; -import com.google.devtools.build.lib.rules.apple.AppleConfiguration.ConfigurationDistinguisher; -import java.util.List; - -/** - * Transition that produces a configuration that causes c++ toolchain selection to use the - * CROSSTOOL given in apple_crosstool_top. - * - * <p>Duplicates {@link AppleCrosstoolTransition} as a {@link SplitTransition}. This is necessary - * for the top level configuration hook, until the top level configuration hook is supported for - * dynamic configurations. - * - * <p>TODO(b/34241319): Use AppleCrosstoolTransition at the top level, and retire this class. - */ -public class AppleCrosstoolSplitTransition implements SplitTransition<BuildOptions> { - - /** - * A singleton instance of {@link AppleCrosstoolSplitTransition}, since the class must be - * stateless. Use in BuildConfigurationCollection.Transitions#topLevelConfigurationHook. - */ - public static final AppleCrosstoolSplitTransition APPLE_CROSSTOOL_SPLIT_TRANSITION = - new AppleCrosstoolSplitTransition(); - - @Override - public boolean defaultsToSelf() { - return true; - } - - @Override - public List<BuildOptions> split(BuildOptions buildOptions) { - BuildOptions result = buildOptions.clone(); - - if (!AppleCrosstoolTransition.appleCrosstoolTransitionIsAppliedForAllObjc(buildOptions)) { - // If the apple crosstool is not applied universally, the apple crosstool distinguisher - // is required to prevent artifact collisions. Since AppleCrosstoolTransition is only applied - // when the crosstool is applied universally, the distinguisher only needs to be set here. - result.get(AppleCommandLineOptions.class).configurationDistinguisher = - ConfigurationDistinguisher.APPLE_CROSSTOOL; - } - - // TODO(b/29355778): Once ios_cpu is retired, introduce another top-level flag (perhaps - // --apple_cpu) for toolchain selection in top-level consuming rules. - String cpu = "ios_" + buildOptions.get(AppleCommandLineOptions.class).iosCpu; - AppleCrosstoolTransition.setAppleCrosstoolTransitionConfiguration(buildOptions, result, cpu); - - return ImmutableList.of(result); - } -} |