Update on Marcus's answer:
I donβt know with which version of Gradle / Android Studio, but now it can be done:
Update: publishNonDefault now deprecated and is no longer needed. Just use the configuration below.
### build.gradle library:
android { ... publishNonDefault true }
Build.gradle application:
dependencies { debugCompile project(path: ':baseApp', configuration: 'debug') releaseCompile project(path: ':baseApp', configuration: 'release') }
Changing the build option of one of them in Android Studio will change the build option of the other.
source share