fix KT-9441 Unable to Access Internal Classes from Test Code within Same Module

#KT-9441 Fixed
This commit is contained in:
Michael Nedzelsky
2015-10-23 12:48:11 +03:00
parent 395c0f12b1
commit 190bab099c
16 changed files with 325 additions and 12 deletions
@@ -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}")
}