Building my shared code as an XCFramework, which i...
# multiplatform
t
Building my shared code as an XCFramework, which include targets iosArm32, iosArm64, iosX64, watchos, macos, takes 28 minutes! Any tips on ways to speed this up, if any? Do we expect the new front-end compiler might help here?
e
at a high level JB is working on improving K/N build times: https://youtrack.jetbrains.com/issue/KT-42294
but given that the different targets are compiled sequentially (https://youtrack.jetbrains.com/issue/KT-49385), you might have to try building for a smaller set of targets or building each target in a separate checkout (or machine) in parallel
t
Have you turned on gradle cache and parallel builds?
Copy code
org.gradle.caching=true
org.gradle.parallel=true
in gradle.properties
e
Gradle can't run tasks in parallel within the same subproject (except when using configuration cache, which doesn't work with K/N, or when using workers, which K/N doesn't) so that won't help
t
i do sometimes comment out the targets i dont need when building for sim for debugging for example.
the parallel compile option seems like it would be a good solution, then link all when all done.
t
from running a
./gradlew clean build
on my project (which is multi-module) on m1 max:
Copy code
org.gradle.caching=true
org.gradle.parallel=false
5m 30s
Copy code
org.gradle.caching=true
org.gradle.parallel=true
3m 43s I even ran the parallel build first in case there where any cache misses. Seems like it's worth giving a shot and seeing if you have any issues
e
ok sure, parallel does help with multiple modules (which are called projects in Gradle terminology). but within a project (or module in non-Gradle terminology) there is currently no parallelism, and the final framework link will be sequential per target
t
i added those flags and will see how it performs and let you know here. any little bit helps… thanks!
đź‘€ 1