isobretatel
isobretatel

Reputation: 3930

How can I add dependency on subproject programmatically in Gradle?

I have project with 20+ subprojects:

war {
    dependencies {
        runtime project(':project1')
        runtime project(':project2')
...
        runtime project(':project20')
    }

I would like to avoid duplication of project names here and in settings.gradle. How can I add dependencies on subprojects programmatically?

Upvotes: 0

Views: 440

Answers (1)

Vampire
Vampire

Reputation: 38629

You mean like this?

war {
    dependencies {
        subprojects.each { runtime it }
    }
}

Upvotes: 1

Related Questions