This message was deleted.
# community-support
s
This message was deleted.
✅ 1
f
Copy code
tasks.register<GradleBuild>("run-my-task-for-a-b") {
 dependsOn(":project-a:my-task")
}
I wrote like that and got this error
Could not determine the dependencies of task ':project-a:my-task'. Task with path ':project-a:my-task' not found in project ':build-logic:my-plugin'
Ah... seems all I need to do is to create an new build.gradle.kts file besides the root project's setting.gradle.kts, then write it over there.
v
You don't need anything actually
If you execute
./gradlew my-task
then it is automatically run in all projects that have a task with that name without any special setup necessary
👍 1
And if you do want to create a dedicated lifecycle task, at least make it not of type
GradleBuild
, that is something completely different.
🙏 1
f
Aha, I see, thank you so much. Indeed I have to remove that `GradleBuild`type, otherwise I got some errors. The thing is I have lots of projects, each having `my-task`there but I only want to run a sub set of those. But you just also hinted me that instead of writing some script. what I can also do is just
./gradlew :p1:my-task :p2:my-task
, that is not a bad solution 🙂
👌 1