-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fixes for Gradle tasks for Antlr #3079
Conversation
Result of fdb-record-layer-pr on Linux CentOS 7
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one comment about cleaning these generated tokens, but this is also clearly a win, and I'm merging this one and taking a change to clean up the tokens files as a follow up
@@ -21,6 +21,7 @@ | |||
apply plugin: 'antlr' | |||
|
|||
generateGrammarSource { | |||
outputDirectory = layout.buildDirectory.dir('generated-src/antlr/main/com/apple/foundationdb/relational/generated').get().asFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll have to think at some point how to make this more generic so that it accepts different package names, though for now, this should be fine. Something we will have to notice if we ever change the hardcoded package below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's cross that bridge when we reach it then.
* add post task that copies .token files to fdb-relational-core/src/main/antlr this makes the IDE able to parse the grammar files correctly.
ebac74a
to
d894093
Compare
This adds two fixes:
generateGrammarSource
task which copies all*.token
files next to the grammar and lexer files insrc/main/antlr
. These files are added to.gitignore
to avoid checking them in by mistake.These effectively enable the IDE to correctly parse and present the grammar files as well as the generated files, before it was showing hundreds of errors due to file location mismatch and the inability to link the grammar file with the respective tokens array.