[Gradle] Don't depend on generated podspec in synthetic podInstall task
^KT-63331 Verification Pending
This commit is contained in:
committed by
Space Team
parent
be5a27dd6b
commit
4df73551c7
+34
@@ -65,6 +65,23 @@ class CocoaPodsIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DisplayName("Pod import single noPodspec")
|
||||||
|
@GradleTest
|
||||||
|
fun testPodImportSingleNoPodspec(gradleVersion: GradleVersion) {
|
||||||
|
nativeProjectWithCocoapodsAndIosAppPodFile(cocoapodsSingleKtPod, gradleVersion) {
|
||||||
|
|
||||||
|
buildGradleKts.addCocoapodsBlock("noPodspec()")
|
||||||
|
|
||||||
|
buildWithCocoapodsWrapper(podImportTaskName) {
|
||||||
|
podImportAsserts(buildGradleKts)
|
||||||
|
}
|
||||||
|
|
||||||
|
buildWithCocoapodsWrapper(":kotlin-library:podImport") {
|
||||||
|
podImportAsserts(subProject("kotlin-library").buildGradleKts, "kotlin-library")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@DisplayName("Pod import multiple")
|
@DisplayName("Pod import multiple")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testPodImportMultiple(gradleVersion: GradleVersion) {
|
fun testPodImportMultiple(gradleVersion: GradleVersion) {
|
||||||
@@ -732,6 +749,23 @@ class CocoaPodsIT : KGPBaseTest() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DisplayName("Add pod-dependencies together with noPodspec")
|
||||||
|
@GradleTest
|
||||||
|
fun testPodDependenciesWithNoPodspec(gradleVersion: GradleVersion) {
|
||||||
|
nativeProjectWithCocoapodsAndIosAppPodFile(gradleVersion = gradleVersion) {
|
||||||
|
buildGradleKts.addCocoapodsBlock(
|
||||||
|
"""
|
||||||
|
noPodspec()
|
||||||
|
|
||||||
|
pod("Base64", version = "1.1.2")
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
buildWithCocoapodsWrapper(":linkPodDebugFrameworkIOS") {
|
||||||
|
assertFileInProjectNotExists("cocoapods.podspec")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@DisplayName("Hierarchy of dependant pods compiles successfully")
|
@DisplayName("Hierarchy of dependant pods compiles successfully")
|
||||||
@GradleTest
|
@GradleTest
|
||||||
fun testHierarchyOfDependantPodsCompilesSuccessfully(gradleVersion: GradleVersion) {
|
fun testHierarchyOfDependantPodsCompilesSuccessfully(gradleVersion: GradleVersion) {
|
||||||
|
|||||||
+1
-2
@@ -489,6 +489,7 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
|||||||
task.group = TASK_GROUP
|
task.group = TASK_GROUP
|
||||||
task.description = "Invokes `pod install` call within Podfile location directory"
|
task.description = "Invokes `pod install` call within Podfile location directory"
|
||||||
task.podfile.set(project.provider { cocoapodsExtension.podfile })
|
task.podfile.set(project.provider { cocoapodsExtension.podfile })
|
||||||
|
@Suppress("DEPRECATION") // is set for compatibility reasons
|
||||||
task.podspec.set(podspecTaskProvider.map { it.outputFile })
|
task.podspec.set(podspecTaskProvider.map { it.outputFile })
|
||||||
task.useStaticFramework.set(cocoapodsExtension.podFrameworkIsStatic)
|
task.useStaticFramework.set(cocoapodsExtension.podFrameworkIsStatic)
|
||||||
task.frameworkName.set(cocoapodsExtension.podFrameworkName)
|
task.frameworkName.set(cocoapodsExtension.podFrameworkName)
|
||||||
@@ -504,7 +505,6 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
|||||||
) {
|
) {
|
||||||
val families = mutableSetOf<Family>()
|
val families = mutableSetOf<Family>()
|
||||||
|
|
||||||
val podspecTaskProvider = project.tasks.named<PodspecTask>(POD_SPEC_TASK_NAME)
|
|
||||||
kotlinExtension.supportedTargets().all { target ->
|
kotlinExtension.supportedTargets().all { target ->
|
||||||
val family = target.konanTarget.family
|
val family = target.konanTarget.family
|
||||||
if (family in families) {
|
if (family in families) {
|
||||||
@@ -524,7 +524,6 @@ open class KotlinCocoapodsPlugin : Plugin<Project> {
|
|||||||
|
|
||||||
val podGenTask = project.registerTask<PodGenTask>(family.toPodGenTaskName) { task ->
|
val podGenTask = project.registerTask<PodGenTask>(family.toPodGenTaskName) { task ->
|
||||||
task.description = "Сreates a synthetic Xcode project to retrieve CocoaPods dependencies"
|
task.description = "Сreates a synthetic Xcode project to retrieve CocoaPods dependencies"
|
||||||
task.podspec.set(podspecTaskProvider.map { it.outputFile })
|
|
||||||
task.podName.set(project.provider { cocoapodsExtension.name })
|
task.podName.set(project.provider { cocoapodsExtension.name })
|
||||||
task.specRepos.set(project.provider { cocoapodsExtension.specRepos })
|
task.specRepos.set(project.provider { cocoapodsExtension.specRepos })
|
||||||
task.family.set(family)
|
task.family.set(family)
|
||||||
|
|||||||
-4
@@ -35,10 +35,6 @@ abstract class PodGenTask @Inject constructor(projectLayout: ProjectLayout) : Co
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
|
||||||
@get:InputFile
|
|
||||||
internal abstract val podspec: Property<File>
|
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
internal abstract val podName: Property<String>
|
internal abstract val podName: Property<String>
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -20,9 +20,8 @@ import java.io.File
|
|||||||
@DisableCachingByDefault
|
@DisableCachingByDefault
|
||||||
abstract class PodInstallTask : AbstractPodInstallTask() {
|
abstract class PodInstallTask : AbstractPodInstallTask() {
|
||||||
|
|
||||||
@get:PathSensitive(PathSensitivity.RELATIVE)
|
@Deprecated("Use PodspecTask#outputFile")
|
||||||
@get:Optional
|
@get:Internal
|
||||||
@get:InputFile
|
|
||||||
abstract val podspec: Property<File?>
|
abstract val podspec: Property<File?>
|
||||||
|
|
||||||
@get:Input
|
@get:Input
|
||||||
|
|||||||
Reference in New Issue
Block a user