realm / realm-kotlin

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
Apache License 2.0
906 stars 52 forks source link

Support generating Release Apple Frameworks #142

Closed nhachicha closed 3 years ago

nhachicha commented 3 years ago

Currently capiMacosUniversal and capiIosArm64 tasks are using debug Monorepo builds

maybe we can use

val framework = kotlin.targets.getByName<org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget>("ios").binaries.getFramework("CONFIGURATION")
 framework.buildType == NativeBuildType.RELEASE

To figure out if XCode is trying to use the build phase script (which runs the Gradle {{packForXcode }} task) to build a Release framework. This is generally set via the CONFIGURATION flag from XCode

cmelchior commented 3 years ago

I ran into this. It means that if you just do

cd examples/kmm-sample
./gradlew assemble

It will fail with the

> Task :shared:linkReleaseFrameworkIosArm64
w: duplicate library name: io.realm.kotlin:cinterop-cinterop-realm_wrapper
e: Compilation failed: null
 * Source files:
 * Compiler version info: Konan: 1.4.30 / Kotlin: 1.4.30
 * Output kind: FRAMEWORK
e: java.lang.NullPointerException

Using

./gradlew assembleDebug

Will work.

sync-by-unito[bot] commented 3 years ago

➤ Nabil Hachicha commented:

Blocked by https://youtrack.jetbrains.com/issue/KT-47390