Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Introduce support for running phased actions #4533
This commit introduces the ability of running multiple build actions in
With this commit, a single action can be added to each one of the
This feature allows improvements like running actions that call a model
Signed-off-by: Lucas Smaira firstname.lastname@example.org
This change will be useful for Android Studio to sync and generate sources in a single Gradle invocation.
Problem and solution discussed with Gradlers in private meetings instead of public forums. Design doc included.
Gradle Core Team Checklist
I made a few changes concerning the reviewed doc:
Next failure is just a bad import I think: https://builds.gradle.org/viewLog.html?buildId=11486801&buildTypeId=Gradle_Check_Stage_QuickFeedback_Trigger
I've taken a first pass over the API, documentation and test coverage (which is great!). There are a few things I think we should change before I do a detailed review of the implementation classes.
Awesome stuff, this is almost ready to go, I just had a few comments around exception handling.
I'm afraid just checking whether some tasks were defined is not enough. Think about a phased action which just wants to look at the projects after the settings were evaluated, but doesn't want to configure them/run tasks at all. How would Gradle distinguish that from an action that does want Gradle to run the default tasks even though it only has a
It seems like the action should explicitly define up to which phase Gradle should run. That could be
Regarding your comments about the individual failures: I think I confused two different things:
If 1. fails, the build should terminate immediately. So if I provide an action that hooks into the projectsLoaded hook and that action fails, then Gradle should not configure or run tasks. We should have a test for that.
Failures in 2. should indeed be rethrown only after the build itself has finished.
Got it! That makes sense and I had completely missed interrupting the build if an action fails (I had only guaranteed that future actions wouldn't be executed).
I removed the last commit concerning listener exception handling and sent a new commit addressing your comments: