All Projects → prof18 → kmp-fatframework-cocoa

prof18 / kmp-fatframework-cocoa

Licence: Apache-2.0 license
A Gradle plugin to generate and publish an iOs FatFramework or XCFramework on Kotlin Multiplatform projects.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to kmp-fatframework-cocoa

KotlinCompilerPluginExample
This is an example project that shows how to create a Kotlin Compiler Plugin. The plugin will print "Hello from" and the name of the file that is being compiled, as a compiler warning to the terminal log.
Stars: ✭ 43 (+65.38%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (+107.69%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+311.54%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
kotlinx-resources
Kotlin Multiplatform (KMP) library for reading resources in tests
Stars: ✭ 15 (-42.31%)
Mutual labels:  gradle-plugin, kotlin-multiplatform
abc-kmm-location
Location Service Manager for Kotlin Multiplatform Mobile iOS and Android
Stars: ✭ 55 (+111.54%)
Mutual labels:  kotlin-multiplatform
WebRTC
Universal WebRTC XCFramework for iOS/macOS. AppRTCDemo for iOS/macOS.
Stars: ✭ 48 (+84.62%)
Mutual labels:  xcframework
gradle-grammar-kit-plugin
Gradle plugin for generating lexers (with JFlex) and BNF parsers (with Grammar-Kit) for IntelliJ language plugins
Stars: ✭ 76 (+192.31%)
Mutual labels:  gradle-plugin
Versionberg
Gradle plugin for versioning your library/application on every git commit
Stars: ✭ 78 (+200%)
Mutual labels:  gradle-plugin
realm-kotlin-samples
Samples demonstrating the usage of Realm-Kotlin SDK
Stars: ✭ 50 (+92.31%)
Mutual labels:  kotlin-multiplatform
PreCompose
Compose Multiplatform Navigation && ViewModel
Stars: ✭ 150 (+476.92%)
Mutual labels:  kotlin-multiplatform
geok
Kotlin geometry library
Stars: ✭ 29 (+11.54%)
Mutual labels:  kotlin-multiplatform
kuberig
Deploy to Kubernetes/OpenShift by leveraging your developer skills - no yaml required!
Stars: ✭ 31 (+19.23%)
Mutual labels:  gradle-plugin
Kodein-Log
Multiplatform lightweight logging library.
Stars: ✭ 25 (-3.85%)
Mutual labels:  kotlin-multiplatform
KMQTT
Embeddable and standalone Kotlin Multiplatform MQTT broker
Stars: ✭ 56 (+115.38%)
Mutual labels:  kotlin-multiplatform
TinyPngPlugin
TinyPng gradle plugin for android
Stars: ✭ 240 (+823.08%)
Mutual labels:  gradle-plugin
kotlin-no-backend
Lista de empresas que utilizam Kotlin no Brasil.
Stars: ✭ 46 (+76.92%)
Mutual labels:  kotlin-multiplatform
dmn-check
A tool which performs static analyses on Decision Model Notation (DMN) files to detect bugs
Stars: ✭ 34 (+30.77%)
Mutual labels:  gradle-plugin
KMP-NativeCoroutines
Library to use Kotlin Coroutines from Swift code in KMP apps
Stars: ✭ 502 (+1830.77%)
Mutual labels:  kotlin-multiplatform
kiwi
Fluent assertions for Kotlin
Stars: ✭ 17 (-34.62%)
Mutual labels:  kotlin-multiplatform
graalvm-native-image-plugin
A Gradle plugin which creates a native executable via GraalVM's native-image. This is a thin wrapper of the native-image command.
Stars: ✭ 90 (+246.15%)
Mutual labels:  gradle-plugin

This plugin has been archived in favour of KMP Framework Bundler. You can find a migration guide here

KMP FatFramework Cocoa

Maven Central License

KMP FatFramework Cocoa is a Gradle plugin for Kotlin Multiplatform projects that generates a FatFramework for iOS targets, or a XCFramework for Apple targets and manages the publishing process in a CocoaPod Repository.

Installation

The library is uploaded on MavenCentral, so you can easily add the dependency on the plugins block:

plugins {
    id("com.prof18.kmp.fatframework.cocoa") version "<latest-version>"
}

Usage

The plugin adds five Gradle tasks to your project.

  • buildDebugIosFatFramework that creates a FatFramework with the Debug target.

  • buildDebugXCFramework that creates a XCFramework with the Debug target.

  • buildReleaseIosFatFramework that creates a FatFramework with the Release target.

  • buildReleaseXCFramework that creates a XCFramework with the Release target.

  • generateCocoaPodRepo that generates a CocoaPod repository ready to host the Framework.

  • publishDebugIosFatFramework that publishes the Debug version of the FatFramework in the CocoaPod repository.

  • publishDebugXCFramework that publishes the Debug version of the XCFramework in the CocoaPod repository.

    The "publishDebug" task (for both the type of frameworks) takes care of everything:

    • changing the working branch from main/master to develop;
    • building the debug framework;
    • updating the version name inside the Podspec file;
    • committing the changes;
    • and publishing to remote.

    In this way, in the iOS project, you can use the latest changes published on the develop branch:

    pod '<your-library-name>', :git => "[email protected]:<git-username>/<repo-name>.git", :branch => 'develop'

    To run this task, the output path provided in the configuration must be a git repository.

  • publishReleaseIosFatFramework that publishes the Release version of the FatFramework in the CocoaPod repository.

  • publishReleaseXCFramework that publishes the Release version of the XCFramework in the CocoaPod repository.

    The "publishRelease" task (for both the type of frameworks) takes care of everything:

    • changing the working branch from develop to main/master;
    • building the release framework;
    • updating the version name inside the Podspec file;
    • committing the changes;
    • tagging the commit;
    • and publishing to remote.

    In this way, in the iOS project, you have to specify a version:

    pod '<your-library-name>', :git => "[email protected]:<git-username>/<repo-name>.git", :tag => '<version-number>'

    To run this task, the output path provided in the configuration must be a git repository.

Configuration

You can configure the plugin with the fatFrameworkCocoaConfig block in your build.gradle[.kts].

The mandatory fields are three:

  • the name of the FatFramework
  • the output path
  • the version name
  • For XCFramework support, you need to set the useXCFramework flag. When the flag is set, only the XCFramework task can be called.
fatFrameworkCocoaConfig {
    frameworkName = "LibraryName"
    outputPath = "$rootDir/../test-dest"
    versionName = "1.0"
    useXCFramework = true
}

When using a FatFramework, only iOS targets can be packed together. With XCFramework you can pack together all the Apple families: iOS, macOS, etc.

If you want to run the generateCocoaPodRepo task to generate a CocoaPod repository, you have to provide the mandatory fields mentioned above and some other parameters in the cocoaPodRepoInfo block:

  • a summary of the library
  • the homepage of the library
  • the license of the library
  • the authors of the library
  • the url of the git repository that hosts the CocoaPod repo.
fatFrameworkCocoaConfig {
    frameworkName = "LibraryName"
    outputPath = "$rootDir/../test-dest"
    versionName = "1.0"

    cocoaPodRepoInfo {
        summary = "This is a test KMP framework"
        homepage = "https://github.com/prof18/ccoca-repo-test"
        license = "Apache"
        authors = "\"Marco Gomiero\" => \"[email protected]\""
        gitUrl = "[email protected]:prof18/ccoca-repo-test.git"
    }
}

Changelog

  • The version 0.2.1 introduce some breaking changes to better support XCFrameworks. Give a look to the 0.2.1 release notes.

Sample Project

To see the plugin in action, I've published a little sample project.

Further Readings

This plugin is born from a set of unbundled Gradle tasks that I was copying between every Kotlin Multiplatform project. I've written about these tasks in an article on my website.

For more info about CocoaPod repo, I suggest reading the following resources:

License

   Copyright 2021 Marco Gomiero

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].