aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
diff options
context:
space:
mode:
authorGravatar elenairina <elenairina@google.com>2018-02-27 08:28:59 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-27 08:31:51 -0800
commit98ed9af727ec6342206d181fcd465e3e83980c52 (patch)
treecc222a83217b8f3558c2acc2502a5c5ace428bc7 /src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
parent19c64284fb33372bd1a9185e0e8bb2a7b32265a1 (diff)
Expose ProtoSourcesProvider.transitive_proto_path_flags to Skylark.
Progress on #4544. RELNOTES: None. PiperOrigin-RevId: 187179454
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
index 374b534cd9..a86bdda6dc 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
@@ -100,29 +100,28 @@ public class ProtoCommon {
}
/**
- * Returns all proto source roots in this lib and in its transitive dependencies, each prefixed
- * by {@code --proto_path}.
+ * Returns all proto source roots in this lib and in its transitive dependencies.
*
* Build will fail if the {@code proto_source_root} of the current lib is different than the
* package name.
*/
public static NestedSet<String> collectTransitiveProtoPathFlags(RuleContext ruleContext) {
- NestedSetBuilder<String> protoPathFlags = NestedSetBuilder.stableOrder();
+ NestedSetBuilder<String> protoPath = NestedSetBuilder.stableOrder();
// first add the protoSourceRoot of the current target, if any
String protoSourceRoot =
ruleContext.attributes().get("proto_source_root", Type.STRING);
if (protoSourceRoot != null && !protoSourceRoot.isEmpty()) {
checkProtoSourceRootIsTheSameAsPackage(protoSourceRoot, ruleContext);
- protoPathFlags.add("--proto_path=" + protoSourceRoot);
+ protoPath.add(protoSourceRoot);
}
for (ProtoSourcesProvider provider : ruleContext.getPrerequisites(
"deps", Mode.TARGET, ProtoSourcesProvider.class)) {
- protoPathFlags.addTransitive(provider.getTransitiveProtoPathFlags());
+ protoPath.addTransitive(provider.getTransitiveProtoPathFlags());
}
- return protoPathFlags.build();
+ return protoPath.build();
}
private static void checkProtoSourceRootIsTheSameAsPackage(