aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--examples/proto/BUILD6
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibrary.java20
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java1
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryRule.java6
4 files changed, 5 insertions, 28 deletions
diff --git a/examples/proto/BUILD b/examples/proto/BUILD
index 32e43e5831..7ce5659ea6 100644
--- a/examples/proto/BUILD
+++ b/examples/proto/BUILD
@@ -2,12 +2,6 @@ package(default_visibility = ["//visibility:public"])
load("/tools/build_rules/genproto", "proto_java_library")
-proto_library(
- name = "proto_smoke_test",
- srcs = ["test.proto"],
-)
-
-# proto_java_library is a quick and dirty rule to help Bazel compile itself.
proto_java_library(
name = "test_proto",
src = "test.proto",
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibrary.java
index bd2342232b..db2590f4d9 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibrary.java
@@ -26,7 +26,6 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.analysis.ConfiguredTarget;
-import com.google.devtools.build.lib.analysis.PrerequisiteArtifacts;
import com.google.devtools.build.lib.analysis.RuleConfiguredTarget.Mode;
import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.actions.CustomCommandLine;
@@ -65,9 +64,10 @@ public class ObjcProtoLibrary implements RuleConfiguredTargetFactory {
ObjcProtoLibraryRule.COMPILE_PROTOS_ATTR, Mode.HOST);
Optional<Artifact> optionsFile = Optional.fromNullable(
ruleContext.getPrerequisiteArtifact(ObjcProtoLibraryRule.OPTIONS_FILE_ATTR, Mode.HOST));
-
NestedSet<Artifact> protos = NestedSetBuilder.<Artifact>stableOrder()
- .addAll(maybeGetProtoFiles(ruleContext))
+ .addAll(ruleContext.getPrerequisiteArtifacts("deps", Mode.TARGET)
+ .filter(FileType.of(".proto"))
+ .list())
.addTransitive(maybeGetProtoSources(ruleContext))
.build();
@@ -207,20 +207,6 @@ public class ObjcProtoLibrary implements RuleConfiguredTargetFactory {
.build();
}
- /**
- * Get .proto files added to the deps attribute. This is for backwards compatibility,
- * and emits a warning.
- */
- private ImmutableList<Artifact> maybeGetProtoFiles(RuleContext ruleContext) {
- PrerequisiteArtifacts prerequisiteArtifacts =
- ruleContext.getPrerequisiteArtifacts("deps", Mode.TARGET);
- if (!prerequisiteArtifacts.list().isEmpty()) {
- ruleContext.attributeWarning("deps",
- "Using files and filegroups in objc_proto_library is deprecated");
- }
- return prerequisiteArtifacts.filter(FileType.of(".proto")).list();
- }
-
private NestedSet<Artifact> maybeGetProtoSources(RuleContext ruleContext) {
NestedSetBuilder<Artifact> artifacts = new NestedSetBuilder<>(Order.STABLE_ORDER);
Iterable<ProtoSourcesProvider> providers =
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
index 4052cef8c9..ff4903b082 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProtoLibraryRule.java
@@ -53,7 +53,6 @@ public class ObjcProtoLibraryRule implements RuleDefinition {
${SYNOPSIS}
<!-- #END_BLAZE_RULE.ATTRIBUTE -->*/
.override(attr("deps", LABEL_LIST)
- // Support for files in deps is for backwards compatibility.
.allowedRuleClasses("proto_library", "filegroup")
.legacyAllowAnyFileType())
/* <!-- #BLAZE_RULE(objc_proto_library).ATTRIBUTE(options_file) -->
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryRule.java b/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryRule.java
index 2c4f9b4239..b8e190c1f3 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryRule.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/proto/BazelProtoLibraryRule.java
@@ -33,13 +33,11 @@ public final class BazelProtoLibraryRule implements RuleDefinition {
public RuleClass build(Builder builder, final RuleDefinitionEnvironment env) {
return builder
- // This rule works, but does nothing, in open-source Bazel, due to the
- // lack of protoc support. Users can theoretically write their own Skylark rules,
- // but these are still 'experimental' according to the documentation.
.setUndocumented()
.setOutputToGenfiles()
/* <!-- #BLAZE_RULE(proto_library).ATTRIBUTE(deps) -->
- The list of other <code>proto_library</code> rules that the target depends upon.
+ The list of other <code>proto_library</code>
+ rules that the target depends upon.
${SYNOPSIS}
A <code>proto_library</code> may only depend on other
<code>proto_library</code> targets.