fix KT-9441 Unable to Access Internal Classes from Test Code within Same Module
#KT-9441 Fixed
This commit is contained in:
+15
@@ -134,6 +134,21 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
|
||||
args.noCallAssertions = kotlinOptions.noCallAssertions
|
||||
args.noParamAssertions = kotlinOptions.noParamAssertions
|
||||
args.moduleName = kotlinOptions.moduleName ?: extraProperties.getOrNull<String>("defaultModuleName")
|
||||
|
||||
if (this.name == "compileTestKotlin") {
|
||||
getLogger().kotlinDebug("try to determine the output directory of corresponding compileKotlin task")
|
||||
val tasks = project.getTasksByName("compileKotlin", false)
|
||||
getLogger().kotlinDebug("tasks for compileKotlin: ${tasks}")
|
||||
if (tasks.size == 1) {
|
||||
val task = tasks.firstOrNull() as? KotlinCompile
|
||||
if (task != null) {
|
||||
getLogger().kotlinDebug("destinantion directory for production = ${task.destinationDir}")
|
||||
args.friendPaths = arrayOf(task.destinationDir.absolutePath)
|
||||
args.moduleName = task.kotlinOptions.moduleName ?: task.extensions.extraProperties.getOrNull<String>("defaultModuleName")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getLogger().kotlinDebug("args.moduleName = ${args.moduleName}")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user