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
When I want to access sources from module-base in module-a , I just need to write this in my module-a.gradle
dependencies {
implementation project(path: ':module-base')
}
But, what if I want to access test sources from module-base in test of module-a? Here does not work approach like above
dependencies {
testImplementation project(path: ':module-base')
}
I found lot of advices (few years old) which says something like
compileTestJava.dependsOn tasks.getByPath(':module-base:testClasses')
testCompile files(project(':module-base').sourceSets.test.output.classesDir)
or
testCompile project(':module-base).sourceSets.test.classes
But no one from mentioned works. There is always something wrong from the compiler point of view :-/
Can you someone help me how to create Android test code dependency between two modules?