Dmitry Motyl
04/16/2019, 11:56 AMKris Wong
04/16/2019, 12:59 PMh0tk3y
04/16/2019, 1:16 PMilya.matveev
04/16/2019, 1:17 PMiosX64("iOS") {
binaries.getFramework("RELEASE").export(project(":exported"))
}
Kris Wong
04/16/2019, 1:23 PMilya.matveev
04/16/2019, 1:27 PMDmitry Motyl
04/16/2019, 1:29 PMDmitry Motyl
04/16/2019, 1:32 PMilya.matveev
04/16/2019, 1:32 PMthis code tries to create new one framework@Dmitry Motyl It shouldn't. Could you share a link to your buildscript?
Dmitry Motyl
04/16/2019, 1:35 PMapply plugin: 'kotlin-multiplatform'
apply plugin: 'kotlin-native-cocoapods'
version = "1.0"
kotlin {
targets {
fromPreset(presets.jvm, 'android')
}
sourceSets {
commonMain.dependencies {
api project(':domain')
api project(':networking')
}
}
iosX64("ios").binaries {
framework {
export project(':domain')
export project(':networking')
}
}
cocoapods {
summary = "..."
homepage = "..."
}
}
Dmitry Motyl
04/16/2019, 1:36 PMCannot create binary debugFramework: binary with such a name already exists
Dmitry Motyl
04/16/2019, 1:38 PMiosX64("ios").binaries {
framework("shared") {
export project(':domain')
export project(':networking')
}
}
It creates new one framework but cocoapods dependency export original framework without ‘domain’ and ‘networking’Kris Wong
04/16/2019, 1:41 PMiosX64("ios") {
compilations.main {
cinterops {
phonenumbers
}
}
binaries {
framework("$ios_framework_name")
}
}
Kris Wong
04/16/2019, 1:42 PMKris Wong
04/16/2019, 1:43 PMilya.matveev
04/17/2019, 6:03 AMframework()
call does create a new framework. To configure already existing one, use the getFramework()
method I've shown above.ilya.matveev
04/17/2019, 6:14 AMDmitry Motyl
04/17/2019, 7:47 AMilya.matveev
04/17/2019, 9:26 AMconfigure
method:
linuxX64("linux") {
binaries {
val release = getExecutable("RELEASE")
val debug = getExecutable("DEBUG")
configure(listOf(release, debug)) {
/* Configuration. */
}
}
}
Kris Wong
04/17/2019, 1:02 PMvendored_frameworks
within the generated podspec to export the framework binaryKris Wong
04/17/2019, 1:02 PMilya.matveev
04/18/2019, 6:00 AMExporting dependencies in frameworks
section). It's technically possible to export Kotlin declarations produced by cinterop for a native library too but such an export doesn't make much sense.
While you mean exporting a native framework in terms of CocoaPods by adding it to vendored_frameworks
. The plugin doesn't provide such a DSL but you alway can post process the podspec file generated by the plugin.
You can write your own task that modifies the vendored_frameworks
field and register it as a finalizer for the podspec
task (see https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:finalizer_tasks).