aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java3
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java6
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java16
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptions.java35
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptionsRule.java57
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java33
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/OptionsProvider.java39
7 files changed, 2 insertions, 187 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
index 90d11a8995..07da78e607 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
@@ -116,7 +116,6 @@ import com.google.devtools.build.lib.rules.objc.ObjcConfigurationLoader;
import com.google.devtools.build.lib.rules.objc.ObjcFrameworkRule;
import com.google.devtools.build.lib.rules.objc.ObjcImportRule;
import com.google.devtools.build.lib.rules.objc.ObjcLibraryRule;
-import com.google.devtools.build.lib.rules.objc.ObjcOptionsRule;
import com.google.devtools.build.lib.rules.objc.ObjcProtoLibraryRule;
import com.google.devtools.build.lib.rules.objc.ObjcRuleClasses;
import com.google.devtools.build.lib.rules.objc.ObjcXcodeprojRule;
@@ -339,7 +338,6 @@ public class BazelRuleClassProvider {
builder.addRuleDefinition(new ObjcFrameworkRule());
builder.addRuleDefinition(new ObjcImportRule());
builder.addRuleDefinition(new ObjcLibraryRule());
- builder.addRuleDefinition(new ObjcOptionsRule());
builder.addRuleDefinition(new ObjcProtoLibraryRule());
builder.addRuleDefinition(new ObjcXcodeprojRule());
builder.addRuleDefinition(new ObjcRuleClasses.CoptsRule());
@@ -351,7 +349,6 @@ public class BazelRuleClassProvider {
builder.addRuleDefinition(new ObjcRuleClasses.ResourcesRule());
builder.addRuleDefinition(new ObjcRuleClasses.XcodegenRule());
builder.addRuleDefinition(new ObjcRuleClasses.AlwaysLinkRule());
- builder.addRuleDefinition(new ObjcRuleClasses.OptionsRule());
builder.addRuleDefinition(new ObjcRuleClasses.SdkFrameworksDependerRule());
builder.addRuleDefinition(new ObjcRuleClasses.CompileDependencyRule());
builder.addRuleDefinition(new ObjcRuleClasses.ResourceToolsRule());
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
index 7f129f9e5c..e01f8e97af 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
@@ -373,8 +373,7 @@ public final class CompilationSupport {
.addFormatEach("-D%s", objcProvider.get(DEFINE))
.add(coverageFlags.build())
.add(objcConfiguration.getCopts())
- .add(attributes.copts())
- .add(attributes.optionsCopts());
+ .add(attributes.copts());
PathFragment sourceExecPathFragment = sourceFile.getExecPath();
String sourcePath = sourceExecPathFragment.getPathString();
if (!sourceExecPathFragment.isAbsolute() && objcConfiguration.getUseAbsolutePathsForActions()) {
@@ -1111,8 +1110,7 @@ public final class CompilationSupport {
// The include directory options ("-I") are parsed out of copts. The include directories are
// added as non-propagated header search paths local to the associated Xcode target.
- Iterable<String> copts = Iterables.concat(
- objcConfiguration.getCopts(), attributes.copts(), attributes.optionsCopts());
+ Iterable<String> copts = Iterables.concat(objcConfiguration.getCopts(), attributes.copts());
Iterable<String> includeDirOptions = Iterables.filter(copts, INCLUDE_DIR_OPTION_IN_COPTS);
Iterable<String> coptsWithoutIncludeDirs = Iterables.filter(
copts, Predicates.not(INCLUDE_DIR_OPTION_IN_COPTS));
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java
index 16ec90aab2..f48915012d 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java
@@ -201,22 +201,6 @@ public final class ObjcCommon {
}
/**
- * Returns any {@code copts} defined on an {@code objc_options} rule that is a dependency of
- * this rule.
- */
- public Iterable<String> optionsCopts() {
- if (!ruleContext.attributes().has("options", BuildType.LABEL)) {
- return ImmutableList.of();
- }
- OptionsProvider optionsProvider =
- ruleContext.getPrerequisite("options", Mode.TARGET, OptionsProvider.class);
- if (optionsProvider == null) {
- return ImmutableList.of();
- }
- return optionsProvider.getCopts();
- }
-
- /**
* The clang module maps of direct dependencies of this rule. These are needed to generate
* this rule's module map.
*/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptions.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptions.java
deleted file mode 100644
index 8473d388bc..0000000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptions.java
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 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.devtools.build.lib.analysis.ConfiguredTarget;
-import com.google.devtools.build.lib.analysis.RuleConfiguredTargetBuilder;
-import com.google.devtools.build.lib.analysis.RuleContext;
-import com.google.devtools.build.lib.analysis.RunfilesProvider;
-import com.google.devtools.build.lib.rules.RuleConfiguredTargetFactory;
-
-/**
- * Implementation for the {@code objc_options} rule.
- */
-public class ObjcOptions implements RuleConfiguredTargetFactory {
- @Override
- public ConfiguredTarget create(RuleContext ruleContext) {
- return new RuleConfiguredTargetBuilder(ruleContext)
- .add(RunfilesProvider.class, RunfilesProvider.EMPTY)
- .add(OptionsProvider.class,
- new OptionsProvider(ruleContext.getTokenizedStringListAttr("copts")))
- .build();
- }
-}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptionsRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptionsRule.java
deleted file mode 100644
index f22eb99dad..0000000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcOptionsRule.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 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 static com.google.devtools.build.lib.packages.Attribute.attr;
-
-import com.google.devtools.build.lib.analysis.BaseRuleClasses;
-import com.google.devtools.build.lib.analysis.RuleDefinition;
-import com.google.devtools.build.lib.analysis.RuleDefinitionEnvironment;
-import com.google.devtools.build.lib.packages.RuleClass;
-import com.google.devtools.build.lib.packages.RuleClass.Builder;
-import com.google.devtools.build.lib.syntax.Type;
-
-/**
- * Rule definition for {@code objc_options}.
- */
-public class ObjcOptionsRule implements RuleDefinition {
- @Override
- public RuleClass build(Builder builder, RuleDefinitionEnvironment env) {
- return builder
- // TODO(bazel-team): Delete this class and merge ObjcOptsRule with CompilingRule.
- .setUndocumented()
- /* <!-- #BLAZE_RULE(objc_options).ATTRIBUTE(xcode_name)[DEPRECATED] -->
- This attribute is ignored and will be removed.
- <!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
- .add(attr("xcode_name", Type.STRING))
- .build();
- }
-
- @Override
- public Metadata getMetadata() {
- return RuleDefinition.Metadata.builder()
- .name("objc_options")
- .factoryClass(ObjcOptions.class)
- .ancestors(BaseRuleClasses.BaseRule.class, ObjcRuleClasses.CoptsRule.class)
- .build();
- }
-}
-
-/*<!-- #BLAZE_RULE (NAME = objc_options, TYPE = OTHER, FAMILY = Objective-C) -->
-
-<p>This rule provides a nameable set of build settings to use when building
-Objective-C targets.</p>
-
-<!-- #END_BLAZE_RULE -->*/
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
index c5594e60d9..461c06d11f 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcRuleClasses.java
@@ -219,37 +219,6 @@ public class ObjcRuleClasses {
}
/**
- * Common attributes for {@code objc_*} rules that use plists or copts.
- */
- public static class OptionsRule implements RuleDefinition {
- @Override
- public RuleClass build(Builder builder, RuleDefinitionEnvironment env) {
- return builder
- // TODO(bazel-team): Remove options and replace with: (a) a plists attribute (instead of
- // the current infoplist, defined on all rules and propagated to the next bundling rule)
- // and (b) a way to share copts e.g. by being able to include constants across package
- // boundaries in bazel.
- //
- // For now the semantics of this attribute are: any copts in the options will be used if
- // defined on a compiling/linking rule, otherwise ignored. Infoplists are merged in if
- // defined on a bundling rule, otherwise ignored.
- .add(attr("options", LABEL)
- .undocumented("objc_options will be removed")
- .allowedFileTypes()
- .allowedRuleClasses("objc_options"))
- .build();
- }
-
- @Override
- public Metadata getMetadata() {
- return RuleDefinition.Metadata.builder()
- .name("$objc_options_rule")
- .type(RuleClassType.ABSTRACT)
- .build();
- }
- }
-
- /**
* Attributes for {@code objc_*} rules that can link in SDK frameworks.
*/
public static class SdkFrameworksDependerRule implements RuleDefinition {
@@ -662,7 +631,6 @@ public class ObjcRuleClasses {
.ancestors(
BaseRuleClasses.RuleBase.class,
CompileDependencyRule.class,
- OptionsRule.class,
CoptsRule.class,
XcrunRule.class)
.build();
@@ -801,7 +769,6 @@ public class ObjcRuleClasses {
.type(RuleClassType.ABSTRACT)
.ancestors(
AppleToolchain.RequiresXcodeConfigRule.class,
- OptionsRule.class,
ResourcesRule.class,
ResourceToolsRule.class,
XcrunRule.class)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/OptionsProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/OptionsProvider.java
deleted file mode 100644
index e3f200c93d..0000000000
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/OptionsProvider.java
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 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.devtools.build.lib.analysis.TransitiveInfoProvider;
-import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
-import com.google.devtools.build.lib.util.Preconditions;
-
-/**
- * Provides information contained in a {@code objc_options} target.
- */
-@Immutable
-final class OptionsProvider
- extends Value<OptionsProvider>
- implements TransitiveInfoProvider {
-
- private final Iterable<String> copts;
-
- public OptionsProvider(Iterable<String> copts) {
- super(copts);
- this.copts = Preconditions.checkNotNull(copts);
- }
-
- public Iterable<String> getCopts() {
- return copts;
- }
-}