Git Product home page Git Product logo

automattic-tracks-kmm's Introduction

KMM library template focused on integration to existing codebases Build and test

This template is prepared with thought of seamless integration of KMM library to existing, native codebases.

Content

  • Default KMM project created by Android Studio wizard
  • CI workflows based on Github Actions. It builds and tests both Android and iOS variants parallelly
  • Release configuration based on Cocoapods (iOS) and Jitpack (Android)
  • Static code analysis based on Ktlint
  • Automated dependency update via Dependabot and Mergify (optional, only if Mergify is enabled for a repository)

Setup

After creating repository based on this template, several steps are required in order to publish artifacts for further usage in native codebases:

Github

  1. Use this template to create a new repository
  2. Create a second repository for hosting iOS artifact (Cocoapods)

Local machine

  1. Clone repository created from template
  2. Go to shared/build.gradle.kts and update:
  • iosFrameworkName - it's name of the artifact that will be hosted via Cocoapods
  • fatFrameworkCocoaConfig:
    • gitUrl to match Cocoapods repository created in point (2)
    • update other fields at your discretion
  1. Execute ./gradlew generateCocoaPodRepoForIosFatFramework - this will create CocoaPod repository for hosting iOS framework.

How to distribute

Android

Use Jitpack.io - it's that simple.

iOS

This template uses kmp-fatframework-cocoa Gradle Plugin to publish and manage releases to git repository. To read more about why is it needed and how it's done, please refer to great article of the same author - Marco Gomiero (@prof18)

tldr;

  • Run ./gradlew publishIosDebugFatFramework to publish (build & push to repository) the debug version to develop branch (of the seperate, Cocoapods-only repository created in point 2 of How to use section)
  • Run ./gradlew publishIosReleaseFatFramework to do the same but for main/master branch with tag on a commit based on what's in fatFrameworkCocoaConfig

Typical workflow

  1. Write a feature in shared module
  2. Test on sample apps, which are part of this repository
  3. If everything's ok - merge to develop and release debug version of iOS framework.
  4. Test it in existing Android and iOS projects
  5. Iterate or release to iOS framework to production/release channel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.