Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for recompilation issue with the maven plugin #1846

Closed
wants to merge 5 commits into from

Conversation

alimg
Copy link
Contributor

@alimg alimg commented Apr 28, 2017

The current version of the maven plugin places the generated files directly into the generated-sources/antlr4 directory. Unfortunately Maven compiler plugin is unable to detect stale sources correctly if the directory structure doesn't match the package name (Java class files are recreated each time mvn is ran even if no changes were made in the code).

This change set places the files generated by the maven plugin to proper Java package structure when -package option is set.

@parrt
Copy link
Member

parrt commented Oct 21, 2017

How is this PR affected by this PR we are likely to incorporate in some fashion? #638

@alimg
Copy link
Contributor Author

alimg commented Oct 22, 2017

In a limited way, this PR seems to be related to #638 in the case about the usage of the -package argument being neglected when deciding the output path of the generated code.

This PR attempts to add some sanitation on the Maven plugin side only. The tool behaviour has been kept same, in case there are others relying on the existing behaviour.

However, I've realized that you can get the correct package structure if don't use -pacakge and keep the grammar sources on the correct relative path instead. I think this is useful enough, so I'm closing the PR. If you have any suggestion of a practical addition this, we can update and reopen though.

@alimg alimg closed this Oct 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants