Skip to content

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.

License

Notifications You must be signed in to change notification settings

dayanruben/realm-kotlin

Repository files navigation

Realm

License

Realm is a mobile database that runs directly inside phones, tablets or wearables. This repository holds the source code for the Kotlin version of Realm, which runs on Kotlin Multiplatform and Android.

How to build:

Prerequisits

  • Swig. On Mac this can be installed using Homebrew: brew install swig.

Commands to build

git submodule update --init --recursive
cd test
./gradlew assemble

In Android Studio open the test project, which will open also the realm-library and the compiler projects

Using Snapshots

If you want to test recent bugfixes or features that have not been packaged in an official release yet, you can use a -SNAPSHOT release of the current development version of Realm via Gradle, available on JFrog OSS

// Global build.gradle
buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
        }
        maven {
            url 'https://dl.bintray.com/kotlin/kotlin-dev'
        }
    }
    dependencies {
        classpath 'io.realm.kotlin:plugin-gradle:<VERSION>'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'
        }
        maven {
            url 'https://dl.bintray.com/kotlin/kotlin-dev'
        }
    }
}

See Config.kt for the latest version number.

Repository Guidelines

Code Style

We use the offical style guide from Kotlin which is enforced using ktlint and detekt.

# Call from root folder to check if code is compliant.
./gradlew ktlintCheck
./gradlew detekt

# Call from root folder to automatically format all Kotlin code according to the code style rules.
./gradlew ktlintFormat

Note: ktlint does not allow group imports using .*. You can configure IntelliJ to disallow this by going to preferences Editor > Code Style > Kotlin > Imports and select "Use single name imports".

Defining dependencies

All dependency versions and other constants we might want to share between projects are defined inside the file buildSrc/src/main/kotlin/Config.kt. Any new dependencies should be added to this file as well, so we only have one location for these.

Samples

Kotlin Multiplatform Sample

The folder examples/kmm-sample contains an example showing how to use Realm in a multiplatform project, sharing code for using Realm in the shared module. The project is based on https://github.com/Kotlin/kmm-sample.

About

Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 96.1%
  • C++ 2.7%
  • SWIG 0.5%
  • Shell 0.5%
  • C 0.1%
  • CMake 0.1%