-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GradleBuild is not compatible with composite builds #304
Comments
Why do you try to use composite builds for this and not a multi project setup? I think composite builds are not really made for this as they just shall help to develop in multiple projects. In multi project setups you explicitly specify the dependency in a project but for composite builds you get a drop in replacement of the referenced projects and their sub projects. |
@Hillkorn sorry I recover this topic now, just forgot about it. This is why you have dependency locking in gradle: And also, keep in mind the new concept of "platforms" in Gradle. A composite build can share one platform (which we do), so all version requirements are actually "shared", so one project included in the composite build cannot violate any of our version rules. |
This is really a problem. The last one in the list is for example my current situation. So please fix this somehow. |
Using the tooling api to kick off the build instead of the For example: tasks.register("runBuildTasks") {
doLast {
GradleConnector
.newConnector()
.forProjectDirectory(layout.projectDirectory.asFile)
.connect()
.use { projectConnection ->
projectConnection
.newBuild()
.forTasks("build")
.setStandardInput(System.`in`)
.setStandardOutput(System.out)
.setStandardError(System.err)
.run()
}
}
} That's in Kotlin DSL, but you should be able to easily transform it to Groovy too. |
Yep, this works as consumer-side work-around, replacing the configure(listOf(tasks.release, tasks.runBuildTasks)) {
configure {
actions.clear()
doLast {
GradleConnector
.newConnector()
.forProjectDirectory(layout.projectDirectory.asFile)
.connect()
.use { projectConnection ->
val buildLauncher = projectConnection
.newBuild()
.forTasks(*tasks.toTypedArray())
.setStandardInput(System.`in`)
.setStandardOutput(System.out)
.setStandardError(System.err)
gradle.startParameter.excludedTaskNames.forEach {
buildLauncher.addArguments("-x", it)
}
buildLauncher.run()
}
}
}
} So it should also work fine if you do it in the plugin right away. |
But this would remove the need for the listener as we only listen for failures of the release task to run |
This issue has actually one more implication. |
Or if you would not eagerly create the tasks, according to that issue, but not using |
Also interested in a fix for this |
Is there any plan to implement this? Would be greatly appreciated! |
I know the reasons why you used this GradleBuild:
#62
But we had a great surprise when we tried to release our recently new stuff using composite builds. GradleBuild is not supporting them:
gradle/gradle#8246
This is a huge limitation. Composite Builds are receiving everytime more attention.
We have managed to workaround it by splitting it in 3 phases and calling it from different build cycles from the pipeline:
phase 1:
phase 2:
then we call our build stuff
phase 3:
I also have to rework the "mustRunAfter" to guarantee the order.
In the end it is kind of working, but it is not nice at all. Would you be willing to accept Pull request and work on it together?
The text was updated successfully, but these errors were encountered: