Conversation
Landing elastic#107018 broke running ESQL unit tests in IntelliJ. It has *something* to do with turning on the stringtemplate plugin in the esql project but I don't really know what. After that PR we'd often get errors about trying to regenerate evaluators twice. I dunno. This fixes it. But I don't really know why. The way this fixes it is by making the `esql` project more like the `copmute` project. It makes sense that that would help - they both have the same code generation configuration. Anyway, the operative change is landing the generated files in the same place as the `compute` project. Thus all of the file moves. Again, I have no idea why this works. It's build black magic and I just shook it until it worked. Most of the credit goes to git-bisect for finding the commit that broke this.
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
| * them and *then* compile them. | ||
| */ | ||
| tasks.named("compileJava").configure { | ||
| options.compilerArgs.addAll(["-s", "${projectDir}/src/main/java/generated"]) |
There was a problem hiding this comment.
It's now making them in src/main/generated-src/generated and I can't move it. It looks like this isn't configurable in intellij. But the compute subproject does the right thing and intellij generates the classes to src/main/generated. I have no idea what's up. But this works around it.
If any expert in gradle has time to understand this, great! You could fix this a lot better than I can.
There was a problem hiding this comment.
Yeah. This fails in gradle now...
alex-spies
left a comment
There was a problem hiding this comment.
Gave it a look and looks okay to me, but agree that it'd be great if @elastic/es-delivery could check if this can be fixed better.
While we're touching the generated src logic, maybe we should also remove the obsolete line from the top-level .gitignore? It's x-pack/plugin/esql/gen/ and that directory doesn't even exist anymore.
| // IntelliJ sticks generated files here and we can't stop it.... | ||
| exclude { it.file.toString().startsWith("${projectDir}/src/main/generated-src/generated") } |
There was a problem hiding this comment.
Well, this is annoying of IntelliJ :/
|
I've cherry-picked these commits into my branch to work around this issue, and can report that it works but for one strange thing. The versions of the evaluators with incorrect formatting are repeatedly being created (not sure if by gradle or intellij, since I'm running both) and I have to regularly run spotlessApply to get the correct versions back. |
|
I can't reproduce @craigtaverner's problem. I spent a while on video with him and we've tracked it down to something to do with his branch. If he switches to my branch it's fine. But that's where we stopped. We'll dig more soon. |
|
So that I can use this I'm going to merge it. I expect someone from delivery land to come and tell me the right way to do this soon and will happily do the gradle the way they prefer. Or, maybe, wondrously, they can figure out how to configure intellij the right way. |
Landing #107018 broke running ESQL unit tests in IntelliJ. It has something to do with turning on the stringtemplate plugin in the esql project but I don't really know what. After that PR we'd often get errors about trying to regenerate evaluators twice. I dunno. This fixes it. But I don't really know why.
The way this fixes it is by making the
esqlproject more like thecopmuteproject. It makes sense that that would help - they both have the same code generation configuration. Anyway, the operative change is landing the generated files in the same place as thecomputeproject. Thus all of the file moves.Again, I have no idea why this works. It's build black magic and I just shook it until it worked. Most of the credit goes to git-bisect for finding the commit that broke this.