Skip to content

Commit

Permalink
Allow ignoring KMP default targets (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber authored Jan 5, 2024
1 parent 51fba73 commit 9acc06f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion conventions-plugin/src/main/kotlin/kmp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ fun KotlinMultiplatformExtension.kmpTargets(
webOptions: KmpTarget.WebOptions = project.gradleConventionsKmpDefaultsService.webOptions,
binaryType: BinaryType = project.gradleConventionsKmpDefaultsService.binaryType,
createCommonJsSourceSet: Boolean = project.gradleConventionsKmpDefaultsService.createCommonJsSourceSet,
ignoreDefaultTargets: Boolean = false,
) {
val finalTargets = project.gradleConventionsKmpDefaultsService.targets + setOf(target) + setOf(*targets)
val finalTargets = if(ignoreDefaultTargets) {
setOf(target) + setOf(*targets)
}
else {
project.gradleConventionsKmpDefaultsService.targets + setOf(target) + setOf(*targets)
}

if(finalTargets.isNotEmpty()) {
val isLibraryBrowserTestsEnabled =
Expand Down

0 comments on commit 9acc06f

Please sign in to comment.