aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/proto/ProtoCommon.java
diff options
context:
space:
mode:
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.java16
1 files changed, 1 insertions, 15 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 54393cb212..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
@@ -183,7 +183,7 @@ public class ProtoCommon {
ArtifactRoot genfiles =
ruleContext.getConfiguration().getGenfilesDirectory(ruleContext.getRule().getRepository());
for (Artifact src : protoSources) {
- PathFragment srcPath = getPathIgnoringRepository(src);
+ PathFragment srcPath = src.getRootRelativePath();
if (pythonNames) {
srcPath = srcPath.replaceName(srcPath.getBaseName().replace('-', '_'));
}
@@ -251,18 +251,4 @@ public class ProtoCommon {
}
return (flagValue == BuildConfiguration.StrictDepsMode.STRICT);
}
-
- /**
- * Gets the artifact's path relative to the root, ignoring the external repository the artifact is
- * at. For example, <code>
- * //a:b.proto --> a/b.proto
- * {@literal @}foo//a:b.proto --> a/b.proto
- * </code>
- */
- public static PathFragment getPathIgnoringRepository(Artifact artifact) {
- return artifact
- .getRootRelativePath()
- .relativeTo(
- artifact.getOwnerLabel().getPackageIdentifier().getRepository().getPathUnderExecRoot());
- }
}