This message was deleted.
# dependency-management
s
This message was deleted.
d
What is working for me now is
Copy code
tasks.named("publish") { task ->
        configurations.forEach {conf ->
            if (conf.name == "implementation" || conf.name == "api") {
                conf.dependencies.findAll { it instanceof ProjectDependency }.forEach { dep ->
                    task.dependsOn(":${dep.name}:publish")
                }
            }
        }
    }
But I wonder if there is built-in way to achieve this
s
Executing tasks between projects would break project isolation though? you could have a task at the root project
someTaskForA
which could then depend on the execution of the same task across multiple projects
f
Copy code
./gradlew --project-dir subproject publish
untested
d
Copy code
./gradlew --project-dir subproject publish
no, it only executes publish for subproject, and not for its deps 🤔
Executing tasks between projects would break project isolation though?
🤔 it's a single project, and I only need to work with a module's subtree, so it shouldn't break isolation.
f
What you have is not breaking project isolation, because you are not actually accessing any project except your own. If my line didn't work, what you have should, and it looks good.
s
Maybe my understanding is incorrect, but isn’t a “project” in gradle terminology a module? In that case this is depending on tasks across modules and hence could prevent them from executing in parallel? Or does project isolation refer solely to isolated root projects?
f
Project isolation refers to object access, like in threading. You can still have tasks depending on tasks of other projects, but obviously it will have an effect on execution order and parallelism.