improve check for access to internal from tests for projects compiled via gradle

This commit is contained in:
Michael Nedzelsky
2015-11-18 22:34:38 +03:00
parent 5d92d3128d
commit dc7171e953
@@ -100,6 +100,12 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
// Should be SourceDirectorySet or File // Should be SourceDirectorySet or File
val srcDirsSources = HashSet<Any>() val srcDirsSources = HashSet<Any>()
private val testsMap = mapOf(
"compileTestKotlin" to "compileKotlin",
"compileDebugUnitTestKotlin" to "compileDebugKotlin",
"compileReleaseUnitTestKotlin" to "compileReleaseKotlin"
)
override fun populateTargetSpecificArgs(args: K2JVMCompilerArguments) { override fun populateTargetSpecificArgs(args: K2JVMCompilerArguments) {
// show kotlin compiler where to look for java source files // show kotlin compiler where to look for java source files
args.freeArgs = (args.freeArgs + getJavaSourceRoots().map { it.getAbsolutePath() }).toSet().toList() args.freeArgs = (args.freeArgs + getJavaSourceRoots().map { it.getAbsolutePath() }).toSet().toList()
@@ -149,13 +155,10 @@ public open class KotlinCompile() : AbstractKotlinCompile<K2JVMCompilerArguments
} }
} }
if (this.name == "compileTestKotlin") { testsMap.get(this.name)?.let {
addFriendPathForTestTask("compileKotlin") addFriendPathForTestTask(it)
} }
if (this.name == "compileDebugUnitTestKotlin") { 9
addFriendPathForTestTask("compileDebugKotlin")
}
getLogger().kotlinDebug("args.moduleName = ${args.moduleName}") getLogger().kotlinDebug("args.moduleName = ${args.moduleName}")
} }