With new mpp plugin, how to enable both `iosArm64`...
# multiplatform
t
With new mpp plugin, how to enable both
iosArm64
and
iosArm32
in one config? Or probably even all 3 with iosX64.
ok, solved with
Copy code
fromPreset(presets.iosArm64, 'ios64')
        fromPreset(presets.iosArm32, 'ios32')
+
Copy code
ios32Main.dependsOn iosMain
        ios64Main.dependsOn iosMain
but there should be better way
f
Copy code
configure([ios_x64Main, ios_arm64Main]) {
    dependsOn(iosMain)
}
t
just slightly better and doesn't work for me anyway
l
As for the names you’ve used above, for
sourceSets
configuration, it will be indeed like Fabian said with a little fix:
Copy code
configure([ios64Main, ios32Main]) {
    dependsOn iosMain
}
t
Copy code
configure([ios64Main, ios32Main]) {
            dependsOn iosMain
        }
Could not get unknown property 'iosMain' for source set ios64Main of type org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet.
l
Well, I imply that you’ve
iosMain
declared among the other sourceSets, at least like this:
iosMain {}
. Otherwise, why would Gradle create it 🙂
Such a declaration doesn’t make the source set platform specific, unless you have a target named
ios
, though. But I guess you need
iosMain
to be platform-agnostic, so that’s OK
t
@Liliia ic, thanks. Though
Copy code
[ios32Main, ios64Main, iosSimMain].each {
            it.dependsOn iosMain
        }
is still easier imo than
Copy code
iosMain {}
        configure([ios32Main, ios64Main, iosSimMain]) {
            dependsOn iosMain
        }
o
this approach will likely break 😞. See https://github.com/JetBrains/kotlin-mpp-example/pull/13
t
Yes, and that's why I asked for for better solution on this thread and in PR
t
any updates on this? i would like to generate a ‘fat’ framework too, but it is not clear from the above where the commands should go. anybody have a working sample online somewhere? thanks!