aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/apple
diff options
context:
space:
mode:
authorGravatar lberki <lberki@google.com>2017-10-09 12:42:14 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-10-10 11:17:05 +0200
commit0bdc2ba517bc92235ebd6da630a428f18d1b5462 (patch)
treeda84306ffdd7f9ccc01374917fbb56d26146aad6 /src/main/java/com/google/devtools/build/lib/rules/apple
parent755e176cc116ab8332e79c52c06441c64459af1e (diff)
Remove ctx.fragments.apple.{xcode_version,ios_minimum_os}.
These are now accessible using ctx.attr._xcode_config[apple_common.XcodeVersionConfig]. Progress towards #3424. RELNOTES[INC]: ctx.fragments.apple.{xcode_version,ios_minimum_os} is not supported anymore. The same information is accessible through the target @bazel_tools//tools/osx:current_xcode_config: point an implicit attribute to it (i.e. attr.label(default=Label("@bazel_tools//tools/osx:current_xcode_config")) then use ctx.attr._xcode_config[apple_common].XcodeVersionConfig]. PiperOrigin-RevId: 171517550
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/apple')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/apple/AppleConfiguration.java40
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/apple/XcodeConfig.java8
2 files changed, 2 insertions, 46 deletions
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 442408bede..d8cc719737 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
@@ -177,24 +177,6 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
return options;
}
- /**
- * Returns the minimum iOS version supported by binaries and libraries. Any dependencies on newer
- * iOS version features or libraries will become weak dependencies which are only loaded if the
- * runtime OS supports them.
- *
- * @deprecated use {@link XcodeConfig#getMinimumOsForPlatformType(RuleContext, PlatformType)}.
- */
- @SkylarkCallable(name = "ios_minimum_os", structField = true,
- doc = "<b>Deprecated. Use <a href='#minimum_os_for_platform_type'>"
- + "minimum_os_for_platform_type(apple_common.platform_type.ios)</a> instead.</b> "
- + "The minimum compatible iOS version for target simulators and devices.")
- @Deprecated
- // Bug tracking the removal of this method: https://github.com/bazelbuild/bazel/issues/3424
- public DottedVersion getMinimumOs() {
- // TODO(bazel-team): Deprecate in favor of getMinimumOsForPlatformType(IOS).
- return iosMinimumOs;
- }
-
/***
* @deprecated use {@link XcodeConfig#getMinimumOsForPlatformType(RuleContext, PlatformType)}.
*/
@@ -264,25 +246,6 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
}
/**
- * Returns the value of the xcode version, if available. This is determined based on a combination
- * of the {@code --xcode_version} build flag and the {@code xcode_config} target defined in the
- * {@code --xcode_version_config} flag. Returns null if no xcode is available.
- *
- * @deprecated use {@link XcodeConfig#getXcodeVersion(RuleContext)}.
- */
- @SkylarkCallable(
- name = "xcode_version",
- doc = "Returns the Xcode version that is being used to build.<p>"
- + "This will return <code>None</code> if no Xcode versions are available.",
- allowReturnNones = true)
- @Nullable
- @Deprecated
- // Bug tracking the removal of this method: https://github.com/bazelbuild/bazel/issues/3424
- public DottedVersion getXcodeVersion() {
- return xcodeVersion;
- }
-
- /**
* Returns a map of environment variables (derived from configuration) that should be propagated
* for actions pertaining to the given apple platform. Keys are variable names and values are
* their corresponding values.
@@ -311,7 +274,6 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
+ "of Xcode that should be used. The keys are variable names and the values are their "
+ "corresponding values.")
public ImmutableMap<String, String> getAppleHostSystemEnv() {
- DottedVersion xcodeVersion = getXcodeVersion();
if (xcodeVersion != null) {
return getXcodeVersionEnv(xcodeVersion);
} else {
@@ -805,7 +767,7 @@ public class AppleConfiguration extends BuildConfiguration.Fragment {
}
private static void validate(AppleConfiguration config) throws InvalidConfigurationException {
- DottedVersion xcodeVersion = config.getXcodeVersion();
+ DottedVersion xcodeVersion = config.xcodeVersion;
if (config.getBitcodeMode() != AppleBitcodeMode.NONE
&& xcodeVersion != null
&& xcodeVersion.compareTo(MINIMUM_BITCODE_XCODE_VERSION) < 0) {
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeConfig.java b/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeConfig.java
index 7f3a98f1d0..0323a05259 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeConfig.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeConfig.java
@@ -39,7 +39,6 @@ import com.google.devtools.build.lib.packages.Rule;
import com.google.devtools.build.lib.packages.Target;
import java.util.List;
import java.util.Map;
-import java.util.Objects;
import javax.annotation.Nullable;
/**
@@ -373,11 +372,6 @@ public class XcodeConfig implements RuleConfiguredTargetFactory {
XcodeConfigRule.XCODE_CONFIG_ATTR_NAME,
RuleConfiguredTarget.Mode.TARGET,
XcodeConfigProvider.PROVIDER);
- DottedVersion fromProvider = versions.getXcodeVersion();
- DottedVersion fromConfig = ruleContext.getFragment(AppleConfiguration.class).getXcodeVersion();
- // This sanity check is there to keep this provider in sync with AppleConfiguration until the
- // latter can be removed. Tracking bug: https://github.com/bazelbuild/bazel/issues/3424
- Preconditions.checkState(Objects.equals(fromProvider, fromConfig));
- return fromProvider;
+ return versions.getXcodeVersion();
}
}