Alex Beggs
11/11/2025, 12:58 AMbuildMyDemo and have it find any buildMyDemo tasks in the subprojects and execute them.
I have come up with two solutions:
Option 1:
1. Register buildMyDemo in every project
2. Configure buildMyDemo when necessary in the appropriate subproject
Option 2:
1. Register buildMyDemo in the rootProject once
2. Configure buildMyDemo when necessary in the appropriate subproject
My question comes down to performance. How much worse is Option 1 vs 2? I have ~800 subprojects. I'm planning on implementing Option 2, but I wanted to understand the impact of register across all of the projects.Vampire
11/11/2025, 1:51 AM./gradlew buildMyDemo, each project that does have such a task will get that task executed, the others not.Vampire
11/11/2025, 1:53 AMAlex Beggs
11/11/2025, 4:01 AMHow about doing neither?
Just have the task in the projects where you have it and that's it.
If you doBut the use case is to call, each project that does have such a task will get that task executed, the others not../gradlew buildMyDemo
./gradlew buildMyDemo at the root project, if none exists then it would fail. I don't want it to fail.
Also, if I understood your "Option 2" correct, it is a no-go anyway.
I got that you want to configure the root project task from the subprojects.I wasn't clear. I want to create a
buildMyDemo task in the root project that is essentially a no-op. And then in any other project (not calling the subprojects closure), have them setup the buildMyDemo task for their own project if it should.Vampire
11/11/2025, 9:08 AMVampire
11/11/2025, 9:09 AMgradle-profiler.Alex Beggs
11/11/2025, 2:20 PMAlex Beggs
12/01/2025, 7:43 PM