This message was deleted.
# community-support
s
This message was deleted.
v
Iterate through the dependencies and check for it's type to be
ProjectDependency
iirc
a
https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:programmatic_api something like this should be a start
Copy code
tasks.register("printSubprojectDependencies") {
  group = "help"

  val subprojectNames = configurations.compileClasspath.map { conf ->
    conf
      .incoming
      .artifactView {
        componentFilter { it is ProjectComponentIdentifier }
      }.artifacts
      .artifacts
      .map { it.id.displayName }
  }

  inputs.property("subprojectNames", subprojectNames)

  doLast {
    logger.lifecycle(subprojectNames.get().joinToString())
  }
}
but that only logs incoming subproject dependencies. And it’s the compile-time only, but you can tweak it to also log the runtimeClasspath. If •
subproject-b
and
subproject-c
depend on
subproject-a
, • and you want a task inside
subproject-a
that prints “I’m used by subproject-b and subproject-c” , then that might be a little more difficult. Subprojects aren’t supposed to know how other subprojects are configured.