CocoaPods Gradle plugin DSL reference
Kotlin CocoaPods Gradle plugin is a tool for creating Podspec files. These files are necessary to integrate your Kotlin project with the CocoaPods dependency manager.
This reference contains the complete list of blocks, functions, and properties for the Kotlin CocoaPods Gradle plugin that you can use when working with the CocoaPods integration.
Learn how to set up the environment and configure the Kotlin CocoaPods Gradle plugin.
Depending on your project and purposes, you can add dependencies between a Kotlin project and a Pod library as well as a Kotlin Gradle project and an Xcode project.
Enable the plugin
To apply the CocoaPods plugin, add the following lines to the
The plugin versions match the Kotlin release versions. The latest stable version is 1.8.21.
cocoapods block is the top-level block for the CocoaPods configuration. It contains general information on the Pod, including required information like the Pod version, summary, and homepage, as well as optional features.
You can use the following blocks, functions, and properties inside it:
The version of the Pod. If this is not specified, a Gradle project version is used. If none of these properties are configured, you'll get an error.
A required description of the Pod built from this project.
A required link to the homepage of the Pod built from this project.
Specifies authors of the Pod built from this project.
Configures the existing
Sets up the plugin not to produce a Podspec file for the
The name of the Pod built from this project. If not provided, the project name is used.
The license of the Pod built from this project, its type, and the text.
The framework block configures the framework produced by the plugin.
The location of the Pod built from this project.
Configures other Podspec attributes like
Maps custom Xcode configuration to NativeBuildType: "Debug" to
Configures the output directory for Pod publishing.
Returns a list of Pod dependencies.
Adds a CocoaPods dependency to the Pod built from this project.
Adds a specification repository using
For each target, use the
deploymentTarget property to specify the minimum target version for the Pod library.
When applied, CocoaPods adds both
release frameworks as output binaries for all of the targets.
framework block is nested inside
cocoapods and configures the framework properties of the Pod built from the project.
A required framework name. Use this property instead of the deprecated
Defines the framework linking type. It's dynamic by default.
Enables dependency export.
pod() function call adds a CocoaPods dependency to the Pod built from this project. Each dependency requires a separate function call.
You can specify the name of a Pod library in the function parameters and additional parameter values, like the
source of the library, in its configuration block:
The library version. To use the latest version of the library, omit the parameter.
Configures the Pod from:
Specifies the package name.
Specifies the list of options for a Pod library. For example, specific flags:
extraOpts = listOf("-compiler-option")
Instructs the CocoaPods plugin to use pod dependencies with dynamic frameworks without generating C-interop bindings. If used with static frameworks, the option will remove the Pod dependency entirely.