kelemen / netbeans-gradle-project

This project is a NetBeans plugin able to open Gradle based Java projects. The implementation is based on Geertjan Wielenga's plugin.
170 stars 57 forks source link

generated code missing transitive dependencies #420

Closed ratcashdev closed 5 years ago

ratcashdev commented 5 years ago

While opening the https://github.com/real-logic/simple-binary-encoding project in Netbeans is successful, (plugin 2.0.2), the generated code in the directory build/generated is full of unknown imports, at least according to netbeans. the gradle build itself is actually successful. It seems Netbeans is not picking up the transitive dependencies for the generated code.

kelemen commented 5 years ago

The problem with this project is that instead of putting the dependencies in the source set's classpath it configures the compiler task and the plugin assumes that the dependencies for the source set is what is in the compile classpath of the source set.

ratcashdev commented 5 years ago

Any idea how to fix this by editing the build.gradle?

kelemen commented 5 years ago

Instead of adjusting compileGeneratedJava.classpath, adjustsourceSets.generated.compileClasspath instead. Or even better to just do (and leave the classpath of the compiler task be):

configurations {
    generatedCompile.extendsFrom compile
}
ratcashdev commented 5 years ago

Thank you! The first (adjustsourceSets.generated.compileClasspath) did not help. The second did though, however, now it says the MAIN does not have any dependencies, only 'generated'. But compiles OK, so may be just cosmetics.