Is there a way to iterate through type-safe project accessors?

I have a few directories with modules: base, library, feature. And i need to use modules from each directory in main application module. Something like this:

projects.base.myProjects.forEach { dep: DelegatingProjectDependency ->
    implementation(dep)
}

The problem is that BaseProjectDependency does not have a method for getting all of its dependencies, but only separate methods for each. I tried following the advice from here Allow iterating over dependencies declared in a version catalog · Issue #16784 · gradle/gradle · GitHub , but it didn’t work for me. Is there a way to do what i want?

gradle version is 8.1

That advice is for version catalogs, not project accessors.
I guess you can do something like

implementation(projects.base.dependencyProject.subprojects)

or if you are in base anyway, simply

implementation(subprojects)
1 Like

Thank you for your time!