[Gradle] Forbid using embedAndSign together with Pod-dependencies

^KT-64096 Verification Pending
This commit is contained in:
Artem Daugel-Dauge
2024-02-17 17:52:23 +09:00
committed by Space Team
parent f5de0f9399
commit 7ab691fcef
4 changed files with 69 additions and 9 deletions
@@ -21,6 +21,8 @@ import org.jetbrains.kotlin.gradle.util.runProcess
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.condition.OS
import org.junit.jupiter.api.io.TempDir
import java.nio.file.Path
import java.util.zip.ZipFile
import kotlin.io.path.*
import kotlin.test.assertContains
@@ -1049,6 +1051,31 @@ class CocoaPodsIT : KGPBaseTest() {
}
}
@DisplayName("Build fails when embedAndSign task is used with pod-dependencies")
@GradleTest
fun testEmbedAndSignNotUsedWithPodDepsDiagnostic(gradleVersion: GradleVersion, @TempDir tempDir: Path) {
nativeProjectWithCocoapodsAndIosAppPodFile(
gradleVersion = gradleVersion,
environmentVariables = EnvironmentalVariables(
"CONFIGURATION" to "debug",
"SDK_NAME" to "iphoneos123",
"ARCHS" to "arm64",
"TARGET_BUILD_DIR" to tempDir.absolutePathString(),
"FRAMEWORKS_FOLDER_PATH" to "frameworks",
"BUILT_PRODUCTS_DIR" to tempDir.absolutePathString(),
)
) {
buildGradleKts.addKotlinBlock("iosArm64()")
buildGradleKts.addCocoapodsBlock("""pod("Base64", version="1.1.2")""")
buildAndFail(":embedAndSignPodAppleFrameworkForXcode") {
assertHasDiagnostic(CocoapodsPluginDiagnostics.EmbedAndSignUsedWithPodDependencies)
}
}
}
private fun TestProject.buildAndFailWithCocoapodsWrapper(
vararg buildArguments: String,
assertions: BuildResult.() -> Unit = {},