diff options
author | 2018-02-27 08:28:59 -0800 | |
---|---|---|
committer | 2018-02-27 08:31:51 -0800 | |
commit | 98ed9af727ec6342206d181fcd465e3e83980c52 (patch) | |
tree | cc222a83217b8f3558c2acc2502a5c5ace428bc7 /src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java | |
parent | 19c64284fb33372bd1a9185e0e8bb2a7b32265a1 (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.java | 11 |
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( |