CocoaPods: Use FQ name for the sync task during an Xcode build

This commit is contained in:
Ilya Matveev
2019-03-21 20:35:55 +07:00
parent 0a27699591
commit 7f08ecee39
2 changed files with 5 additions and 2 deletions
@@ -73,7 +73,7 @@ open class KotlinCocoapodsPlugin: Plugin<Project> {
}
private fun Project.createSyncFrameworkTask(originalDirectory: File, buildingTask: Task) =
tasks.create("syncFramework", Sync::class.java) {
tasks.create(SYNC_TASK_NAME, Sync::class.java) {
it.group = TASK_GROUP
it.description = "Copies a framework for given platform and build type into the CocoaPods build directory"
@@ -225,6 +225,7 @@ open class KotlinCocoapodsPlugin: Plugin<Project> {
companion object {
const val EXTENSION_NAME = "cocoapods"
const val TASK_GROUP = "CocoaPods"
const val SYNC_TASK_NAME = "syncFramework"
// We don't move these properties in PropertiesProvider because
// they are not intended to be overridden in local.properties.
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.GENERATE_WRAPPER_PROPERTY
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.KOTLIN_TARGET_FOR_DEVICE
import org.jetbrains.kotlin.gradle.plugin.cocoapods.KotlinCocoapodsPlugin.Companion.SYNC_TASK_NAME
import org.jetbrains.kotlin.gradle.plugin.cocoapods.asValidFrameworkName
import org.jetbrains.kotlin.gradle.plugin.cocoapods.cocoapodsBuildDirs
import java.io.File
@@ -51,6 +52,7 @@ open class PodspecTask : DefaultTask() {
}
val gradleCommand = "\$REPO_ROOT/${gradleWrapper!!.toRelativeString(project.projectDir)}"
val syncTask = "${project.path}:$SYNC_TASK_NAME"
outputFile.writeText("""
@@ -84,7 +86,7 @@ open class PodspecTask : DefaultTask() {
| :script => <<-SCRIPT
| set -ev
| REPO_ROOT="${'$'}PODS_TARGET_SRCROOT"
| "$gradleCommand" -p "${'$'}REPO_ROOT" syncFramework \
| "$gradleCommand" -p "${'$'}REPO_ROOT" $syncTask \
| -P${KotlinCocoapodsPlugin.TARGET_PROPERTY}=${'$'}KOTLIN_TARGET \
| -P${KotlinCocoapodsPlugin.CONFIGURATION_PROPERTY}=${'$'}CONFIGURATION \
| -P${KotlinCocoapodsPlugin.CFLAGS_PROPERTY}="${'$'}OTHER_CFLAGS" \