diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/cocoapods/KotlinCocoapodsPlugin.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/cocoapods/KotlinCocoapodsPlugin.kt index 887bd2f71d6..172640c6b26 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/cocoapods/KotlinCocoapodsPlugin.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/cocoapods/KotlinCocoapodsPlugin.kt @@ -128,7 +128,7 @@ open class KotlinCocoapodsPlugin: Plugin { interop.packageName = "cocoapods.${pod.moduleName}" project.findProperty(CFLAGS_PROPERTY)?.toString()?.let { args -> - // XCode quotes around paths with spaces. + // Xcode quotes around paths with spaces. // Here and below we need to split such paths taking this into account. interop.compilerOpts.addAll(args.splitQuotedArgs()) } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/CocoapodsTasks.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/CocoapodsTasks.kt index 7dde72610e1..b3d166e67d9 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/CocoapodsTasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/CocoapodsTasks.kt @@ -19,8 +19,10 @@ import java.io.File */ open class PodspecTask : DefaultTask() { + private val specName = project.name.asValidFrameworkName() + @OutputFile - val outputFile: File = project.projectDir.resolve("${project.name}.podspec") + val outputFile: File = project.projectDir.resolve("$specName.podspec") @Nested lateinit var settings: CocoapodsExtension @@ -34,7 +36,6 @@ open class PodspecTask : DefaultTask() { val versionSuffix = if (pod.version != null) ", '${pod.version}'" else "" "| spec.dependency '${pod.name}'$versionSuffix" }.joinToString(separator = "\n") - val specName = project.name.asValidFrameworkName() outputFile.writeText(""" |Pod::Spec.new do |spec| @@ -78,6 +79,16 @@ open class PodspecTask : DefaultTask() { | ] |end """.trimMargin()) + + logger.quiet( + """ + Generated a podspec file at: ${outputFile.absolutePath}. + To include it in your Xcode project, add the following dependency snippet in your Podfile: + + pod '$specName', :path => '${outputFile.parentFile.absolutePath}' + + """.trimIndent() + ) } } @@ -86,7 +97,7 @@ open class PodspecTask : DefaultTask() { * * We represent a Kotlin/Native module to CocoaPods as a vendored framework. * CocoaPods needs access to such frameworks during installation process to obtain - * their type (static or dynamic) and configure the XCode project accordingly. + * their type (static or dynamic) and configure the Xcode project accordingly. * But we cannot build the real framework before installation because it may * depend on CocoaPods libraries which are not downloaded and built at this stage. * So we create a dummy static framework to allow CocoaPods install our pod correctly