Reputation: 10451
I have a project with several Gradle modules (I think Gradle just calls these sub-projects). Basically I have a bunch of projects/modules listed in settings.gradle
. Is there a Gradle command to print each one (either name or ideally a supplied label/description)
Upvotes: 14
Views: 11220
Reputation: 1202
From within a module's build.gradle.kts, you can use:
rootProject.allprojects.forEach {
println("Project: ${it.name}")
}
Upvotes: 0
Reputation: 29867
Unspectacularly, that task is simply called "projects", and (if you are using the Gradle wrapper) ./gradlew projects
executed at the root project lists all sub-projects.
In general, if you are looking for a task, your chances are good that you can guess its name from the task list shown by ./gradlew tasks
.
Upvotes: 21