Is there a way to cause compilation to fail if the...
# ios
p
Is there a way to cause compilation to fail if the deployment target is iOS 12 and the Kotlin native code references a class or method from a later os version? I have tried this with no success, code compiles and the app crashes on launch.
a
If you are using cocoapods integration - the easiest way will be to specify at your podspec
deployment_target
. In original ruby DSL of cocoapods it looks like this -
spec.ios.deployment_target = '13.0'
. In kotlin dsl it is not documented, as far as I can see - https://kotlinlang.org/docs/native-cocoapods.html#add-and-configure-kotlin-cocoapods-gradle-plugin, but when you take look at sources - https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plug[…]ns/kotlin/gradle/targets/native/cocoapods/CocoapodsExtension.kt - you’ll find
PodspecPlatformSettings
responsible for configuring exactly that.
Hope that helps
p
Unfortunately we aren’t using the Cocoapods integration. We have multiple frameworks and shared deps which results in some bad behaviour when xcode starts building the targets in parallel.