Le 16/08/2023 à 20:54, Laszlo Kishalmi a écrit :
(…snip…) The Module Source Hierarchy is a new way to organize source code introduced in Java 9 (…snip…) Gradle's flexibility makes possible to use Module Source Hierarchy anyway, but the result in NetBeans is currently not good (by comparison, it is okay in IntelliJ). I would like to improve that with patch contributions, but I have no knowledge of NetBeans internal. Can someone point me to which classes I need to look at please?

https://github.com/apache/netbeans/blob/master/java/gradle.java/src/org/netbeans/modules/gradle/java/classpath/GradleSourcesImpl.java

Probably that's where to look first.

Thanks Laszlo. I had a look, but the problem appears bigger than I initially thought. The background scanning run almost non-stop, the hints report errors everywhere… NetBeans seems confused by Module Source Hierarchy in Gradle project. By contrast it works well with the NetBeans Ant modular project. So for now I'm going to maintain 2 build systems: the "official" one with Gradle, and an Ant Modular project for development in NetBeans only. The latter would be deleted in the future if it become not needed anymore.

One difficulty with NetBeans Ant projects is that there is a `javac.compilerargs` property, but I found no way to specify a different value for tests compared to main code. Specifying test-specific compiler options was maybe not necessary before JPMS, but become important in a JPMS world for specfying --add-modules, --add-reads, --add-exports, etc.

P.S. It seems impossible to use Maven for a Java project with Module Source Hierarchy. Gradle and Ant are the only possibilities I can see.

    Martin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to