Consider the following project structure:
root
| – entrypoint
| – core
entrypoint, as you can already surmise, contains the main()method and includes core as a dependency
dependencies {
compile project(":core")
}
What I want to do now is that, during development, when I call bootRun Gradle doesn’t include core from the .jar that it builds but the actual build folders (e.g. build/classes and build/resources.
I got it working by explicitly changing the dependency to
dependencies {
// compile project(":core")
compile files("${rootDir}/core/build/classes/java/main")
compile files("${rootDir}/core/build/resources/main")
}
but obviously that’s not the best approach because if there’s any generated code or multiple sourcesets/resource dirs they all need to be added separately.
Is there any way to achieve this “automagically” a’la something like this ideally:
dependencies {
compile project(":core") {
useBuildDir = true
}
}