Hello,
in our gradle build environment, we have different projects in independent directories. I defined all projects and their directories in settings.gradle. Running on Gradle 2.0, the build was running fine. That is, running from a subproject directory, only this subproject and all dependencies were built. Starting with Gradle 2.1 (and also current 2.2 nightly), running gradle with some task (e.g. compileJava) from a subproject directory leads to the task with this name being run for all projects. Is this change in behaviour considered a bug or what can I do to get the old behaviour back?
My Setup: I declare all projects in settings.gradle and run gradle with “-c /absolutePathATo/gradleSettings/settings.gradle”. The build logic is defined in a root project. I could reproduce the issue with the following (minimal) gradle files.
/absolutePathATo/gradleSettings/settings.gradle:
include ':proj1', ':proj2'
project(':proj2').projectDir = new File("/absolutePathDTo/gradleproj2")
project(':proj1').projectDir = new File("/absolutePathCTo/gradleproj1")
//project(':proj1:sub').projectDir = new File("/absolutePathETo/gradleproj1sub")
rootProject.projectDir = new File("/absolutePathBTo//gradleroot")
/absolutePathTo/gradle/gradleroot/build.gradle:
subprojects {
apply plugin: 'java'
}
/absolutePathCTo/gradleproj1/build.gradle is empty *
/absolutePathDTo/gradleproj2/build.gradle:
dependencies {
compile project(':proj1')
}
On Gradle 2.0, running “gradle -c /absolutePathTo/gradle/gradlesettings/settings.gradle compileJava” from /absolutePathTo/gradle/gradleproj1 will lead to only proj1 being built, while on Gradle 2.1 all projects will be built.
Thank you in advance, Thomas