|
23 | 23 | import com.google.common.collect.ImmutableList;
|
24 | 24 | import com.google.common.collect.ImmutableSet;
|
25 | 25 | import com.google.devtools.build.lib.actions.Artifact;
|
26 |
| -import com.google.devtools.build.lib.analysis.PrerequisiteArtifacts; |
| 26 | +import com.google.devtools.build.lib.analysis.FileProvider; |
27 | 27 | import com.google.devtools.build.lib.analysis.RuleContext;
|
| 28 | +import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; |
28 | 29 | import com.google.devtools.build.lib.collect.nestedset.NestedSet;
|
29 | 30 | import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
|
30 | 31 | import com.google.devtools.build.lib.rules.proto.ProtoInfo;
|
@@ -86,7 +87,17 @@ ImmutableList<Artifact> getPortableProtoFilters() {
|
86 | 87 |
|
87 | 88 | /** Returns the list of well known type protos. */
|
88 | 89 | NestedSet<Artifact> getWellKnownTypeProtos() {
|
89 |
| - return PrerequisiteArtifacts.nestedSet(ruleContext, ObjcRuleClasses.PROTOBUF_WELL_KNOWN_TYPES); |
| 90 | + NestedSetBuilder<Artifact> wellKnownTypeProtos = NestedSetBuilder.stableOrder(); |
| 91 | + for (TransitiveInfoCollection protos : |
| 92 | + ruleContext.getPrerequisites(ObjcRuleClasses.PROTOBUF_WELL_KNOWN_TYPES)) { |
| 93 | + ProtoInfo protoInfo = protos.get(ProtoInfo.PROVIDER); |
| 94 | + if (protoInfo != null) { |
| 95 | + wellKnownTypeProtos.addTransitive(protoInfo.getTransitiveProtoSources()); |
| 96 | + } else { |
| 97 | + wellKnownTypeProtos.addTransitive(protos.getProvider(FileProvider.class).getFilesToBuild()); |
| 98 | + } |
| 99 | + } |
| 100 | + return wellKnownTypeProtos.build(); |
90 | 101 | }
|
91 | 102 |
|
92 | 103 | /** Returns the list of proto files to compile. */
|
|
0 commit comments