11import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
2+ import org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType
3+ import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
24
35plugins {
46 id(" com.android.library" )
@@ -8,25 +10,16 @@ plugins {
810}
911
1012kotlin {
11- val iOSTarget = if (System .getenv(" SDK_NAME" )
12- ?.startsWith(" iphoneos" ) == true
13- ) presets.getByName(" iosArm64" ) else presets.getByName(" iosX64" )
14-
1513 android {
1614 publishLibraryVariants(" debug" )
1715 }
18- val onPhone = System .getenv(" SDK_NAME" )?.startsWith(" iphoneos" ) ? : false
19- if (onPhone) {
20- iosArm64(" ios" ) {
21- binaries.framework(listOf (org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType .DEBUG ))
22-
23- }
24- } else {
25- iosX64(" ios" ) {
26- binaries.framework(listOf (org.jetbrains.kotlin.gradle.plugin.mpp.NativeBuildType .DEBUG ))
27-
16+ val xcFramework = XCFramework ()
17+ ios {
18+ binaries.framework(listOf (NativeBuildType .RELEASE )) {
19+ xcFramework.add(this )
2820 }
2921 }
22+
3023 cocoapods {
3124 framework {
3225 summary = " Cross Platform Testing"
@@ -95,9 +88,9 @@ val installTestPods by tasks.creating(Exec::class.java) {
9588
9689
9790val runIos by tasks.creating(Exec ::class .java) {
98- val linkDebugFrameworkIos = tasks.findByName(" linkDebugFrameworkIos " )
99- dependsOn(" linkDebugFrameworkIos " )
100- linkDebugFrameworkIos ?.dependsOn(installTestPods)
91+ val linkReleaseFrameworkIos = tasks.findByName(" linkReleaseFrameworkIosX64 " )
92+ dependsOn(linkReleaseFrameworkIos )
93+ linkReleaseFrameworkIos ?.dependsOn(installTestPods)
10194 installTestPods.dependsOn(" podImport" )
10295 description = " Builds the iOS application bundle using Xcode."
10396 workingDir = project.file(" helpers/XCodeTest" )
0 commit comments