Custom Artifact Manager
Publishing a Kotlin Xcode dependency requires a place to host the binary. Assuming you need an alternative storage location than one supported by the default implementations, you can implement one yourself.
Create a new implementations of the ArtifactManager interface.
There are two methods to implement:
configure
fun configure(
project: Project,
version: String,
uploadTask: TaskProvider<Task>,
kmmPublishTask: TaskProvider<Task>
)
KMMBridge calls this method during Gradle configuration. project
is the Gradle project. version
is the version defined by Gradle. The task arguments should be used to establish Gradle dependencies with whatever tasks you might register.
To support Gradle configuration cache, be careful to follow the rules with any tasks you create.
deployArtifact
fun deployArtifact(task: Task, zipFilePath: File, version: String): String
This method should physically send the zip file found at zipFilePath
to your storage location. The return value is the URL at which the file can be accessed. Authentication that may be needed by clients to access this URL is configured externally.
The task
parameter is the KMMBridge task that calls this method. It is generally used for things like Gradle logging.
deployArtifact
is called from an executing Gradle task. To support Gradle configuration cache, again, follow the rules.