With Android Studio 3.0 / android_gradle_version = \'3.0.1\' / gradle-4.5
Let\'s say I have two android modules
module-base
module-a
Actually I find just workaround for this. Don't use test sources from module-base but use sources from test related module module-testutils which is defined like this
dependencies{
testImplementation project(':module-testutils')
}
Thus you can share common test code which will be excluded for non-testable apk.