diff options
Diffstat (limited to 'src/main/java')
3 files changed, 5 insertions, 22 deletions
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. |