Skip to content

Commit

Permalink
Make J2ObjcAspect#getProtoOutputRoot compatible with --experimental_s…
Browse files Browse the repository at this point in the history
…ibling_repository_layout.

It currently adds the repository's exec path. Since it starts with ".." when the flag is in effect, what it actually does is removing the "genfiles" path element from the returned path. Given genfiles paths already include repository names in the new path architecture, this suffix is no longer required.

PiperOrigin-RevId: 354122464
  • Loading branch information
Googler authored and Copybara-Service committed Jan 27, 2021
1 parent 3b3e642 commit bff197a
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -770,13 +770,12 @@ private static J2ObjcSource protoJ2ObjcSource(
}

private static PathFragment getProtoOutputRoot(RuleContext ruleContext) {
if (ruleContext.getConfiguration().isSiblingRepositoryLayout()) {
return ruleContext.getGenfilesFragment();
}
return ruleContext
.getGenfilesFragment()
.getRelative(
ruleContext
.getLabel()
.getRepository()
.getExecPath(ruleContext.getConfiguration().isSiblingRepositoryLayout()));
.getRelative(ruleContext.getLabel().getRepository().getExecPath(false));
}

private static boolean isProtoRule(ConfiguredTarget base) {
Expand Down

0 comments on commit bff197a

Please sign in to comment.