KT-51861: Apply custom cocoapods framework name to fat framework.
This commit is contained in:
committed by
Space
parent
24220cbfb5
commit
9220d47594
+17
-4
@@ -871,13 +871,26 @@ class CocoaPodsIT : BaseGradleIT() {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSyncFrameworkMultipleArchitectures() {
|
||||
fun testSyncFrameworkMultipleArchitecturesWithCustomName() {
|
||||
with(project) {
|
||||
gradleBuildScript().appendToKotlinBlock("iosArm64()")
|
||||
gradleBuildScript().appendToKotlinBlock("iosArm32()")
|
||||
val frameworkName = "customSdk"
|
||||
gradleBuildScript().appendText(
|
||||
"""
|
||||
|
|
||||
|kotlin {
|
||||
| iosArm64()
|
||||
| iosArm32()
|
||||
| cocoapods {
|
||||
| framework {
|
||||
| baseName = "$frameworkName"
|
||||
| }
|
||||
| }
|
||||
|}
|
||||
""".trimMargin()
|
||||
)
|
||||
hooks.addHook {
|
||||
// Check that an output framework is a dynamic framework
|
||||
val framework = fileInWorkingDir("build/cocoapods/framework/cocoapods.framework/cocoapods")
|
||||
val framework = fileInWorkingDir("build/cocoapods/framework/$frameworkName.framework/$frameworkName")
|
||||
with(runProcess(listOf("file", framework.absolutePath), projectDir)) {
|
||||
assertTrue(isSuccessful)
|
||||
assertTrue(output.contains("\\(for architecture armv7\\):\\s+current ar archive".toRegex()))
|
||||
|
||||
+3
-1
@@ -200,7 +200,9 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
||||
|
||||
fatTargets.forEach { (_, targets) ->
|
||||
targets.singleOrNull()?.let {
|
||||
task.from(it.binaries.getFramework(POD_FRAMEWORK_PREFIX, requestedBuildType))
|
||||
val framework = it.binaries.getFramework(POD_FRAMEWORK_PREFIX, requestedBuildType)
|
||||
task.baseName = framework.baseName //all frameworks should have same names
|
||||
task.from(framework)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user