Marc Reichelt
03/22/2022, 1:05 PMXCFramework
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?Marc Reichelt
03/22/2022, 1:06 PM------------------------------------------------------------
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 *
...
Marc Reichelt
03/22/2022, 1:07 PMbuild.gradle.kts
is set up this way:
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)
}
}
}
}
}
hfhbd
03/22/2022, 1:07 PMMarc Reichelt
03/22/2022, 1:13 PMhfhbd
03/22/2022, 1:15 PM