I have 2 modules in my android app. Core module and one feature module. Currently I have 3 dependencies common for these 2 modules and I am adding it in both modules gradle file (Which leads to more app size and redundancy). How to share these dependencies with multiple modules in android.
core module dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api 'com.github.bumptech.glide:glide:4.9.0'
}
feature module dependencies
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//implementation project(':testmodule')
api project(path:':coreModule',configuration: 'default')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
Used api
in core module and used it in feature module using api project(path:':coreModule',configuration: 'default')