Adjust the output file locations for the Antlr task

Review Request #4161 - Created Aug. 14, 2016 and submitted

Information
Lex Spoon
pants
3787
Reviewers
pants-reviews
jsirois, stuhood, wisechengyi

Adjust the output file locations for the Antlr task.

The Antlr rules don't currently lead to a happy IntelliJ configuration. This PR is one way to fix it, although I'm not really sure what the best approach is.

The root problem is that Antlr dumps its output files into a path determined by the relative path specified for the input file. This PR takes the simple approach of moving all the files once they have been generated.

As a possible alternative, the files could be left in their current location, and the IntelliJ support could be modified to generate a better source root for the resulting code. It seemed slightly better, though, to try and fix the file locations earlier in the pipeline, right when they are generated. Antlr has predictable output, so it's not too hard to just fix it up.

I checked the behavior with the checked-in Antlr samples:

./pants  idea ./examples/src/java/org/pantsbuild/example/antlr3::
./pants  idea ./examples/src/java/org/pantsbuild/example/antlr4::

I also ran the the unit-test.sh script.

Travis CI has passed: https://travis-ci.org/pantsbuild/pants/builds/152249047

Issues

  • 0
  • 7
  • 0
  • 7
Description From Last Updated
Lex Spoon
Yi Cheng
Eric Ayers
Lex Spoon
Garrett Malmquist
Lex Spoon
Garrett Malmquist
Yi Cheng
Lex Spoon
Review request changed

Status: Closed (submitted)

Change Summary:

Thanks Lex! Merged to master at fb960ab

Eric Ayers
Ship It!
Loading...