Open a01fe opened 5 years ago
@a01fe you can try the following build.gradle:
plugins {
id 'java'
id 'eclipse'
}
repositories {
jcenter()
}
dependencies {
}
sourceSets {
main {
java {
srcDirs 'src/main/java', 'buildSrc/srcmain'
}
}
}
@a01fe you can try the following build.gradle:
plugins { id 'java' id 'eclipse' } repositories { jcenter() } dependencies { } sourceSets { main { java { srcDirs 'src/main/java', 'buildSrc/srcmain' } } }
But this mixes normal source code with isolated plugin code of buildsrc which might have completely different dependencies etc. So this is not a viable solution.
Interestingly it works in eclipse though. There it is just another gradle project imported.
actually it's a missing feature in buildship, see: https://github.com/eclipse/buildship/issues/1126#issuecomment-1004643907. vscode-java can support importing buildSrc once buildship supports it.
I have a Gradle project with an embedded plugin in
buildSrc
that has Java code inbuildSrc/srcmain/my/package/Foo.java
. When I open these Java files, a "Foo.java isn't on the classpath" notification pops up and things like Oragnize Imports and javadoc hovers don't work.It would be awesome if vscode-java would recognize
buildSrc
in a Gradle project so language support would work in plugin source code.Environment
Steps To Reproduce
Current Result
No language support available
Expected Result
Working language support