diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt index 6e371f6e4de..944ed4380cd 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt @@ -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 } diff --git a/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt b/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt index a5f50fcdab2..ae6a95339fc 100644 --- a/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt +++ b/jps-plugin/src/org/jetbrains/kotlin/compilerRunner/JpsKotlinCompilerRunner.kt @@ -198,6 +198,7 @@ class JpsKotlinCompilerRunner : KotlinCompilerRunner() { private fun setupK2JvmArguments(moduleFile: File, settings: K2JVMCompilerArguments) { with(settings) { module = moduleFile.absolutePath + destination = null noStdlib = true noReflect = true noJdk = true diff --git a/jps-plugin/testData/general/CustomDestination/kotlinProject.iml b/jps-plugin/testData/general/CustomDestination/kotlinProject.iml new file mode 100644 index 00000000000..6d20898bff3 --- /dev/null +++ b/jps-plugin/testData/general/CustomDestination/kotlinProject.iml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/CustomDestination/kotlinProject.ipr b/jps-plugin/testData/general/CustomDestination/kotlinProject.ipr new file mode 100644 index 00000000000..90747786771 --- /dev/null +++ b/jps-plugin/testData/general/CustomDestination/kotlinProject.ipr @@ -0,0 +1,14 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/jps-plugin/testData/general/CustomDestination/src/A.kt b/jps-plugin/testData/general/CustomDestination/src/A.kt new file mode 100644 index 00000000000..fb7337ede5b --- /dev/null +++ b/jps-plugin/testData/general/CustomDestination/src/A.kt @@ -0,0 +1 @@ +class A \ No newline at end of file