Skip to content

Commit

Permalink
Support multiplatform when android is only JVM target (Kotlin#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Dec 21, 2020
1 parent a043378 commit c4818ad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/kotlin/BinaryCompatibilityValidatorPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ class BinaryCompatibilityValidatorPlugin : Plugin<Project> {
if (project.name in project.rootProject.ignoredProjects()) return@withPlugin
val kotlin = project.extensions.getByName("kotlin") as KotlinMultiplatformExtension
kotlin.targets.matching {
it.platformType == KotlinPlatformType.jvm
it.platformType == KotlinPlatformType.jvm || it.platformType == KotlinPlatformType.androidJvm
}.all { target ->
target.compilations.matching { it.name == "main" }.all {
project.configureKotlinCompilation(it)
if (target.platformType == KotlinPlatformType.jvm) {
target.compilations.matching { it.name == "main" }.all {
project.configureKotlinCompilation(it)
}
} else if (target.platformType == KotlinPlatformType.androidJvm) {
target.compilations.matching { it.name == "release" }.all {
project.configureKotlinCompilation(it, useOutput = true)
}
}
}
}
Expand Down

0 comments on commit c4818ad

Please sign in to comment.