Skip to content

Commit

Permalink
Warn if SKIE is applied in a module without frameworks.
Browse files Browse the repository at this point in the history
  • Loading branch information
TadeasKriz committed Sep 4, 2023
1 parent 164ee06 commit f6ba2e7
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ abstract class SkieGradlePlugin : Plugin<Project> {
return
}

warnOnEmptyFrameworks()

FatFrameworkConfigurator.configureSkieForFatFrameworks(project)

configureEachKotlinFrameworkLinkTask {
Expand Down Expand Up @@ -80,6 +82,13 @@ abstract class SkieGradlePlugin : Plugin<Project> {
}
}

internal fun Project.warnOnEmptyFrameworks() {
val hasFrameworks = extensions.findByType(KotlinMultiplatformExtension::class.java)?.appleTargets?.any { it.frameworks.isNotEmpty() } ?: false
if (!hasFrameworks) {
logger.warn("w: No Apple frameworks configured. Make sure you applied SKIE plugin in the correct module.")
}
}

internal fun Project.configureEachKotlinFrameworkLinkTask(
configure: KotlinNativeLink.() -> Unit,
) {
Expand Down

0 comments on commit f6ba2e7

Please sign in to comment.