Fix javaOutputDir changed to the JAR, which was breaking unit tests
internal visibility, because they did not get the JAR into classpath Issue #KT-20212 Fixed (cherry picked from commit 19e861b)
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
|||||||
|
import lib.internalLibFun
|
||||||
|
|
||||||
|
fun main(args: Array<String>) {
|
||||||
|
// check that unit tests can access internals of the main variant:
|
||||||
|
internalLibFun()
|
||||||
|
}
|
||||||
+2
-2
@@ -61,9 +61,9 @@ internal class LegacyAndroidAndroidProjectHandler(kotlinConfigurationTools: Kotl
|
|||||||
createSyncOutputTask(project, kotlinTask, javaTask, kotlinAfterJavaTask, getVariantName(variantData))
|
createSyncOutputTask(project, kotlinTask, javaTask, kotlinAfterJavaTask, getVariantName(variantData))
|
||||||
|
|
||||||
// In lib modules, the androidTest variants get the classes jar in their classpath instead of the Java
|
// In lib modules, the androidTest variants get the classes jar in their classpath instead of the Java
|
||||||
// destination dir. To use it as a friend path, set the jar as the javaOutputDir (see its usages):
|
// destination dir. Attach the JAR to be consumed as friend path:
|
||||||
if (variantData is LibraryVariantData) {
|
if (variantData is LibraryVariantData) {
|
||||||
variantData.dependencyJarOrNull?.let { kotlinTask.javaOutputDir = it }
|
variantData.dependencyJarOrNull?.let { jar -> kotlinTask.attachClassesDir { jar } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user