Gradle composite builds – How to make an included task depend on a task in the project including the build?

  Kiến thức lập trình

I have a Gradle project that includes a number of other builds. Making a task in the root project depend on a task in one of the included builds is easy:

tasks.register("run") {
    dependsOn(gradle.includedBuild("my-app").task(":app:run"))
}

But I can’t find a way to do the opposite. Is it really not possible to tell Gradle that a task in the included project depends on or at least should run after a task in the root project?

LEAVE A COMMENT