Make withJava() safe to call repeatedlt on same target

This commit is contained in:
Sergey Igushkin
2019-05-29 01:05:43 +03:00
parent 9a4596eaba
commit 25371734e8
2 changed files with 6 additions and 1 deletions
@@ -31,6 +31,9 @@ class KotlinJvmTarget(
@Suppress("unused") // user DSL
fun withJava() {
if (withJavaEnabled)
return
project.multiplatformExtension.targets.find { it is KotlinJvmTarget && it.withJavaEnabled }
?.let { existingJavaTarget ->
throw InvalidUserCodeException(