Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 20347

How to enable all optional dependencies for tests

$
0
0

Yes, your code does what I want, but it does not scale well to larger project. For example:

subprojects {
   apply plugin: 'java-library'

   configurations {
      optional
   }
}
project(':sub1') {
   dependencies {
      optional 'org.postgresql:postgresql:42.2.9'
   }
} 
project(':sub2') {
   dependencies {
      implementation project(':sub1')
   }
} 
project(':sub3') {
   dependencies {
      optional 'commons-lang:commons-lang:2.4'
   }
} 
project(':sub4') {
   dependencies {
      implementation project(':sub3')
   }
} 
project(':main') {
   dependencies {
      implementation project(':sub2')
      implementation project(':sub4')
      // ???
   } 
} 

Viewing all articles
Browse latest Browse all 20347

Trending Articles