I am updating from Gradle 2 to Gradle 6. For the most part, my builds work fine, after some syntax changes. However, I am running into an issue when my build.gradle file has multiple nested task of the type GradleBuild.
A Simplified example:
#SessionBeanJar is a task of type Jar
#ServletWar is a task or type War
task backendBeans(type: GradleBuild) {
startParameter.projectProperties = gradle.startParameter.projectProperties
tasks = [ 'SessionBeanJar1', 'SessionBeanJar2' ]
}
task backendServlets(type: GradleBuild) {
startParameter.projectProperties = gradle.startParameter.projectProperties
tasks = [ 'ServletWar1', 'ServletWar2' ]
}
task backendBuildError(type: GradleBuild) {
startParameter.projectProperties = gradle.startParameter.projectProperties
tasks = ['backendBeans', 'backendServlets', 'tarGF', 'publishGF']
}
task backendBuildFine(type: GradleBuild) {
startParameter.projectProperties = gradle.startParameter.projectProperties
tasks = ['backendBeans', 'ServletWar1', 'ServletWar2', 'tarGF', 'publishGF']
}
If I run the task backendBuildError I receive the following error
Included build /Users/db/Docs/workspace/backendsubsystems has build path :backendsubsystems:backendsubsystems which is the same as included build /Users/db/Docs/workspace/backendsubsystems
However, if I run the task backendBuildFine everything runs and completes without any issues.
It seems that only one task of type GradleBuild is allowed to do any work. Any subsequent task to type GradleBuild cause the above error. Is there a way to do what the backendBuildError task is doing? Or, Do i have to define all the work tasks in a single GradleBuild task?