Set destination to null when module is set in JPS

This fixes the warning "The '-d' option with a directory destination
is ignored because '-module' is specified", when a project imported
from Gradle is built with JPS.

    #KT-17665 fixed
This commit is contained in:
Alexey Tsvetkov
2017-05-28 21:20:28 +03:00
parent 5fbb41bf86
commit b06b18de07
5 changed files with 54 additions and 0 deletions
@@ -915,6 +915,20 @@ class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
buildAllModules().assertSuccessful()
}
fun testCustomDestination() {
loadProject(workDir.absolutePath + File.separator + PROJECT_NAME + ".ipr")
addKotlinRuntimeDependency()
buildAllModules().apply {
assertSuccessful()
val aClass = File(workDir, "customOut/A.class")
assert(aClass.exists()) { "$aClass does not exist!" }
val warnings = getMessages(BuildMessage.Kind.WARNING)
assert(warnings.isEmpty()) { "Unexpected warnings: \n${warnings.joinToString("\n")}" }
}
}
private fun BuildResult.checkErrors() {
val actualErrors = getMessages(BuildMessage.Kind.ERROR)
.map { it as CompilerMessage }