Skip to content

Commit

Permalink
Use relative paths for the grammar input files
Browse files Browse the repository at this point in the history
The file paths that are passed to antlr end up in the generated output
so using absolute paths breaks caching.

Fixes marcohu#12.
  • Loading branch information
rrbutani committed May 14, 2021
1 parent 89a29cc commit b468b28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion antlr/antlr3.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _args(ctx, output_dir):
if ctx.attr.nfa:
args.add("-nfa")

args.add("-o")
args.add("-fo")
args.add(output_dir)

if ctx.attr.profile:
Expand Down
1 change: 1 addition & 0 deletions antlr/antlr4.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def _args(ctx, output_dir):
if ctx.attr.no_visitor:
args.add("-no-visitor")

args.add("-Xexact-output-dir")
args.add("-o")
args.add(output_dir)

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/antlr/bazel/AntlrRules.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ AntlrRules grammars(String... grammars)

for (String grammar : grammars)
{
this.grammars.add(sandbox.resolve(grammar).toString());
this.grammars.add(grammar.toString());
}

return this;
Expand Down

0 comments on commit b468b28

Please sign in to comment.