New gradle setup does not play nicely with Intellij
Hey, as outlined in my comment on https://github.com/bcgit/bc-java/commit/05594043c82ab45bf3b12a5cf5e86a584b83f888 the new gradle setup causes hurdles for development using Intellij.
Intellij complains about a duplicate content root for the pg module. If I manually set back pg/src/main/java as content root, there are dependency issues resolving core.prov. If instead I mark generated-src as content root, Intellij keeps opening the generated source files when I want to make changes, which are then obviously overwritten as soon as gradle re-generates those files from the true sources.
Currently, these changes unfortunately make it very hard to work on BC :/ If you have any tips for me on how to resolve this, apart from basing my branches onto commits before the change, let me know!
We think the issue related to core:prov might now be dealt with. Let us know how it's currently looking.
On the latest main branch, after reopening the project, pg/src/main/jdk1.9 is still marked as content root and pg/src/main/java is unmarked, such that the source files are not picked up by the IDE.
If I manually mark pg/src/main/java as content root, the IDE picks up those files, but still fails to resolve some dependencies like org.bouncycastle.util.Arrays. I can fix this by manually adding a dependency to workingdir.bc-java.core.main (somethings strange here plus it actually doesn't cause any changes to the build scripts, but apparently resolves the issue in Intellij), however, as soon as I reload the gradle project, those changes are reverted, as the content root again is set to the jdk1.9 directory.
Okay, that's fairly weird... I'm beginning to remember why I still don't use gradle in IntelliJ... will have to think on this, wondering if there is some "secret sauce" IntelliJ will read from a gradle script that applies to it only. Getting 1.79 out the door at the moment, so it may take a while.
Any updates on the gradle situation? With the latest release, the situation seemingly got worse. Now I cannot get test cases to resolve their dependencies anymore, as SimpleTest etc. cannot be located.
Oh dear... so gradle now set up for Java 25 and using 9.1.0... What version does Intellij think it's using?
My Intellij is using Gradle 9.1.0 as well. Still, SimpleTest cannot be resolved from the pg tests.
I've got a feeling this might be an issue about the split between prov and core - prov is built from prov + core, simple test is in core, but the pg library depends on prov. It sounds like IntelliJ isn't recognising the extra dependency. I suspect "fixing" this properly may involve combining prov and core and building the provider and the lcrypto classes from the same module... not sure...
As a point of reference: Commit 727e864630b5b7bac8ece1a0159492aa3b024c77 works fine in Intellij, but after this commit things break.