dominik.vesely
02/23/2018, 10:18 PMbuild.gradle
I have interop task which creates bindings. But from this point i am lost. I tried to copy .kt file from binding into my common-ios
project which looks good and compiles. until I try to use code from this file. I got an arror about wrong architecture (even though I am pretty sure i got target iphone_sim everywhere) so I am probably doing it in a wrong way. I am new to gradle and kotlin which does not help either 🙂 So can someone point me how to use "objc-framework" in kotlin code which is afterwards compiled into objc framework ?olonho
02/24/2018, 7:18 AMdominik.vesely
02/24/2018, 8:41 AMapply plugin: 'konan'
buildscript {
repositories {
maven {
url "<https://dl.bintray.com/jetbrains/kotlin-native-dependencies>"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:+"
}
}
konan.targets = ['iphone_sim']
konanArtifacts {
def productsDir = new File("/Users/dominik/prace/ios/kotlin-multiplatform/ios/Frameworks")
println(productsDir)
interop("libs") {
defFile "src/main/c_interop/libs.def"
compilerOpts "-F${productsDir}"
linkerOpts "-F${productsDir}"
includeDirs new File(".").getAbsolutePath()
}
framework('ComapLike', targets: ['iphone_sim']) {
srcDir 'src/main/kotlin'
enableMultiplatform true
enableDebug false
}
}
dependencies {
expectedBy project(':common')
}
libraries {
artifact "libs"
}
into framework
part of my gradle i got following build error ld: framework not found TestFramework
which is weird, the TestFramework is the one from .def
from which I successfully created klib in interop
step. So i dont know why it is trying to link this one instead of libs