I try to specify two different sourcesets of a gradle library and add a sourceset specific dependency in a project.
The idea is to do something like this:
The library build.gradle file:
apply plugin: 'com.android.library'
android {
...
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java {
srcDir 'src'
}
res {
srcDir 'res'
}
}
exclude_fr_it{
manifest.srcFile 'AndroidManifest.xml'
java {
srcDir 'src'
}
res {
srcDir 'res'
exclude 'res/values/values-fr'
exclude 'res/values/values-it'
}
}
}
...
}
...
In the Project A, I want to include the main sourceset:
dependencies {
compile project(':explore_layout')
}
In the Project B, I want to include the build that use sourceset exclude_fr_it.
dependencies {
compile project(':explore_layout') library 'exclude_fr_it'
}
I tried to understand the documentation. But I don't see how this can be done...