All Projects → novemberfiveco → Kotlin Mpp Standard

novemberfiveco / Kotlin Mpp Standard

Licence: mit
A standard setup for Kotlin multiplatform projects.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Kotlin Mpp Standard

Gas Oil Mixture Mobile
Mobile app for calculation of gasoline/oil ratio for 2 stroke engines built with React Native.
Stars: ✭ 61 (-33.7%)
Mutual labels:  android-app, ios-app
Meteor Apollo Starter Kit
Meteor, Apollo, React, PWA, Styled-Components boilerplate
Stars: ✭ 91 (-1.09%)
Mutual labels:  starter-kit, starter-template
Flutter Tetris
a tetris game powered by flutter. 使用flutter开发俄罗斯方块。
Stars: ✭ 1,109 (+1105.43%)
Mutual labels:  android-app, ios-app
Springboard
Spring Boot based production grade starter kit.
Stars: ✭ 59 (-35.87%)
Mutual labels:  starter-kit, maven
Calenstyle
Responsive Drag-&-Drop Event Calendar Library for Web, Mobile Sites, Android, iOS & Windows Phone
Stars: ✭ 83 (-9.78%)
Mutual labels:  android-app, ios-app
Flutter gank
Flutter版 干货集中营
Stars: ✭ 60 (-34.78%)
Mutual labels:  android-app, ios-app
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-19.57%)
Mutual labels:  gradle, maven
Flutter Tasky App
A Flutter Task App
Stars: ✭ 48 (-47.83%)
Mutual labels:  android-app, ios-app
Circleci Orbs
The source code for some of the orbs published by CircleCI
Stars: ✭ 82 (-10.87%)
Mutual labels:  gradle, maven
Phoenix react playground
An example setup for a Phoenix+React project with sensible defaults.
Stars: ✭ 80 (-13.04%)
Mutual labels:  starter-kit, starter-template
Open Source Flutter Apps
📱 List of open source Flutter applications
Stars: ✭ 1,086 (+1080.43%)
Mutual labels:  android-app, ios-app
Slidingtabbar
A custom TabBar view with sliding animation written in Swift.
Stars: ✭ 84 (-8.7%)
Mutual labels:  ios-app, cocoapods
Space Curiosity
All space related agregator, built with Flutter - Spark your curiosity!
Stars: ✭ 56 (-39.13%)
Mutual labels:  android-app, ios-app
Mojilist
🛍 Create shopping lists with emojis!
Stars: ✭ 60 (-34.78%)
Mutual labels:  ios-app, cocoapods
Spring Boot Angular Template
Starter Template to create a OAuth2 secured dockerized Spring Boot 2 Application with Angular 8 Frontend
Stars: ✭ 48 (-47.83%)
Mutual labels:  starter-kit, starter-template
Rust android ios
Android / iOS app with shared Rust logic
Stars: ✭ 69 (-25%)
Mutual labels:  android-app, ios-app
Hellojpro
Stars: ✭ 46 (-50%)
Mutual labels:  gradle, maven
Swiftysampleproject
A starter project for Sample Project in swift 3.0/4.0 (also bridging header included so you could use objective c code in it as well ). For objectiveC version : https://github.com/xeieshan/SampleProject > Supports iOS 8.4+ > Swift 4.x
Stars: ✭ 47 (-48.91%)
Mutual labels:  starter-template, sample
Chatter App
This is a flutter based modern messaging app where users can sign up and log in to chat with their friends, family, colleagues among groups with enriched User-Experience.
Stars: ✭ 80 (-13.04%)
Mutual labels:  android-app, ios-app
Lbrnmeituan
ReactNative 仿美团项目
Stars: ✭ 84 (-8.7%)
Mutual labels:  android-app, ios-app

Kotlin multiplatform standardGitHub license

Kotlin multiplatform standard provides a standard setup for Kotlin multiplatform projects. With this setup, you'll be able to share Kotlin code between Android, JVM and iOS. The code will compile to a platform specific library which you'll be able to distribute via platform specific channels, namely Bintray (Maven) for Android/JVM and CocoaPods for iOS.

Promotional image

Currently outdated

The current version still uses the old (outdated) gradle setup. But don't worry, we're working on a new version which uses the new setup ;)

What's included

  • Compile for Android / iOS / JVM
  • Upload to Bintray / CocoaPods
  • Custom native interop
  • Dokka

Getting started

Get started by cloning/forking this repository and checking out the sample implementations.

Prerequisites

  • Android Studio for Android & shared development
  • Xcode and/or Appcode for iOS specific development
  • A Bintray account in order to host your library (optional)
  • CocoaPods and a private Spec Repository (optional)

