commonMain.co.touchlab.skie.phases.other.VerifyMinOSVersionPhase.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-linker-plugin-kgp_2.1.0 Show documentation
Show all versions of kotlin-compiler-linker-plugin-kgp_2.1.0 Show documentation
Kotlin compiler plugin that improves Swift interface of a Kotlin Multiplatform framework.
package co.touchlab.skie.phases.other
import co.touchlab.skie.configuration.SkieConfigurationFlag
import co.touchlab.skie.phases.ClassExportPhase
import co.touchlab.skie.phases.configurables
import co.touchlab.skie.util.version.getMinRequiredOsVersionForSwiftAsync
import co.touchlab.skie.util.version.isLowerVersionThan
object VerifyMinOSVersionPhase : ClassExportPhase {
context(ClassExportPhase.Context)
override fun isActive(): Boolean = SkieConfigurationFlag.Feature_CoroutinesInterop.isEnabled
context(ClassExportPhase.Context)
override suspend fun execute() {
val currentMinVersion = configurables.osVersionMin
val minRequiredVersion = getMinRequiredOsVersionForSwiftAsync(configurables.target.name)
if (currentMinVersion.isLowerVersionThan(minRequiredVersion)) {
error(
"Minimum OS version for ${configurables.target.name} must be at least $minRequiredVersion to support Swift Async. " +
"However, the configured minimum OS version is only $currentMinVersion. " +
"This is most likely a bug in SKIE Gradle plugin which should have set the minimum required version automatically.",
)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy