Closed cckroets closed 4 years ago
Hi @cckroets, Could you explain how
Now there can be a single unmocking module that is included by all other modules.
would work exactly, please? I tried to set up a single module but couldn't get it working... Any tips would be much appreciated :)
E.g. would I still need to apply unmock plugin in each module?
@zawadz88 Sorry for the late reply. You should only need to apply the unMock plugin to the lower "test-library" module.
E.g. feature-lib
and test-utils
are two gradle modules.
In feature-lib
add a dependency on the test utils module
// feature-lib/build.gradle
apply plugin: 'com.android.library'
dependencies {
testImplementation project(':test-utils')
}
In test-utils
apply the unMock plugin
// test-utils/build.gradle
apply plugin: 'com.android.library'
apply plugin: 'de.mobilej.unmock'
unMock {
// keep ...
includeInVariants android.libraryVariants
}
Let me know if you are getting a specific error with that setup
Previously unmocked classes were added to the testImplementation configuration of each module that needed them. This leads to duplicate work being done by every module that has unit tests. Now there can be a single unmocking module that is included by all other modules.
Usage: