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
|
@Test
|
||||||
fun testSyncFrameworkMultipleArchitectures() {
|
fun testSyncFrameworkMultipleArchitecturesWithCustomName() {
|
||||||
with(project) {
|
with(project) {
|
||||||
gradleBuildScript().appendToKotlinBlock("iosArm64()")
|
val frameworkName = "customSdk"
|
||||||
gradleBuildScript().appendToKotlinBlock("iosArm32()")
|
gradleBuildScript().appendText(
|
||||||
|
"""
|
||||||
|
|
|
||||||
|
|kotlin {
|
||||||
|
| iosArm64()
|
||||||
|
| iosArm32()
|
||||||
|
| cocoapods {
|
||||||
|
| framework {
|
||||||
|
| baseName = "$frameworkName"
|
||||||
|
| }
|
||||||
|
| }
|
||||||
|
|}
|
||||||
|
""".trimMargin()
|
||||||
|
)
|
||||||
hooks.addHook {
|
hooks.addHook {
|
||||||
// Check that an output framework is a dynamic framework
|
// 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)) {
|
with(runProcess(listOf("file", framework.absolutePath), projectDir)) {
|
||||||
assertTrue(isSuccessful)
|
assertTrue(isSuccessful)
|
||||||
assertTrue(output.contains("\\(for architecture armv7\\):\\s+current ar archive".toRegex()))
|
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) ->
|
fatTargets.forEach { (_, targets) ->
|
||||||
targets.singleOrNull()?.let {
|
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