Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xorum-io/rekamp
Port of ReKotlin to Kotlin Multiplatform, which corresponds to ReKotlin/1.0.4. Supports JVM, Android, iOS.
https://github.com/xorum-io/rekamp
android ios jvm kotlin kotlin-multiplatform rekotlin swift
Last synced: 22 days ago
JSON representation
Port of ReKotlin to Kotlin Multiplatform, which corresponds to ReKotlin/1.0.4. Supports JVM, Android, iOS.
- Host: GitHub
- URL: https://github.com/xorum-io/rekamp
- Owner: xorum-io
- License: mit
- Created: 2020-04-05T14:03:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-12T10:34:17.000Z (about 1 year ago)
- Last Synced: 2024-10-15T16:02:48.474Z (22 days ago)
- Topics: android, ios, jvm, kotlin, kotlin-multiplatform, rekotlin, swift
- Language: Kotlin
- Homepage:
- Size: 79.1 KB
- Stars: 9
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## ReKamp
[![License MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/ReSwift/ReSwift/blob/master/LICENSE.md)
Port of [ReKotlin](https://github.com/ReKotlin/ReKotlin) to Kotlin Multiplatform, which corresponds to [ReKotlin/1.0.4](https://github.com/ReKotlin/ReKotlin/releases/tag/1.0.4). Supports **JVM**, **Android**, **iOS**.
## Introduction
This is an almost exact copy of [ReKotlin/1.0.4](https://github.com/ReKotlin/ReKotlin/releases/tag/1.0.4) with a few changes to source code and Gradle scripts to support Kotlin Multiplatform.
See official [ReKotlin](https://github.com/ReKotlin/ReKotlin) documentation for examples of usage in JVM / Android projects. Nothing has changed on these platforms. For usage in iOS projects, see the next section.
## Usage on iOS
[Kotlin Multiplatform](https://kotlinlang.org/docs/reference/multiplatform.html) allows the code written in Kotlin to run on any widely-used platforms. In case of iOS, Kotlin is compiled by [Kotlin/Native](https://kotlinlang.org/docs/reference/native-overview.html) to native code, which can be run without JVM.
You can even access libraries used in common Kotlin code from your iOS code written in Obj-C / Swift. There are a few limitation though, which change class / methods namings.
### Library prefix
Even though Swift has namespaces, we can't benefit from them when working with KMP. It happens because shared code is linked trough Obj-C header file.
To prevent collisions of class names from different libraries, Kotlin/Native is adding prefixes to any class name available in library. This prefix is used to be the library name.
In our case, it's `ReKamp` prefix. For example, `StoreSubscriber` becomes `ReKampStoreSubscriber`.
## Download
Add the repository to your project's `build.gradle`
```groovy
repositories {
mavenCentral()
}
```Simply add following in your `commonMain` source set
```groovy
implementation "io.xorum:ReKamp-kotlinMultiplatform:1.0.8"
```Example of usage can be found here: https://github.com/xorum-io/codeforces_watcher/blob/dev/common/build.gradle