11apply plugin : ' kotlin-multiplatform'
22
3+
34kotlin {
45 targets {
5- fromPreset(presets . jvm, ' android ' )
6+ def iOSTarget = System . getenv( ' SDK_NAME ' ) ?. startsWith( " iphoneos " ) ? presets . iosArm64 : presets . iosX64
67
7- fromPreset(presets . iosArm64 , ' iOS' ) {
8+ fromPreset(iOSTarget , ' iOS' ) {
89 compilations. main. outputKinds(' FRAMEWORK' )
910 }
1011
11- fromPreset(presets. iosX64, ' iOSx64' ) {
12- compilations. main. outputKinds(' FRAMEWORK' )
13- }
12+ fromPreset(presets. jvm, ' android' )
1413 }
1514
1615 sourceSets {
@@ -21,8 +20,6 @@ kotlin {
2120 androidMain. dependencies {
2221 api ' org.jetbrains.kotlin:kotlin-stdlib'
2322 }
24-
25- iOSx64Main. dependsOn iOSMain
2623 }
2724}
2825
@@ -33,13 +30,11 @@ configurations {
3330task packForXCode (type : Sync ) {
3431 final File frameworkDir = new File (buildDir, " xcode-frameworks" )
3532 final String mode = System . getenv(' CONFIGURATION' )?. toUpperCase() ?: ' DEBUG'
36- final String target = System . getenv(' SDK_NAME' )?. startsWith(" iphoneos" ) ? ' iOS' : ' iOSx64'
3733
38- inputs. property " target" , target
3934 inputs. property " mode" , mode
40- dependsOn kotlin. targets. " $t arget " . compilations. main. linkTaskName(" FRAMEWORK" , mode)
35+ dependsOn kotlin. targets. iOS . compilations. main. linkTaskName(" FRAMEWORK" , mode)
4136
42- from { kotlin. targets. " $t arget " . compilations. main. getBinary(" FRAMEWORK" , mode). parentFile }
37+ from { kotlin. targets. iOS . compilations. main. getBinary(" FRAMEWORK" , mode). parentFile }
4338 into frameworkDir
4439
4540 doLast {
0 commit comments