@@ -52,6 +52,7 @@ public Provider() {
5252 public static final String LEGACY_SKYLARK_NAME = "proto" ;
5353
5454 private final ImmutableList <Artifact > directProtoSources ;
55+ private final ImmutableList <Artifact > originalDirectProtoSources ;
5556 private final String directProtoSourceRoot ;
5657 private final NestedSet <Artifact > transitiveProtoSources ;
5758 private final NestedSet <String > transitiveProtoSourceRoots ;
@@ -68,6 +69,7 @@ public Provider() {
6869 @ AutoCodec .Instantiator
6970 public ProtoInfo (
7071 ImmutableList <Artifact > directProtoSources ,
72+ ImmutableList <Artifact > originalDirectProtoSources ,
7173 String directProtoSourceRoot ,
7274 NestedSet <Artifact > transitiveProtoSources ,
7375 NestedSet <String > transitiveProtoSourceRoots ,
@@ -82,6 +84,7 @@ public ProtoInfo(
8284 Location location ) {
8385 super (PROVIDER , location );
8486 this .directProtoSources = directProtoSources ;
87+ this .originalDirectProtoSources = originalDirectProtoSources ;
8588 this .directProtoSourceRoot = directProtoSourceRoot ;
8689 this .transitiveProtoSources = transitiveProtoSources ;
8790 this .transitiveProtoSourceRoots = transitiveProtoSourceRoots ;
@@ -96,12 +99,21 @@ public ProtoInfo(
9699 this .transitiveDescriptorSets = transitiveDescriptorSets ;
97100 }
98101
99- /** The proto sources of the {@code proto_library} declaring this provider. */
102+ /**
103+ * The proto source files that are used in compiling this {@code proto_library}.
104+ *
105+ * <p>Different from {@link #getOriginalDirectProtoSources()} when a virtual import root is used.
106+ */
100107 @ Override
101108 public ImmutableList <Artifact > getDirectProtoSources () {
102109 return directProtoSources ;
103110 }
104111
112+ /** The proto sources of the {@code proto_library} declaring this provider. */
113+ public ImmutableList <Artifact > getOriginalDirectProtoSources () {
114+ return originalDirectProtoSources ;
115+ }
116+
105117 /** The source root of the current library. */
106118 @ Override
107119 public String getDirectProtoSourceRoot () {
0 commit comments