Usage

Developing using local sources

We included a sample project for Android (samples/android-app) and iOS (samples/ios-app) which use the local Kotlin sources making them perfect for your library development.

For Android the samples/android-app has a dependency on the local library module. Every time you compile this sample app, you'll be using the latest version of the library.

For iOS it is sufficient to open the Xcode project found in samples/ios-app and building the project. There is a custom build phase run script which will regenerate the MyLibrary.framework file. Note that if you change the name of your library, you will have to change this in the run script as well.

Publishing

If you want to publish your library to Bintray and/or CocoaPods, you'll need to make some changes in library/build.gradle and update the properties to make sure all information matches your specific project and accounts. These properties will be used for both uploading to Bintray and generating a valid Podspec file. For iOS projects, make sure to run pod install in the iOS project folder and open the xcworkspace project.

Publishing your Android/JVM library to Bintray

The easiest way to publish your library on a Maven repository is by using Bintray. Luckily, we already did most of the setup (based on this article) so you'll be able to get started right away!

After creating a Bintray account, you need to add the following properties to your local.properties file in the root of your project:

bintray.user=USERNAME
bintray.apikey=API_KEY

The next step is preparing your setup on Bintray. Create a new Maven repository (or reuse an existing one) and open up library/build.gradle. Fill in the name of your newly created repo as bintrayRepo, update your bintrayOrganisation if you want to use one (or leave blank), and update bintrayName with the name of your library on Bintray. Once you're done with that, you can upload the library using the following command:

./gradlew bintrayUpload

Now your library is published on Bintray, and you can start using it.

Publishing your iOS library to CocoaPods

Creating a Podspec file is required for publishing a library to CocoaPods. In our setup, gradle will automatically make sure the Podspec file is kept up-to-date and running any gradle command (like ./gradlew) will suffice for updating it.

Before uploading the library to CocoaPods, we need to compile our Kotlin sources into a .framework file first. Run the following command in order to compile your framework file:

./gradlew :library:mylibrary-ios:compileKonan

The framework file will be stored in the outputs folder in the root of our repository so CocoaPods will be able to use it later on.

Note: If you prefer, you could simply include the framework file in your iOS project too. We recommend a more separated, versioned approach though.

After generating the framework file, you need to commit/push the file to our git repository. Then you should be able to publish it to a spec repo. But before that, it's best to make sure you didn't make any mistakes. Run the lint command to verify if everything looks ok.

pod spec lint library/ios/MY_LIBRARY.podspec

Note: This command will probably show a note to warn you about the fact that the framework file doesn't include a file for the i386 architecture. This architecture is only used for the 32-bit iOS simulator, all other architectures should work fine.

If everything else looks ok, push your library to your private spec repository via:

pod repo push [repo] library/ios/MY_LIBRARY.podspec

or, push your library to the public spec repository via:

pod trunk push library/ios/MY_LIBRARY.podspec

Great! Now your library is published on CocoaPods and you'll be able to add it to your project via your Podfile.

For more information about making a CocoaPod, see Making a CocoaPod

Documentation

We've included a basic setup of Dokka in the project. The latest release at the moment (0.9.17) doesn't support Kotlin/Native yet, so we only generate Android documentation (which includes all the shared code as well). Simply run ./gradlew dokka to generate documentation. For more advanced configuration, see dokka on GitHub and library/android/build.gradle.

Why Kotlin multiplatform standard over the rest

At November Five, we prefer to work with versioned libraries when sharing code between multiple applications. This way, we can quickly verify and change the versions used in of our applications.

For Kotlin multiplatform, this allows us to make sure both platforms are using the exact same version of our codebase. There are a few other Kotlin multiplatform templates available on GitHub, but for us, they had two problems:

  1. They required using a single repository for both the Android and iOS application. We were already using two separate repositories (one for each platform) and merging them would create a lot of issues in our workflow.
  2. None of them had the required setup for hosting the code on a Maven or CocoaPods repository.

Stability

This software is considered Beta. It has been thoroughly tested internally at November Five but not yet used in any live products.

Roadmap

Currently the following releases are planned:

Kotlin multiplatform standard 0.2.0 (Q4 2018)

  • Update the gradle setup to use the upcoming Kotlin Multiplatform project model. We'll probably do this once a stable version of the new kotlin-multiplatform plugin has been released.

Contact

This project is maintained by Arne Stockmans & Vincent de Smet.

Additional information about the project can be found in this blog post.

Got any questions or ideas? We'd love to hear from you. Check out our contributing guidelines for ways to offer feedback and contribute.

License

Copyright (c) November Five BVBA. All rights reserved.

Licensed under the MIT 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].