Hi there! We’re using the `XCFramework` task in G...
# multiplatform
m
Hi there! We’re using the
XCFramework
task in Gradle to create a framework containing all 3 archs (x86 sim, arm64 sim, arm64 device) using Kotlin 1.6.10. However, when we run
./gradlew :assembleReleaseXCFramework
, it’s compiling the 3 archs sequentially rather than in parallel. Did anyone find a good way to speed this up by running these sequentially?
Task tree for `assembleReleaseXCFramework`:
Copy code
------------------------------------------------------------
Root project 'SharedCode'
------------------------------------------------------------

:assembleReleaseXCFramework
+--- :assembleSharedCodeReleaseIosFatFrameworkForXCFramework
|    \--- :linkReleaseFrameworkIosArm64
|         +--- :compileKotlinIosArm64
|         |    +--- :Module1:compileKotlinIosArm64
|         |    +--- :Module2:compileKotlinIosArm64
|         |    +--- :Module3:compileKotlinIosArm64
|         |    \--- :Module4:compileKotlinIosArm64
|         +--- :Module1:compileKotlinIosArm64 *
|         +--- :Module2:compileKotlinIosArm64 *
|         +--- :Module3:compileKotlinIosArm64 *
|         \--- :Module4:compileKotlinIosArm64 *
+--- :assembleSharedCodeReleaseIosSimulatorFatFrameworkForXCFramework
|    +--- :linkReleaseFrameworkIosSimulatorArm64
|    |    +--- :compileKotlinIosSimulatorArm64
|    |    |    +--- :Module1:compileKotlinIosSimulatorArm64
|    |    |    +--- :Module2:compileKotlinIosSimulatorArm64
|    |    |    +--- :Module3:compileKotlinIosSimulatorArm64
|    |    |    \--- :Module4:compileKotlinIosSimulatorArm64
|    |    +--- :Module1:compileKotlinIosSimulatorArm64 *
|    |    +--- :Module2:compileKotlinIosSimulatorArm64 *
|    |    +--- :Module3:compileKotlinIosSimulatorArm64 *
|    |    \--- :Module4:compileKotlinIosSimulatorArm64 *
|    \--- :linkReleaseFrameworkIosX64
|         +--- :compileKotlinIosX64
|         |    +--- :Module1:compileKotlinIosX64
|         |    +--- :Module2:compileKotlinIosX64
|         |    +--- :Module3:compileKotlinIosX64
|         |    \--- :Module4:compileKotlinIosX64
|         +--- :Module1:compileKotlinIosX64 *
|         +--- :Module2:compileKotlinIosX64 *
|         +--- :Module3:compileKotlinIosX64 *
|         \--- :Module4:compileKotlinIosX64 *
...
Our
build.gradle.kts
is set up this way:
Copy code
kotlin {
    val projectsToExportForIos = listOf(/* projects */)

    val xcFramework = XCFramework()
    configure(
        listOf(
            iosArm64("iosArm64"),
            iosX64("iosX64"),
            iosSimulatorArm64("iosSimulatorArm64"),
        )
    ) {
        binaries.framework {
            baseName = frameworkName
            xcFramework.add(this)
            projectsToExportForIos.forEach { project ->
                export(project)
            }
        }
    }

    sourceSets {
        val commonMain by getting {
            dependencies {
                projectsToExportForIos.forEach { project ->
                    api(project)
                }
            }
        }
    }
}
m
Thanks, so it seems this is a known issue already. If any open source contributions are needed, where would be a good place to start?
h
Sorry, I don't know. I would ask it in the tickets, or ask @tapchicoma directly
👍 1