Skip to content

Commit

Permalink
Hot fix integration with cocoapods (#4628)
Browse files Browse the repository at this point in the history
Get the cocoapods extension from the kotlin instead project object and
configure task dependency lazy
  • Loading branch information
terrakok committed Apr 16, 2024
1 parent f0c1094 commit 331aec0
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -2,6 +2,7 @@ package org.jetbrains.compose.resources

import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.plugins.ExtensionAware
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.Copy
import org.jetbrains.compose.desktop.application.internal.ComposeProperties
Expand Down Expand Up @@ -54,7 +55,11 @@ internal fun Project.configureSyncIosComposeResources(
"embedAndSign${frameworkClassifier}AppleFrameworkForXcode"
}

project.tasks.named(externalTaskName).dependsOn(syncComposeResourcesTask)
project.tasks.configureEach { task ->
if (task.name == externalTaskName) {
task.dependsOn(syncComposeResourcesTask)
}
}
}

nativeTarget.binaries.withType(TestExecutable::class.java).all { testExec ->
Expand All @@ -74,7 +79,7 @@ internal fun Project.configureSyncIosComposeResources(
}

plugins.withId(COCOAPODS_PLUGIN_ID) {
project.extensions.getByType(CocoapodsExtension::class.java).apply {
(kotlinExtension as ExtensionAware).extensions.getByType(CocoapodsExtension::class.java).apply {
framework { podFramework ->
val syncDir = podFramework.getFinalResourcesDir().get().asFile.relativeTo(projectDir)
val specAttr = "['${syncDir.path}']"
Expand Down

0 comments on commit 331aec0

Please sign in to comment.