Hi. Thanks for this, super helpful. I want to know how do I go about adding multiple withouts. For example, here’s a sample where I’m trying to achieve this…
dependencies {
def withoutSupportv4 = { exclude group: 'com.android.support', module: 'support-v4' }
def withoutSupportv13 = { exclude group: 'com.android.support', module: 'support-v13' }
def withoutSupportDesign = { exclude group: 'com.android.support', module: 'design-v13' }
// For Material Datepicker
compile deps.datePicker, withoutSupportv4, withoutSupportv13, withoutSupportDesign
}
Unfortunately, this doesn’t work for me. it works with only the extra one parameter i.e. compile deps.datePicker, withoutSupportv4
but adding more commas fails and I get this error:
Error:(93, 0) Cannot convert the provided notation to an object of type Dependency: build_ey73hh1h8f4tc0h2ljim03u1k$_run_closure2$_closure11@122c5b55.
The following types/formats are supported:
- Instances of Dependency.
- String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
- Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
- FileCollections, for example files('some.jar', 'someOther.jar').
- Projects, for example project(':some:project:path').
- ClassPathNotation, for example gradleApi().
Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.