├── .githooks └── pre-push ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ ├── config.yml │ └── feature.yml ├── actions │ └── run-android-device-farm-test │ │ └── action.yml ├── advanced-issue-labeler.yml ├── auto_assign.yml ├── no-response.yml ├── problem-matchers │ ├── detekt.json │ ├── kotlin.json │ └── ktlint.json └── workflows │ ├── Issue-Needs-Attention.yml │ ├── auto-assign.yml │ ├── auto-merge-branches.yml │ ├── check-changelog.yml │ ├── check-pr-title.yml │ ├── include-check-cache.yml │ ├── include-deploy-release.yml │ ├── include-deploy-snapshot.yml │ ├── include-integration-tests.yml │ ├── include-static-analysis.yml │ ├── issue-labeler.yml │ ├── lock-threads.yml │ ├── no-response.yml │ └── pr.yml ├── .gitignore ├── .gitmodules ├── CHANGELOG.md ├── CONTRIBUTING.md ├── GHA_README.md ├── LICENSE ├── README.md ├── benchmarks ├── README.md ├── androidApp │ ├── benchmark-proguard-rules.pro │ ├── build.gradle.kts │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── benchmarks │ │ │ └── android │ │ │ ├── AccessorTests.kt │ │ │ ├── BulkWriteTests.kt │ │ │ └── OpenRealmTests.kt │ │ └── main │ │ └── AndroidManifest.xml ├── benchmark-data │ ├── android │ │ ├── io.realm.kotlin.benchmarks.android.test-benchmarkData-run1.json │ │ └── io.realm.kotlin.benchmarks.android.test-benchmarkData-run2.json │ └── jvm │ │ ├── benchmarks-run1.json │ │ └── benchmarks-run2.json ├── build.gradle.kts ├── buildSrc ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jvmApp │ ├── build.gradle.kts │ └── src │ │ └── jmh │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── benchmark │ │ ├── AccessorTests.kt │ │ ├── BulkWriteTests.kt │ │ ├── OpenRealmTests.kt │ │ └── SetterTests.kt ├── settings.gradle.kts └── shared │ ├── build.gradle.kts │ ├── shared.podspec │ └── src │ ├── androidMain │ └── AndroidManifest.xml │ └── commonMain │ └── kotlin │ └── io │ └── realm │ └── kotlin │ └── benchmarks │ └── Entities.kt ├── build.gradle.kts ├── buildSrc ├── build.gradle.kts ├── buildSrc │ └── build.gradle.kts ├── gradle.properties ├── settings.gradle.kts └── src │ └── main │ └── kotlin │ ├── Config.kt │ ├── io │ └── realm │ │ └── RealmPublishPlugin.kt │ └── realm-lint.gradle.kts ├── config ├── detekt │ ├── baseline.xml │ └── detekt.yml └── ktlint │ └── .editorconfig ├── dependencies.list ├── examples ├── kmm-sample │ ├── LICENSE │ ├── README.md │ ├── androidApp │ │ ├── build.gradle.kts │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── example │ │ │ │ └── kmmsample │ │ │ │ └── androidApp │ │ │ │ ├── MainActivity.kt │ │ │ │ └── PersistedNameTest.kt │ │ │ └── res │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ └── themes.xml │ ├── build.gradle.kts │ ├── buildSrc │ ├── compose-desktop │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ └── kotlin │ │ │ └── main.kt │ ├── debug.keystore │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── iosApp │ │ ├── File │ │ ├── iosApp.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── iosApp │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ │ └── LaunchScreen.storyboard │ │ │ ├── ContentView.swift │ │ │ ├── Info.plist │ │ │ ├── Preview Content │ │ │ │ └── Preview Assets.xcassets │ │ │ │ │ └── Contents.json │ │ │ └── SceneDelegate.swift │ │ ├── iosAppTests │ │ │ ├── Info.plist │ │ │ └── iosAppTests.swift │ │ └── iosAppUITests │ │ │ ├── Info.plist │ │ │ └── iosAppUITests.swift │ ├── settings.gradle.kts │ └── shared │ │ ├── build.gradle.kts │ │ └── src │ │ ├── androidInstrumentedTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ └── GreetingTestAndroid.kt │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ └── Platform.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ ├── AllTypes.kt │ │ │ ├── Calculator.kt │ │ │ ├── Expression.kt │ │ │ ├── ExpressionRepository.kt │ │ │ ├── FlowUtils.kt │ │ │ ├── Greeting.kt │ │ │ └── Platform.kt │ │ ├── commonTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ ├── CalculatorTest.kt │ │ │ └── ExpressionRepositoryTest.kt │ │ ├── iosMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ └── Platform.kt │ │ ├── iosTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── example │ │ │ └── kmmsample │ │ │ └── GreetingTestIos.kt │ │ └── jvmMain │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── example │ │ └── kmmsample │ │ └── Platform.kt ├── min-android-sample │ ├── app │ │ ├── build.gradle.kts │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── example │ │ │ │ └── minandroidsample │ │ │ │ └── android │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── values-night │ │ │ └── themes.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── settings.gradle.kts │ └── shared │ │ ├── build.gradle.kts │ │ └── src │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── sample │ │ │ └── minandroidsample │ │ │ └── Platform.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── sample │ │ │ └── minandroidsample │ │ │ ├── Greeting.kt │ │ │ └── Platform.kt │ │ └── jvmMain │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── sample │ │ └── minandroidsample │ │ └── Platform.kt └── realm-java-compatibility │ ├── app │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── demo │ │ │ └── javacompatibility │ │ │ └── InstrumentedTest.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── demo │ │ │ └── javacompatibility │ │ │ ├── MainActivity.kt │ │ │ ├── MainApplication.kt │ │ │ └── data │ │ │ ├── Repository.kt │ │ │ ├── java │ │ │ └── JavaRepository.kt │ │ │ └── kotlin │ │ │ └── KotlinRepository.kt │ │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.webp │ │ └── ic_launcher_round.webp │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ ├── build.gradle.kts │ ├── buildSrc │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle.kts ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── images ├── RootGradle.png ├── SharedGradle.png ├── favicon.ico ├── logo-dark.svg ├── logo.png └── logo.svg ├── integration-tests ├── README.md └── gradle │ ├── current │ ├── build.gradle.kts │ ├── buildSrc │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── multi-platform │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── model │ │ │ │ └── TestClass.kt │ │ │ ├── commonTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ ├── CrudTests.kt │ │ │ │ └── util │ │ │ │ ├── Utils.kt │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ ├── jvmTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── util │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ └── nativeTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── util │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ ├── settings.gradle.kts │ └── single-platform │ │ ├── build.gradle.kts │ │ ├── consumer-rules.pro │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── CrudTests.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── model │ │ │ └── Pojo.java │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── model │ │ └── TestClass.kt │ ├── gradle72-test │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── multi-platform │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── model │ │ │ │ └── TestClass.kt │ │ │ ├── commonTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ ├── CrudTests.kt │ │ │ │ └── util │ │ │ │ ├── Utils.kt │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ ├── jvmTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── util │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ └── nativeTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── util │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ ├── settings.gradle.kts │ └── single-platform │ │ ├── build.gradle.kts │ │ ├── consumer-rules.pro │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── CrudTests.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── model │ │ │ └── Pojo.java │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── model │ │ └── TestClass.kt │ ├── gradle75-test │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── multi-platform │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── model │ │ │ │ └── TestClass.kt │ │ │ ├── commonTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ ├── CrudTests.kt │ │ │ │ └── util │ │ │ │ ├── Utils.kt │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ ├── jvmTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── util │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ └── nativeTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── util │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ ├── settings.gradle.kts │ └── single-platform │ │ ├── build.gradle.kts │ │ ├── consumer-rules.pro │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── CrudTests.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── model │ │ │ └── Pojo.java │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── model │ │ └── TestClass.kt │ ├── gradle8-test │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── multi-platform │ │ ├── build.gradle.kts │ │ └── src │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── model │ │ │ │ └── TestClass.kt │ │ │ ├── commonTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ ├── CrudTests.kt │ │ │ │ └── util │ │ │ │ ├── Utils.kt │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ ├── jvmTest │ │ │ └── kotlin │ │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── test │ │ │ │ └── multiplatform │ │ │ │ └── util │ │ │ │ └── platform │ │ │ │ └── PlatformUtils.kt │ │ │ └── nativeTest │ │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── util │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ ├── settings.gradle.kts │ └── single-platform │ │ ├── build.gradle.kts │ │ ├── consumer-rules.pro │ │ ├── proguard-rules.pro │ │ └── src │ │ ├── androidTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── CrudTests.kt │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── singleplatform │ │ │ └── model │ │ │ └── Pojo.java │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── model │ │ └── TestClass.kt │ └── gradle85-test │ ├── build.gradle.kts │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── multi-platform │ ├── build.gradle.kts │ └── src │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── model │ │ │ └── TestClass.kt │ │ ├── commonTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ ├── CrudTests.kt │ │ │ └── util │ │ │ ├── Utils.kt │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ │ ├── jvmTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── test │ │ │ └── multiplatform │ │ │ └── util │ │ │ └── platform │ │ │ └── PlatformUtils.kt │ │ └── nativeTest │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── multiplatform │ │ └── util │ │ └── platform │ │ └── PlatformUtils.kt │ ├── settings.gradle.kts │ └── single-platform │ ├── build.gradle.kts │ ├── consumer-rules.pro │ ├── proguard-rules.pro │ └── src │ ├── androidTest │ └── kotlin │ │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── CrudTests.kt │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── io │ │ └── realm │ │ └── test │ │ └── singleplatform │ │ └── model │ │ └── Pojo.java │ └── kotlin │ └── io │ └── realm │ └── test │ └── singleplatform │ └── model │ └── TestClass.kt ├── packages ├── build.gradle.kts ├── buildSrc ├── cinterop │ ├── build.gradle.kts │ ├── gradle.properties │ └── src │ │ ├── androidInstrumentedTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ ├── CinteropTest.kt │ │ │ ├── EnumTests.kt │ │ │ └── sync │ │ │ └── SyncEnumTests.kt │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ ├── AndroidUtils.kt │ │ │ └── RealmInitializer.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── interop │ │ │ ├── Callback.kt │ │ │ ├── ClassInfo.kt │ │ │ ├── CodeDescription.kt │ │ │ ├── CollectionChangeSetBuilder.kt │ │ │ ├── Constants.kt │ │ │ ├── CoreError.kt │ │ │ ├── CoreErrorConverter.kt │ │ │ ├── CoreLogLevel.kt │ │ │ ├── ErrorCategory.kt │ │ │ ├── ErrorCode.kt │ │ │ ├── Link.kt │ │ │ ├── MemAllocator.kt │ │ │ ├── NativePointer.kt │ │ │ ├── PropertyInfo.kt │ │ │ ├── RealmEnums.kt │ │ │ ├── RealmInterop.kt │ │ │ ├── RealmObjectInterop.kt │ │ │ ├── RealmValue.kt │ │ │ ├── SynchronizableObject.kt │ │ │ ├── Timestamp.kt │ │ │ └── sync │ │ │ ├── ApiKeyWrapper.kt │ │ │ ├── AppError.kt │ │ │ ├── AuthProvider.kt │ │ │ ├── CoreCompensatingWriteInfo.kt │ │ │ ├── CoreConnectionState.kt │ │ │ ├── CoreSubscriptionSetState.kt │ │ │ ├── CoreSyncSessionState.kt │ │ │ ├── CoreUserState.kt │ │ │ ├── MetadataMode.kt │ │ │ ├── NetworkTransport.kt │ │ │ ├── ProgressDirection.kt │ │ │ ├── ProtocolErrorCode.kt │ │ │ ├── SyncError.kt │ │ │ ├── SyncSessionResyncMode.kt │ │ │ ├── SyncUserIdentity.kt │ │ │ └── WebSocketTransport.kt │ │ ├── jvm │ │ ├── CMakeLists.txt │ │ ├── jni │ │ │ ├── env_utils.cpp │ │ │ ├── env_utils.h │ │ │ ├── java_class.cpp │ │ │ ├── java_class.hpp │ │ │ ├── java_class_global_def.cpp │ │ │ ├── java_class_global_def.hpp │ │ │ ├── java_global_ref_by_move.cpp │ │ │ ├── java_global_ref_by_move.hpp │ │ │ ├── java_method.cpp │ │ │ ├── java_method.hpp │ │ │ ├── utf8.hpp │ │ │ ├── utils.cpp │ │ │ └── utils.h │ │ ├── kotlin │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── kotlin │ │ │ │ └── internal │ │ │ │ └── interop │ │ │ │ ├── ClassFlags.kt │ │ │ │ ├── CollectionType.kt │ │ │ │ ├── CoreLogLevel.kt │ │ │ │ ├── Enumerated.kt │ │ │ │ ├── ErrorCategory.kt │ │ │ │ ├── ErrorCode.kt │ │ │ │ ├── ListChangeSetBuilderExt.kt │ │ │ │ ├── LongPointerWrapper.kt │ │ │ │ ├── NativeEnumerated.kt │ │ │ │ ├── NotificationCallback.kt │ │ │ │ ├── PropertyFlags.kt │ │ │ │ ├── PropertyType.kt │ │ │ │ ├── RealmInterop.kt │ │ │ │ ├── RealmValue.kt │ │ │ │ ├── RealmValueAllocator.kt │ │ │ │ ├── SchemaMode.kt │ │ │ │ ├── SchemaValidationMode.kt │ │ │ │ ├── SynchronizableObject.kt │ │ │ │ ├── ValueType.kt │ │ │ │ ├── gc │ │ │ │ ├── FinalizerRunnable.kt │ │ │ │ ├── NativeContext.kt │ │ │ │ └── NativeObjectReference.kt │ │ │ │ └── sync │ │ │ │ ├── AuthProvider.kt │ │ │ │ ├── CoreCompensatingWriteInfo.kt │ │ │ │ ├── CoreConnectionState.kt │ │ │ │ ├── CoreSubscriptionSetState.kt │ │ │ │ ├── CoreSyncSessionState.kt │ │ │ │ ├── CoreUserState.kt │ │ │ │ ├── JVMSyncSessionTransferCompletionCallback.kt │ │ │ │ ├── MetadataMode.kt │ │ │ │ ├── ProgressDirection.kt │ │ │ │ ├── ProtocolErrorCode.kt │ │ │ │ ├── ResponseCallbackImpl.kt │ │ │ │ └── SyncSessionResyncMode.kt │ │ └── realm-core │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── jvm │ │ │ └── SoLoader.kt │ │ ├── native │ │ └── realm.def │ │ ├── nativeDarwin │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── interop │ │ │ ├── CoreLogLevel.kt │ │ │ ├── ErrorCategory.kt │ │ │ ├── ErrorCode.kt │ │ │ ├── ListChangeSetBuilderExt.kt │ │ │ ├── RealmEnums.kt │ │ │ ├── RealmInterop.kt │ │ │ ├── RealmValue.kt │ │ │ ├── RealmValueAllocator.kt │ │ │ ├── SynchronizableObjectDarwin.kt │ │ │ └── sync │ │ │ ├── AuthProvider.kt │ │ │ ├── CoreCompensatingWriteInfo.kt │ │ │ ├── CoreConnectionState.kt │ │ │ ├── CoreSubscriptionSetState.kt │ │ │ ├── CoreSyncSessionState.kt │ │ │ ├── CoreUserState.kt │ │ │ ├── MetadataMode.kt │ │ │ ├── ProgressDirection.kt │ │ │ ├── ProtocolErrorCode.kt │ │ │ └── SyncSessionResyncMode.kt │ │ └── nativeDarwinTest │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── test │ │ └── CinteropTest.kt ├── gradle-plugin │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── gradle │ │ ├── RealmCompilerSubplugin.kt │ │ ├── RealmPlugin.kt │ │ └── analytics │ │ └── AnalyticsService.kt ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── jni-swig-stub │ ├── build.gradle.kts │ ├── realm.i │ └── src │ │ └── main │ │ └── jni │ │ ├── realm_api_helpers.cpp │ │ └── realm_api_helpers.h ├── library-base │ ├── README.md │ ├── build.gradle.kts │ ├── gradle.properties │ ├── overview.md │ ├── proguard-rules-consumer-common.pro │ └── src │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── platform │ │ │ ├── LogCatLogger.kt │ │ │ └── SystemUtilsAndroid.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ ├── BaseRealm.kt │ │ │ ├── Configuration.kt │ │ │ ├── Deleteable.kt │ │ │ ├── MutableRealm.kt │ │ │ ├── Realm.kt │ │ │ ├── RealmConfiguration.kt │ │ │ ├── TypedRealm.kt │ │ │ ├── UpdatePolicy.kt │ │ │ ├── VersionId.kt │ │ │ ├── Versioned.kt │ │ │ ├── annotations │ │ │ ├── ExperimentalGeoSpatialApi.kt │ │ │ └── ExperimentalRealmSerializerApi.kt │ │ │ ├── dynamic │ │ │ ├── DynamicMutableRealm.kt │ │ │ ├── DynamicMutableRealmObject.kt │ │ │ ├── DynamicRealm.kt │ │ │ ├── DynamicRealmObject.kt │ │ │ └── info.md │ │ │ ├── exceptions │ │ │ └── RealmException.kt │ │ │ ├── ext │ │ │ ├── BaseRealmObjectExt.kt │ │ │ ├── DoubleExt.kt │ │ │ ├── EmbeddedRealmObjectExt.kt │ │ │ ├── IterableExt.kt │ │ │ ├── MutableRealmExt.kt │ │ │ ├── RealmAnyExt.kt │ │ │ ├── RealmDictionaryExt.kt │ │ │ ├── RealmExt.kt │ │ │ ├── RealmListExt.kt │ │ │ ├── RealmObjectExt.kt │ │ │ ├── RealmResultsExt.kt │ │ │ ├── RealmSetExt.kt │ │ │ ├── TypedRealmExt.kt │ │ │ └── TypedRealmObjectExt.kt │ │ │ ├── info.md │ │ │ ├── internal │ │ │ ├── BacklinksDelegateImpl.kt │ │ │ ├── BaseRealmImpl.kt │ │ │ ├── CollectionChangeSetBuilderImpl.kt │ │ │ ├── CollectionOperator.kt │ │ │ ├── ConfigurationImpl.kt │ │ │ ├── Constants.kt │ │ │ ├── ContextLogger.kt │ │ │ ├── Converters.kt │ │ │ ├── InternalConfiguration.kt │ │ │ ├── InternalDeleteable.kt │ │ │ ├── InternalMutableRealm.kt │ │ │ ├── InternalTypedRealm.kt │ │ │ ├── KeyPathFlowable.kt │ │ │ ├── LiveRealm.kt │ │ │ ├── LiveRealmHolder.kt │ │ │ ├── LogUtils.kt │ │ │ ├── Mediator.kt │ │ │ ├── MutableLiveRealmImpl.kt │ │ │ ├── MutableRealmIntInternal.kt │ │ │ ├── Notifiable.kt │ │ │ ├── NotificationToken.kt │ │ │ ├── ObjectBoundRealmResults.kt │ │ │ ├── RealmAnyImpl.kt │ │ │ ├── RealmConfigurationImpl.kt │ │ │ ├── RealmImpl.kt │ │ │ ├── RealmInstantImpl.kt │ │ │ ├── RealmListInternal.kt │ │ │ ├── RealmMapInternal.kt │ │ │ ├── RealmObjectCompanion.kt │ │ │ ├── RealmObjectHelper.kt │ │ │ ├── RealmObjectInternal.kt │ │ │ ├── RealmObjectReference.kt │ │ │ ├── RealmObjectUtil.kt │ │ │ ├── RealmReference.kt │ │ │ ├── RealmResultsImpl.kt │ │ │ ├── RealmSetInternal.kt │ │ │ ├── RealmState.kt │ │ │ ├── RealmUUIDImpl.kt │ │ │ ├── RealmUtils.kt │ │ │ ├── SuspendableNotifier.kt │ │ │ ├── SuspendableWriter.kt │ │ │ ├── TypedFrozenRealmImpl.kt │ │ │ ├── VersionData.kt │ │ │ ├── VersionInfo.kt │ │ │ ├── VersionTracker.kt │ │ │ ├── WriteTransactionManager.kt │ │ │ ├── dynamic │ │ │ │ ├── DynamicMutableRealmImpl.kt │ │ │ │ ├── DynamicMutableRealmObjectImpl.kt │ │ │ │ ├── DynamicRealmImpl.kt │ │ │ │ ├── DynamicRealmObjectImpl.kt │ │ │ │ └── DynamicUnmanagedRealmObject.kt │ │ │ ├── geo │ │ │ │ ├── UnmanagedGeoBox.kt │ │ │ │ ├── UnmanagedGeoCircle.kt │ │ │ │ ├── UnmanagedGeoPoint.kt │ │ │ │ └── UnmanagedGeoPolygon.kt │ │ │ ├── platform │ │ │ │ ├── CoroutineUtils.kt │ │ │ │ ├── RealmObject.kt │ │ │ │ ├── SecureRandom.kt │ │ │ │ ├── SystemUtils.kt │ │ │ │ └── WeakReference.kt │ │ │ ├── query │ │ │ │ ├── ObjectBoundQueries.kt │ │ │ │ ├── ObjectQuery.kt │ │ │ │ ├── QueryResultNotifiable.kt │ │ │ │ ├── QueryUtils.kt │ │ │ │ ├── ScalarQuery.kt │ │ │ │ └── SingleQuery.kt │ │ │ ├── schema │ │ │ │ ├── CachedClassKeyMap.kt │ │ │ │ ├── CompilerPluginBridgeUtils.kt │ │ │ │ ├── RealmClassImpl.kt │ │ │ │ ├── RealmPropertyImpl.kt │ │ │ │ ├── RealmPropertyTypeImpl.kt │ │ │ │ ├── RealmSchemaImpl.kt │ │ │ │ └── RealmStorageTypeImpl.kt │ │ │ └── util │ │ │ │ ├── Channel.kt │ │ │ │ ├── CoroutineDispatcherFactory.kt │ │ │ │ ├── Exceptions.kt │ │ │ │ ├── Flow.kt │ │ │ │ ├── Hexadecimal.kt │ │ │ │ └── Validation.kt │ │ │ ├── log │ │ │ ├── LogCategory.kt │ │ │ ├── LogLevel.kt │ │ │ ├── RealmLog.kt │ │ │ ├── RealmLogger.kt │ │ │ └── info.md │ │ │ ├── migration │ │ │ ├── AutomaticSchemaMigration.kt │ │ │ ├── RealmMigration.kt │ │ │ └── info.md │ │ │ ├── notifications │ │ │ ├── CollectionChangeSet.kt │ │ │ ├── ListChange.kt │ │ │ ├── MapChange.kt │ │ │ ├── ObjectChange.kt │ │ │ ├── RealmChange.kt │ │ │ ├── ResultsChange.kt │ │ │ ├── SetChange.kt │ │ │ └── internal │ │ │ │ ├── Callback.kt │ │ │ │ ├── Cancellable.kt │ │ │ │ ├── ListChangeImpl.kt │ │ │ │ ├── MapChangeImpl.kt │ │ │ │ ├── ObjectChangeImpl.kt │ │ │ │ ├── RealmChangeImpl.kt │ │ │ │ ├── ResultsChangeImpl.kt │ │ │ │ └── SetChangeImpl.kt │ │ │ ├── query │ │ │ ├── RealmElementQuery.kt │ │ │ ├── RealmQuery.kt │ │ │ ├── RealmResults.kt │ │ │ ├── RealmScalarNullableQuery.kt │ │ │ ├── RealmScalarQuery.kt │ │ │ ├── RealmSingleQuery.kt │ │ │ └── Sort.kt │ │ │ ├── schema │ │ │ ├── RealmClass.kt │ │ │ ├── RealmClassKind.kt │ │ │ ├── RealmProperty.kt │ │ │ ├── RealmPropertyType.kt │ │ │ ├── RealmSchema.kt │ │ │ └── RealmStorageType.kt │ │ │ ├── serializers │ │ │ └── RealmKSerializers.kt │ │ │ └── types │ │ │ ├── BacklinksDelegate.kt │ │ │ ├── BaseRealmObject.kt │ │ │ ├── EmbeddedRealmObject.kt │ │ │ ├── MutableRealmInt.kt │ │ │ ├── RealmAny.kt │ │ │ ├── RealmInstant.kt │ │ │ ├── RealmList.kt │ │ │ ├── RealmMap.kt │ │ │ ├── RealmObject.kt │ │ │ ├── RealmSet.kt │ │ │ ├── RealmUUID.kt │ │ │ ├── TypedRealmObject.kt │ │ │ ├── annotations │ │ │ ├── FullText.kt │ │ │ ├── Ignore.kt │ │ │ ├── Index.kt │ │ │ ├── PersistedName.kt │ │ │ └── PrimaryKey.kt │ │ │ ├── geo │ │ │ ├── Distance.kt │ │ │ ├── GeoBox.kt │ │ │ ├── GeoCircle.kt │ │ │ ├── GeoPoint.kt │ │ │ └── GeoPolygon.kt │ │ │ └── info.md │ │ ├── jvm │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── platform │ │ │ ├── CoroutineUtilsSharedJvm.kt │ │ │ ├── RealmObject.kt │ │ │ ├── SecureRandomJvm.kt │ │ │ ├── SystemUtils.kt │ │ │ └── WeakReference.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── platform │ │ │ ├── StdOutLogger.kt │ │ │ └── SystemUtilsJvm.kt │ │ ├── nativeDarwin │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── platform │ │ │ ├── CoroutineUtils.kt │ │ │ ├── ModelObject.kt │ │ │ ├── NSLogLogger.kt │ │ │ ├── RealmObject.kt │ │ │ ├── SecureRandom.kt │ │ │ ├── SystemUtils.kt │ │ │ └── WeakReference.kt │ │ ├── nativeIos │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── internal │ │ │ └── platform │ │ │ └── SystemUtils.kt │ │ └── nativeMacos │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── internal │ │ └── platform │ │ └── SystemUtils.kt ├── library-sync │ ├── build.gradle.kts │ ├── gradle.properties │ ├── overview.md │ ├── proguard-rules-consumer-common.pro │ └── src │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── mongodb │ │ │ └── internal │ │ │ ├── NetworkStateObserver.kt │ │ │ └── RealmSyncInitializer.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ ├── mongodb │ │ │ ├── App.kt │ │ │ ├── AppConfiguration.kt │ │ │ ├── AuthenticationChange.kt │ │ │ ├── AuthenticationProvider.kt │ │ │ ├── Credentials.kt │ │ │ ├── Functions.kt │ │ │ ├── HttpLogObfuscator.kt │ │ │ ├── RealmExt.kt │ │ │ ├── User.kt │ │ │ ├── UserIdentity.kt │ │ │ ├── annotations │ │ │ │ ├── ExperimentalAsymmetricSyncApi.kt │ │ │ │ ├── ExperimentalEdgeServerApi.kt │ │ │ │ └── ExperimentalFlexibleSyncApi.kt │ │ │ ├── auth │ │ │ │ ├── ApiKey.kt │ │ │ │ ├── ApiKeyAuth.kt │ │ │ │ └── EmailPasswordAuth.kt │ │ │ ├── exceptions │ │ │ │ ├── AppException.kt │ │ │ │ ├── ClientResetRequiredException.kt │ │ │ │ ├── DownloadingRealmTimeOutException.kt │ │ │ │ ├── ServiceExceptions.kt │ │ │ │ └── SyncExceptions.kt │ │ │ ├── ext │ │ │ │ ├── DynamicMutableRealmExt.kt │ │ │ │ ├── FunctionsExt.kt │ │ │ │ ├── MongoClientExt.kt │ │ │ │ ├── MongoCollectionExt.kt │ │ │ │ ├── MutableRealmExt.kt │ │ │ │ ├── RealmQueryExt.kt │ │ │ │ ├── RealmResultsExt.kt │ │ │ │ └── UserExt.kt │ │ │ ├── internal │ │ │ │ ├── ApiKeyAuthImpl.kt │ │ │ │ ├── AppConfigurationImpl.kt │ │ │ │ ├── AppImpl.kt │ │ │ │ ├── AuthenticationChangeImpl.kt │ │ │ │ ├── AuthenticationProviderImpl.kt │ │ │ │ ├── BaseSubscriptionSetImpl.kt │ │ │ │ ├── BsonEncoder.kt │ │ │ │ ├── CredentialsImpl.kt │ │ │ │ ├── CustomEJsonCredentialsImpl.kt │ │ │ │ ├── EmailPasswordAuthImpl.kt │ │ │ │ ├── FunctionsImpl.kt │ │ │ │ ├── HttpClientCache.kt │ │ │ │ ├── KtorNetworkTransport.kt │ │ │ │ ├── LogObfuscator.kt │ │ │ │ ├── MongoClientImpl.kt │ │ │ │ ├── MongoCollectionImpl.kt │ │ │ │ ├── MongoDBSerializer.kt │ │ │ │ ├── MongoDatabaseImpl.kt │ │ │ │ ├── MutableSubscriptionSetImpl.kt │ │ │ │ ├── NetworkStateObserver.kt │ │ │ │ ├── RealmQueryExtImpl.kt │ │ │ │ ├── RealmSyncUtils.kt │ │ │ │ ├── RealmWebSocketTransport.kt │ │ │ │ ├── SubscriptionImpl.kt │ │ │ │ ├── SubscriptionSetImpl.kt │ │ │ │ ├── SyncConfigurationImpl.kt │ │ │ │ ├── SyncImpl.kt │ │ │ │ ├── SyncSessionImpl.kt │ │ │ │ ├── SyncedRealmContext.kt │ │ │ │ └── UserImpl.kt │ │ │ ├── mongo │ │ │ │ ├── MongoClient.kt │ │ │ │ ├── MongoCollection.kt │ │ │ │ └── MongoDatabase.kt │ │ │ └── sync │ │ │ │ ├── BaseSubscriptionSet.kt │ │ │ │ ├── ConnectionState.kt │ │ │ │ ├── ConnectionStateChange.kt │ │ │ │ ├── Direction.kt │ │ │ │ ├── MutableSubscriptionSet.kt │ │ │ │ ├── Progress.kt │ │ │ │ ├── ProgressMode.kt │ │ │ │ ├── Subscription.kt │ │ │ │ ├── SubscriptionSet.kt │ │ │ │ ├── SubscriptionSetState.kt │ │ │ │ ├── Sync.kt │ │ │ │ ├── SyncClientResetStrategy.kt │ │ │ │ ├── SyncConfiguration.kt │ │ │ │ ├── SyncSession.kt │ │ │ │ ├── SyncTimeoutOptions.kt │ │ │ │ ├── SyncTimeoutOptionsBuilder.kt │ │ │ │ └── WaitForSync.kt │ │ │ └── types │ │ │ └── AsymmetricRealmObject.kt │ │ ├── jvm │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── mongodb │ │ │ └── internal │ │ │ ├── HttpClientCache.kt │ │ │ └── OkHttpWebsocketClient.kt │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── mongodb │ │ │ └── internal │ │ │ └── NetworkStateObserver.kt │ │ └── nativeDarwin │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── mongodb │ │ └── internal │ │ ├── HttpClientCache.kt │ │ └── NetworkStateObserver.kt ├── plugin-compiler-shaded │ └── build.gradle.kts ├── plugin-compiler │ ├── build.gradle.kts │ ├── gradle.properties │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── compiler │ │ │ ├── AccessorModifierIrGeneration.kt │ │ │ ├── Identifiers.kt │ │ │ ├── IrUtils.kt │ │ │ ├── Logger.kt │ │ │ ├── RealmCommandLineProcessor.kt │ │ │ ├── RealmModelDefaultMethodGeneration.kt │ │ │ ├── RealmModelLoweringExtension.kt │ │ │ ├── RealmModelSyntheticCompanionExtension.kt │ │ │ ├── RealmModelSyntheticMethodsExtension.kt │ │ │ ├── RealmModelSyntheticPropertiesGeneration.kt │ │ │ ├── Registrar.kt │ │ │ ├── SyncLoweringExtension.kt │ │ │ └── fir │ │ │ ├── RealmPluginGeneratorKey.kt │ │ │ └── model │ │ │ ├── CompanionExtension.kt │ │ │ ├── ObjectExtension.kt │ │ │ └── RealmModelRegistrar.kt │ │ └── test │ │ ├── kotlin │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── compiler │ │ │ └── GenerationExtensionTest.kt │ │ └── resources │ │ ├── sample │ │ ├── expected │ │ │ └── 02_AFTER.ValidateIrBeforeLowering.ir │ │ └── input │ │ │ └── Sample.kt │ │ ├── schema │ │ ├── expected │ │ │ └── 02_AFTER.ValidateIrBeforeLowering.ir │ │ └── input │ │ │ └── Schema.kt │ │ └── sync │ │ ├── expected │ │ └── 02_AFTER.ValidateIrBeforeLowering.ir │ │ └── input │ │ └── App.kt ├── settings.gradle.kts ├── test-base │ ├── build.gradle.kts │ ├── gradle.properties │ ├── proguard-rules-test.pro │ └── src │ │ ├── androidInstrumentedTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ ├── android │ │ │ ├── InstrumentedTests.kt │ │ │ ├── MemoryTests.kt │ │ │ ├── PlatformInfoTest.kt │ │ │ ├── RealmConfigurationTests.kt │ │ │ └── RealmTests.kt │ │ │ └── common │ │ ├── androidMain │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── asset-pbs.realm │ │ │ └── subdir │ │ │ │ └── asset.realm │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ └── platform │ │ │ ├── FileUtils.kt │ │ │ ├── PlatformUtils.kt │ │ │ └── RunLoopThread.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ ├── entities │ │ │ ├── CyclicReference.kt │ │ │ ├── FqNameImport.kt │ │ │ ├── GeoEntities.kt │ │ │ ├── JsonStyleRealmObject.kt │ │ │ ├── MultipleConstructors.kt │ │ │ ├── Nullability.kt │ │ │ ├── Sample.kt │ │ │ ├── SampleWithPrimaryKey.kt │ │ │ ├── SerializableSample.kt │ │ │ ├── StringPropertyWithPrimaryKey.kt │ │ │ ├── backlink │ │ │ │ └── Models.kt │ │ │ ├── dictionary │ │ │ │ └── RealmDictionaryContainer.kt │ │ │ ├── embedded │ │ │ │ ├── CyclicReferenceEmbedded.kt │ │ │ │ ├── EmbeddedChild.kt │ │ │ │ ├── EmbeddedChildWithInitializer.kt │ │ │ │ ├── EmbeddedChildWithPrimaryKeyParent.kt │ │ │ │ ├── EmbeddedInnerChild.kt │ │ │ │ ├── EmbeddedParent.kt │ │ │ │ └── EmbeddedParentWithPrimaryKey.kt │ │ │ ├── link │ │ │ │ ├── Child.kt │ │ │ │ └── Parent.kt │ │ │ ├── list │ │ │ │ └── RealmListContainer.kt │ │ │ ├── migration │ │ │ │ ├── Sample.kt │ │ │ │ ├── after │ │ │ │ │ └── MigrationSample.kt │ │ │ │ ├── before │ │ │ │ │ └── MigrationSample.kt │ │ │ │ └── embedded │ │ │ │ │ ├── after │ │ │ │ │ ├── EmbeddedMigrationChild.kt │ │ │ │ │ └── EmbeddedMigrationParent.kt │ │ │ │ │ └── before │ │ │ │ │ ├── EmbeddedMigrationChild.kt │ │ │ │ │ └── EmbeddedMigrationParent.kt │ │ │ ├── primarykey │ │ │ │ └── PrimaryKey.kt │ │ │ ├── schema │ │ │ │ └── SchemaVariations.kt │ │ │ └── set │ │ │ │ └── RealmSetContainer.kt │ │ │ └── test │ │ │ ├── StandaloneDynamicMutableRealm.kt │ │ │ ├── platform │ │ │ ├── FileUtils.kt │ │ │ ├── PlatformUtils.kt │ │ │ └── RunLoopThread.kt │ │ │ └── util │ │ │ ├── TestHelper.kt │ │ │ ├── TestLogger.kt │ │ │ ├── TypeDescriptor.kt │ │ │ └── Utils.kt │ │ ├── commonTest │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ └── common │ │ │ ├── BacklinksTests.kt │ │ │ ├── BsonObjectIdTests.kt │ │ │ ├── ByteArrayTests.kt │ │ │ ├── CollectionQueryTests.kt │ │ │ ├── CompactOnLaunchTests.kt │ │ │ ├── CopyFromRealmTests.kt │ │ │ ├── Decimal128Tests.kt │ │ │ ├── EmbeddedRealmObjectTests.kt │ │ │ ├── EncryptionTests.kt │ │ │ ├── FqNameImportTests.kt │ │ │ ├── GeoSpatialTests.kt │ │ │ ├── ImportTests.kt │ │ │ ├── InitialDataTests.kt │ │ │ ├── LinkTests.kt │ │ │ ├── MigrationTests.kt │ │ │ ├── MutableRealmIntTests.kt │ │ │ ├── MutableRealmTests.kt │ │ │ ├── NullabilityTests.kt │ │ │ ├── PersistedNameTests.kt │ │ │ ├── PrimaryKeyTests.kt │ │ │ ├── QueryTests.kt │ │ │ ├── ReadMeTests.kt │ │ │ ├── RealmAnyNestedCollectionTests.kt │ │ │ ├── RealmAnyTests.kt │ │ │ ├── RealmConfigurationTests.kt │ │ │ ├── RealmDictionaryTests.kt │ │ │ ├── RealmInMemoryTests.kt │ │ │ ├── RealmInstantTests.kt │ │ │ ├── RealmListTests.kt │ │ │ ├── RealmLogTests.kt │ │ │ ├── RealmObjectTests.kt │ │ │ ├── RealmResultsTests.kt │ │ │ ├── RealmSchemaTests.kt │ │ │ ├── RealmSetTests.kt │ │ │ ├── RealmTests.kt │ │ │ ├── RealmUUIDTests.kt │ │ │ ├── SampleTests.kt │ │ │ ├── SchemaTests.kt │ │ │ ├── SerializationTests.kt │ │ │ ├── VersionIdTests.kt │ │ │ ├── VersionTrackingTests.kt │ │ │ ├── dynamic │ │ │ ├── DynamicMutableRealmObjectTests.kt │ │ │ ├── DynamicMutableRealmTests.kt │ │ │ ├── DynamicRealmObjectTests.kt │ │ │ └── DynamicRealmTests.kt │ │ │ ├── migration │ │ │ └── RealmMigrationTests.kt │ │ │ ├── nonlatin │ │ │ └── NonLatinTests.kt │ │ │ ├── notifications │ │ │ ├── BacklinksNotificationsTests.kt │ │ │ ├── RealmAnyNestedCollectionNotificationTest.kt │ │ │ ├── RealmAnyNestedDictionaryNotificationTest.kt │ │ │ ├── RealmAnyNestedListNotificationTest.kt │ │ │ ├── RealmDictionaryNotificationsTests.kt │ │ │ ├── RealmListNotificationsTests.kt │ │ │ ├── RealmNotificationsTests.kt │ │ │ ├── RealmObjectNotificationsTests.kt │ │ │ ├── RealmResultsNotificationsTests.kt │ │ │ ├── RealmSetNotificationsTests.kt │ │ │ └── SystemNotificationTests.kt │ │ │ └── utils │ │ │ ├── ChangeSetAssert.kt │ │ │ ├── DeletableEntityNotificationTests.kt │ │ │ ├── ExhaustiveCollectionTesting.kt │ │ │ ├── FlowableTests.kt │ │ │ ├── KeyPathFlowableTests.kt │ │ │ ├── PlatformUtilsTests.kt │ │ │ ├── RealmEntityNotificationTests.kt │ │ │ ├── RealmStateTest.kt │ │ │ ├── SecureRandomTest.kt │ │ │ └── Utils.kt │ │ ├── iosTest │ │ ├── kotlin │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── kotlin │ │ │ │ └── test │ │ │ │ └── ios │ │ │ │ └── PlatformInfoTest.kt │ │ └── resources │ │ │ ├── asset-pbs.realm │ │ │ └── subdir │ │ │ └── asset.realm │ │ ├── jvmMain │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ ├── platform │ │ │ ├── FileUtils.kt │ │ │ ├── PlatformUtils.kt │ │ │ └── RunLoopThread.kt │ │ │ └── util │ │ │ └── Compiler.kt │ │ ├── jvmTest │ │ ├── kotlin │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── kotlin │ │ │ │ └── test │ │ │ │ ├── compiler │ │ │ │ ├── BacklinksTests.kt │ │ │ │ ├── CollectionTests.kt │ │ │ │ ├── CyclicDependenciesTests.kt │ │ │ │ ├── EmbeddedTests.kt │ │ │ │ ├── FullTextTests.kt │ │ │ │ ├── IndexTests.kt │ │ │ │ ├── ModelDefinitionTests.kt │ │ │ │ ├── PersistedNameTests.kt │ │ │ │ ├── PrimaryKeyTests.kt │ │ │ │ ├── RealmObjectAsGenericTests.kt │ │ │ │ ├── Utils.kt │ │ │ │ ├── dictionary │ │ │ │ │ └── DictionaryTests.kt │ │ │ │ ├── list │ │ │ │ │ └── ListTests.kt │ │ │ │ └── set │ │ │ │ │ └── SetTests.kt │ │ │ │ └── jvm │ │ │ │ ├── PlatformInfoTest.kt │ │ │ │ └── RealmTests.kt │ │ └── resources │ │ │ ├── asset-pbs.realm │ │ │ └── subdir │ │ │ └── asset.realm │ │ ├── macosTest │ │ ├── kotlin │ │ │ └── io │ │ │ │ └── realm │ │ │ │ └── kotlin │ │ │ │ └── test │ │ │ │ └── macos │ │ │ │ └── PlatformInfoTest.kt │ │ └── resources │ │ │ ├── asset-pbs.realm │ │ │ └── subdir │ │ │ └── asset.realm │ │ ├── nativeDarwin │ │ └── kotlin │ │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ └── platform │ │ │ ├── Dispatcher.kt │ │ │ ├── FileUtils.kt │ │ │ ├── PlatformUtils.kt │ │ │ └── RunLoopThread.kt │ │ └── nativeDarwinTest │ │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── test │ │ └── darwin │ │ ├── CoroutineTests.kt │ │ ├── InstrumentedTests.kt │ │ └── MemoryTests.kt └── test-sync │ ├── build.gradle.kts │ ├── gradle.properties │ ├── proguard-rules-test.pro │ └── src │ ├── androidInstrumentedTest │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── test │ │ └── mongodb │ │ └── common │ ├── androidMain │ ├── AndroidManifest.xml │ ├── assets │ │ ├── asset-fs.realm │ │ ├── asset-local.realm │ │ └── asset-pbs.realm │ ├── kotlin │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ └── mongodb │ │ │ ├── BaasUtils.kt │ │ │ └── sync │ │ │ └── SyncDispatcher.kt │ └── res │ │ └── xml │ │ └── network_security_config.xml │ ├── commonMain │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ ├── entities │ │ └── sync │ │ │ ├── BinaryObject.kt │ │ │ ├── ChildPk.kt │ │ │ ├── MongoDBClientSchemas.kt │ │ │ ├── ObjectIdPk.kt │ │ │ ├── ParentPk.kt │ │ │ ├── SyncObjectWithAllTypes.kt │ │ │ ├── SyncPerson.kt │ │ │ ├── SyncRestaurant.kt │ │ │ ├── bogus │ │ │ └── ChildPk.kt │ │ │ ├── flx │ │ │ ├── FlexChildObject.kt │ │ │ ├── FlexEmbeddedObject.kt │ │ │ └── FlexParentObject.kt │ │ │ └── subset │ │ │ └── ChildPk.kt │ │ └── test │ │ └── mongodb │ │ ├── TestApp.kt │ │ ├── common │ │ ├── AsymmetricSchemas.kt │ │ └── Schema.kt │ │ ├── sync │ │ └── SyncDispatcher.kt │ │ └── util │ │ ├── AppAdmin.kt │ │ ├── AppServicesClient.kt │ │ ├── HttpClient.kt │ │ ├── SchemaProcessor.kt │ │ └── TestAppInitializer.kt │ ├── commonTest │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── test │ │ └── mongodb │ │ └── common │ │ ├── ApiKeyAuthTests.kt │ │ ├── AppConfigurationTests.kt │ │ ├── AppTests.kt │ │ ├── AsymmetricSyncTests.kt │ │ ├── CredentialsTests.kt │ │ ├── EmailPasswordAuthTests.kt │ │ ├── FLXProgressListenerTests.kt │ │ ├── FlexibleSyncConfigurationTests.kt │ │ ├── FlexibleSyncIntegrationTests.kt │ │ ├── FunctionsTests.kt │ │ ├── GeoSpatialTests.kt │ │ ├── HttpLogObfuscatorTests.kt │ │ ├── MutableSubscriptionSetTests.kt │ │ ├── PBSProgressListenerTests.kt │ │ ├── SchemaProcessorTests.kt │ │ ├── SubscriptionExtensionsTests.kt │ │ ├── SubscriptionSetTests.kt │ │ ├── SubscriptionTests.kt │ │ ├── SyncClientResetIntegrationTests.kt │ │ ├── SyncClientTests.kt │ │ ├── SyncConfigTests.kt │ │ ├── SyncSessionTests.kt │ │ ├── SyncedRealmTests.kt │ │ ├── UserProfileTests.kt │ │ ├── UserTests.kt │ │ ├── internal │ │ ├── KtorNetworkTransportTest.kt │ │ ├── RealmSyncUtilsTest.kt │ │ └── SyncConnectionParamsTests.kt │ │ ├── mongo │ │ ├── MongoClientTests.kt │ │ ├── MongoCollectionTests.kt │ │ ├── MongoDBSerializerTests.kt │ │ └── MongoDatabaseTests.kt │ │ ├── nonlatin │ │ └── NonLatinTests.kt │ │ ├── serializer │ │ └── BsonEncoderTests.kt │ │ └── utils │ │ ├── CustomLogCollector.kt │ │ └── Utils.kt │ ├── iosTest │ └── resources │ │ ├── asset-fs.realm │ │ ├── asset-local.realm │ │ └── asset-pbs.realm │ ├── jvmMain │ └── kotlin │ │ └── io │ │ └── realm │ │ └── kotlin │ │ └── test │ │ └── mongodb │ │ ├── BaasUtils.kt │ │ └── sync │ │ └── SyncDispatcher.kt │ ├── jvmTest │ ├── kotlin │ │ └── io │ │ │ └── realm │ │ │ └── kotlin │ │ │ └── test │ │ │ └── mongodb │ │ │ ├── compiler │ │ │ └── AsymmetricObjectTests.kt │ │ │ └── jvm │ │ │ ├── FlexibleSyncSchemaTests.kt │ │ │ ├── PlatformNetworkingTests.kt │ │ │ └── RealmTests.kt │ └── resources │ │ ├── asset-fs.realm │ │ ├── asset-local.realm │ │ └── asset-pbs.realm │ ├── macosTest │ └── resources │ │ ├── asset-fs.realm │ │ ├── asset-local.realm │ │ └── asset-pbs.realm │ └── nativeDarwin │ └── kotlin │ └── io │ └── realm │ └── kotlin │ └── test │ └── mongodb │ ├── BaasUtils.kt │ └── sync │ └── SyncDispatcher.kt ├── settings.gradle.kts └── tools ├── collect_metrics.sh ├── delete-cloud-qa-apps.sh ├── fix-h1s.sh ├── gpg_with_pinentry.sh ├── publish_release.sh ├── publish_snapshots.main.kts ├── sync_test_server ├── bind_android_ports.sh ├── start_local_server.sh ├── start_server.sh ├── stop_local_server.sh └── stop_server.sh └── update_gradle_wrapper.sh /.githooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Prevents pushing any code to the server that does not comply with klint or detekt 4 | # It ignores any unchecked files. 5 | 6 | # Ignore any unchecked file 7 | echo "Stashing changes before doing checks" 8 | git stash push -q -u --keep-index 9 | 10 | # Pop the stash once the scripts finishes, fails or gets cancelled 11 | function pop_stash() { 12 | echo "Checks completed, popping stash" 13 | git stash pop -q 14 | } 15 | 16 | trap "exit" INT TERM ERR 17 | trap pop_stash EXIT 18 | 19 | # Do the actual check ups 20 | ./gradlew ktlintCheck detekt 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: General Questions and Inquiries 4 | url: https://www.mongodb.com/community/forums/tags/c/atlas-app-services-realm/9/kotlin 5 | about: Please ask general design/architecture questions in the community forums. 6 | - name: MongoDB Atlas Device Sync Production Issues 7 | url: https://support.mongodb.com/ 8 | about: Please report urgent production issues to the support portal directly. 9 | -------------------------------------------------------------------------------- /.github/auto_assign.yml: -------------------------------------------------------------------------------- 1 | addAssignees: author 2 | addReviewers: false 3 | runOnDraft: true 4 | -------------------------------------------------------------------------------- /.github/no-response.yml: -------------------------------------------------------------------------------- 1 | # Configuration for probot-no-response - https://github.com/probot/no-response 2 | 3 | # Number of days of inactivity before an Issue is closed for lack of response 4 | daysUntilClose: 14 5 | # Label requiring a response 6 | responseRequiredLabel: More-information-needed 7 | # Comment to post when closing an Issue for lack of response. Set to `false` to disable 8 | closeComment: > 9 | This issue has been automatically closed because there has been no response 10 | to our request for more information from the original author. With only the 11 | information that is currently in the issue, we don't have enough information 12 | to take action. Please reach out if you have or find the answers we need so 13 | that we can investigate further. 14 | -------------------------------------------------------------------------------- /.github/problem-matchers/detekt.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "detekt", 5 | "severity": "error", 6 | "pattern": [ 7 | { 8 | "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)", 9 | "file": 1, 10 | "line": 2, 11 | "column": 3, 12 | "message": 4 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.github/problem-matchers/ktlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "problemMatcher": [ 3 | { 4 | "owner": "ktlint", 5 | "severity": "error", 6 | "pattern": [ 7 | { 8 | "regexp": "(.+\\.kt):(\\d+):(\\d+):\\s(.*)", 9 | "file": 1, 10 | "line": 2, 11 | "column": 3, 12 | "message": 4 13 | } 14 | ] 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /.github/workflows/Issue-Needs-Attention.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: Issue Needs Attention 5 | # This workflow is triggered on issue comments. 6 | on: 7 | issue_comment: 8 | types: created 9 | 10 | jobs: 11 | applyNeedsAttentionLabel: 12 | uses: realm/ci-actions/.github/workflows/issue-needs-attention.yml@main 13 | -------------------------------------------------------------------------------- /.github/workflows/auto-assign.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: 'Auto Assign' 5 | on: 6 | pull_request: 7 | types: [opened] 8 | 9 | jobs: 10 | add-assignee: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: kentaro-m/auto-assign-action@248761c4feb3917c1b0444e33fad1a50093b9847 14 | -------------------------------------------------------------------------------- /.github/workflows/check-changelog.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: "Check Changelog" 5 | on: 6 | pull_request: 7 | types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] 8 | 9 | jobs: 10 | changelog: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@8230315d06ad95c617244d2f265d237a1682d445 15 | with: 16 | submodules: false 17 | - name: Enforce Changelog 18 | uses: dangoslen/changelog-enforcer@c0b9fd225180a405c5f21f7a74b99e2eccc3e951 19 | with: 20 | skipLabels: no-changelog 21 | missingUpdateErrorMessage: Please add an entry in CHANGELOG.md or apply the 'no-changelog' label to skip this check. 22 | -------------------------------------------------------------------------------- /.github/workflows/check-pr-title.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: "Check PR Title" 5 | on: 6 | pull_request: 7 | types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled, converted_to_draft, edited] 8 | 9 | jobs: 10 | check-pr-title: 11 | name: Check PR Title 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | with: 16 | submodules: false 17 | - name: Enforce PR title 18 | uses: realm/ci-actions/title-checker@main 19 | with: 20 | regex: R[A-Z]{2,6}-[0-9]{1,6} 21 | error-hint: Invalid PR title. Make sure it's prefixed with the JIRA ticket the PR addresses or add the no-jira-ticket label. 22 | ignore-labels: 'no-jira-ticket' -------------------------------------------------------------------------------- /.github/workflows/lock-threads.yml: -------------------------------------------------------------------------------- 1 | name: 'Lock Threads' 2 | 3 | on: 4 | schedule: 5 | - cron: '0 * * * *' 6 | workflow_dispatch: 7 | 8 | permissions: 9 | issues: write 10 | pull-requests: write 11 | discussions: write 12 | 13 | concurrency: 14 | group: lock-threads 15 | 16 | jobs: 17 | action: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: dessant/lock-threads@v5 21 | with: 22 | issue-inactive-days: 30 23 | pr-inactive-days: 30 24 | log-output: true 25 | -------------------------------------------------------------------------------- /.github/workflows/no-response.yml: -------------------------------------------------------------------------------- 1 | # NOTE: This is a common file that is overwritten by realm/ci-actions sync service 2 | # and should only be modified in that repository. 3 | 4 | name: No Response 5 | 6 | # Both `issue_comment` and `scheduled` event types are required for this Action 7 | # to work properly. 8 | on: 9 | issue_comment: 10 | types: [created] 11 | schedule: 12 | # Schedule at 00:00 every day 13 | - cron: '0 0 * * *' 14 | 15 | jobs: 16 | noResponse: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: lee-dohm/no-response@v0.5.0 20 | with: 21 | token: ${{ github.token }} 22 | responseRequiredLabel: More-information-needed 23 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/core"] 2 | path = packages/external/core 3 | url = https://github.com/realm/realm-core.git 4 | branch = su/c-api 5 | -------------------------------------------------------------------------------- /benchmarks/androidApp/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 16 | -------------------------------------------------------------------------------- /benchmarks/androidApp/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /benchmarks/buildSrc: -------------------------------------------------------------------------------- 1 | ../buildSrc -------------------------------------------------------------------------------- /benchmarks/gradle.properties: -------------------------------------------------------------------------------- 1 | #Gradle 2 | org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" 3 | 4 | #Kotlin 5 | kotlin.code.style=official 6 | 7 | #Android 8 | android.useAndroidX=true 9 | 10 | kotlin.mpp.applyDefaultHierarchyTemplate=false 11 | -------------------------------------------------------------------------------- /benchmarks/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/benchmarks/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /benchmarks/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /benchmarks/jvmApp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | java 3 | id("me.champeau.jmh") version Versions.jmhPlugin 4 | } 5 | apply(plugin = "kotlin") 6 | 7 | dependencies { 8 | jmh(project(":shared")) 9 | jmh("io.realm.kotlin:library-sync:${Realm.version}") 10 | jmh("org.openjdk.jmh:jmh-core:${Versions.jmh}") 11 | jmh("org.openjdk.jmh:jmh-generator-annprocess:${Versions.jmh}") 12 | } 13 | 14 | jmh { 15 | if (extra.has("jmh.include")) { 16 | includes.add(extra.get("jmh.include") as String) 17 | } 18 | resultFormat.set("json") 19 | resultsFile.set(file("build/reports/benchmarks.json")) 20 | } 21 | 22 | tasks.withType { 23 | kotlinOptions.jvmTarget = "11" 24 | } 25 | -------------------------------------------------------------------------------- /benchmarks/shared/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /buildSrc/buildSrc/build.gradle.kts: -------------------------------------------------------------------------------- 1 | // Work-around for how Gradle initializes projects and buildSrc. Without this, it would not be possible to 2 | // access the classes defined in Constants.kt within the buildSrc project itself. 3 | // See https://github.com/gradle/gradle/issues/11090#issuecomment-674798423 and https://github.com/Kotlin/dokka/pull/1321 4 | plugins { 5 | `kotlin-dsl` 6 | } 7 | repositories.mavenCentral() 8 | sourceSets.main { 9 | java { 10 | setSrcDirs(setOf(projectDir.parentFile.resolve("src/main/kotlin"))) 11 | include("Config.kt") 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /buildSrc/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.options.suppressFreeCompilerArgsModificationWarning=true 17 | -------------------------------------------------------------------------------- /buildSrc/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | // Intentional empty, see https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins 18 | -------------------------------------------------------------------------------- /config/detekt/baseline.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /config/ktlint/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{kt,kts}] 2 | # possible values: number (e.g. 2), "unset" (makes ktlint ignore indentation completely) 3 | indent_size=4 4 | # true (recommended) / false 5 | insert_final_newline=true 6 | # possible values: number (e.g. 120) (package name, imports & comments are ignored), "off" 7 | # it's automatically set to 100 on `ktlint --android ...` (per Android Kotlin Style Guide) 8 | max_line_length=off 9 | -------------------------------------------------------------------------------- /dependencies.list: -------------------------------------------------------------------------------- 1 | # Version of MongoDB Realm used by integration tests 2 | # See https://github.com/realm/ci/packages/147854 for available versions 3 | MONGODB_REALM_SERVER=2024-01-22 4 | 5 | # `BAAS` and `BAAS-UI` projects commit hashes matching MONGODB_REALM_SERVER image version 6 | # note that the MONGODB_REALM_SERVER image is a nightly build, find the matching commits 7 | # for that date within the following repositories: 8 | # https://github.com/10gen/baas/ 9 | # https://github.com/10gen/baas-ui/ 10 | REALM_BAAS_GIT_HASH=97b7445b1634c7a93fbabefc50967b41ce3cc330 11 | REALM_BAAS_UI_GIT_HASH=f5f5d71e634c2a64d08b2f911e2d7bf91d9cceda 12 | -------------------------------------------------------------------------------- /examples/kmm-sample/README.md: -------------------------------------------------------------------------------- 1 | # Realm Multiplatform Sample 2 | 3 | A _Kotlin Multiplatform Mobile (KMM) Project_ showing usage of Realm Kotlin in a shared module of a 4 | multiplatform project for both Android and iOS. 5 | 6 | The example is based on the Kotlin Multiplatform Mobile Project from 7 | https://github.com/Kotlin/kmm-sample/blob/master/README.md 8 | 9 | ## Overview 10 | 11 | The Realm Kotlin Multiplatform SDK is used to provide an common implementation of an 12 | `ExpressionRepository` for storing a computation history of calculations performed in the respective 13 | apps. The repository is implemented once in the `commonMain` source set of the `shared`-module and 14 | is triggered by the shared `Calculator`-implementation from the original KMM-sample project. 15 | 16 | ## References 17 | 18 | For instructions on developing Kotlin Multiplatform Mobile Project, visit 19 | [Kotlin Multiplatform Mobile Developer Portal](https://kotlinlang.org/lp/mobile/). 20 | -------------------------------------------------------------------------------- /examples/kmm-sample/androidApp/proguard-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/kmm-sample/androidApp/proguard-rules.pro -------------------------------------------------------------------------------- /examples/kmm-sample/androidApp/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | #FF6200EE 21 | #FF3700B3 22 | #FF03DAC5 23 | #FF018786 24 | #FF000000 25 | #FFFFFFFF 26 | 27 | -------------------------------------------------------------------------------- /examples/kmm-sample/build.gradle.kts: -------------------------------------------------------------------------------- 1 | buildscript { 2 | extra["ciBuild"] = Realm.ciBuild 3 | repositories { 4 | if (extra["ciBuild"] as Boolean) { 5 | maven(url = "file://${rootProject.rootDir.absolutePath}/../../packages/build/m2-buildrepo") 6 | } 7 | google() 8 | mavenCentral() 9 | maven(url = "https://oss.sonatype.org/content/repositories/snapshots") 10 | } 11 | dependencies { 12 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.latestKotlin}") 13 | classpath("com.android.tools.build:gradle:${Versions.Android.buildTools}") 14 | classpath ("io.realm.kotlin:gradle-plugin:${Realm.version}") 15 | } 16 | } 17 | group = "io.realm.example" 18 | version = Realm.version 19 | 20 | allprojects { 21 | repositories { 22 | if (rootProject.extra["ciBuild"] as Boolean) { 23 | maven("file://${rootProject.rootDir.absolutePath}/../../packages/build/m2-buildrepo") 24 | } 25 | google() 26 | mavenCentral() 27 | maven(url = "https://oss.sonatype.org/content/repositories/snapshots") 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/kmm-sample/buildSrc: -------------------------------------------------------------------------------- 1 | ../../buildSrc -------------------------------------------------------------------------------- /examples/kmm-sample/compose-desktop/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.compose.compose 2 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile 3 | 4 | plugins { 5 | kotlin("jvm") 6 | id("org.jetbrains.compose") version "1.2.0-alpha01-dev774" 7 | application 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev") 13 | } 14 | 15 | dependencies { 16 | implementation(compose.desktop.currentOs) 17 | implementation(project(":shared")) 18 | } 19 | 20 | tasks.withType { 21 | kotlinOptions.jvmTarget = Versions.kotlinJvmTarget 22 | } 23 | 24 | application { 25 | mainClass.set("MainKt") 26 | } 27 | -------------------------------------------------------------------------------- /examples/kmm-sample/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/kmm-sample/debug.keystore -------------------------------------------------------------------------------- /examples/kmm-sample/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2020 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | org.gradle.jvmargs=-Xms512m -Xmx2048m 19 | 20 | kotlin.code.style=official 21 | xcodeproj=./iosApp 22 | android.useAndroidX=true 23 | kotlin.mpp.applyDefaultHierarchyTemplate=false 24 | kotlin.mpp.stability.nowarn=true 25 | kotlin.mpp.androidSourceSetLayoutVersion1.nowarn=true 26 | -------------------------------------------------------------------------------- /examples/kmm-sample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/kmm-sample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/kmm-sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/File: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/kmm-sample/iosApp/File -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosAppTests/iosAppTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import iosApp 3 | 4 | class iosAppTests: XCTestCase { 5 | 6 | override func setUp() { 7 | // Put setup code here. This method is called before the invocation of each test method in the class. 8 | } 9 | 10 | override func tearDown() { 11 | // Put teardown code here. This method is called after the invocation of each test method in the class. 12 | } 13 | 14 | func testExample() { 15 | // This is an example of a functional test case. 16 | // Use XCTAssert and related functions to verify your tests produce the correct results. 17 | } 18 | 19 | func testPerformanceExample() { 20 | // This is an example of a performance test case. 21 | self.measure { 22 | // Put the code you want to measure the time of here. 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /examples/kmm-sample/iosApp/iosAppUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/kmm-sample/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | // For local development, we use composite builds. 2 | // For CI buils, the packages are expected to have 3 | // been built and deployed to a local filesystem 4 | // maven repo. We cannot reference `Realm.ciBuild` 5 | // from buildSrc here. 6 | if (System.getenv("CI") == null) { 7 | includeBuild("../../packages") 8 | } 9 | 10 | pluginManagement { 11 | repositories { 12 | gradlePluginPortal() 13 | mavenCentral() 14 | maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") 15 | google() 16 | } 17 | } 18 | rootProject.name = "KmmSample" 19 | 20 | include(":androidApp") 21 | include(":shared") 22 | include(":compose-desktop") 23 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/androidInstrumentedTest/kotlin/io/realm/example/kmmsample/GreetingTestAndroid.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | import org.junit.Assert 22 | import org.junit.Test 23 | 24 | class GreetingTestAndroid { 25 | 26 | @Test 27 | fun testExample() { 28 | Assert.assertTrue("Check Android is mentioned", Greeting().greeting().contains("Android")) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/androidMain/kotlin/io/realm/example/kmmsample/Platform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | @Suppress("EmptyDefaultConstructor", "MemberNameEqualsClassName") 22 | actual class Platform actual constructor() { 23 | actual val platform: String = "Android ${android.os.Build.VERSION.SDK_INT}" 24 | } 25 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/Expression.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | import io.realm.kotlin.types.RealmObject 22 | 23 | class Expression : RealmObject { 24 | var expressionString: String = "" 25 | } 26 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/Greeting.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | class Greeting { 22 | @Suppress("MemberNameEqualsClassName") 23 | fun greeting(): String { 24 | return "Hello, ${Platform().platform}!" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/commonMain/kotlin/io/realm/example/kmmsample/Platform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | @Suppress("EmptyDefaultConstructor", "MemberNameEqualsClassName") 22 | expect class Platform() { 23 | val platform: String 24 | } 25 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/commonTest/kotlin/io/realm/example/kmmsample/CalculatorTest.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | import kotlin.test.Test 22 | import kotlin.test.assertEquals 23 | 24 | class CalculatorTest { 25 | 26 | @Test 27 | fun testSum() { 28 | assertEquals(3, Calculator.sum(1, 2)) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/iosMain/kotlin/io/realm/example/kmmsample/Platform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | import platform.UIKit.UIDevice 22 | 23 | @Suppress("EmptyDefaultConstructor", "MemberNameEqualsClassName") 24 | actual class Platform actual constructor() { 25 | actual val platform: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion 26 | } 27 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/iosTest/kotlin/io/realm/example/kmmsample/GreetingTestIos.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2020 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | import kotlin.test.Test 22 | import kotlin.test.assertTrue 23 | 24 | class GreetingTestIos { 25 | 26 | @Test 27 | fun testExample() { 28 | assertTrue(Greeting().greeting().contains("iOS"), "Check iOS is mentioned") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /examples/kmm-sample/shared/src/jvmMain/kotlin/io/realm/example/kmmsample/Platform.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 JetBrains s.r.o. 3 | * Copyright 2021 Realm Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 14 | * or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | package io.realm.example.kmmsample 20 | 21 | @Suppress("EmptyDefaultConstructor", "MemberNameEqualsClassName") 22 | actual class Platform actual constructor() { 23 | actual val platform: String = "JVM running on: ${System.getProperty("os.name")}" 24 | } 25 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("com.android.application") 3 | kotlin("android") 4 | } 5 | 6 | android { 7 | compileSdk = 31 8 | defaultConfig { 9 | applicationId = "io.realm.example.minandroidsample.android" 10 | minSdk = 16 11 | targetSdk = 31 12 | versionCode = 1 13 | versionName = "1.0" 14 | } 15 | buildTypes { 16 | getByName("release") { 17 | isMinifyEnabled = false 18 | } 19 | } 20 | compileOptions { 21 | sourceCompatibility = JavaVersion.VERSION_1_8 22 | targetCompatibility = JavaVersion.VERSION_1_8 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation(project(":shared")) 28 | implementation("com.android.support:appcompat-v7:28.0.0") 29 | implementation("com.android.support.constraint:constraint-layout:2.0.4") 30 | } 31 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/java/io/realm/example/minandroidsample/android/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package io.realm.example.minandroidsample.android 2 | 3 | import android.support.v7.app.AppCompatActivity 4 | import android.os.Bundle 5 | import android.widget.TextView 6 | import io.realm.sample.minandroidsample.Greeting 7 | 8 | class MainActivity : AppCompatActivity() { 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.activity_main) 12 | findViewById(R.id.text).text = Greeting().greeting() 13 | } 14 | } -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | MinAndroidExample 3 | -------------------------------------------------------------------------------- /examples/min-android-sample/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | -------------------------------------------------------------------------------- /examples/min-android-sample/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # Kotlin code style for this project: "official" or "obsolete": 15 | kotlin.code.style=official 16 | android.useAndroidX=true 17 | 18 | org.gradle.configuration-cache=true 19 | -------------------------------------------------------------------------------- /examples/min-android-sample/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/min-android-sample/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/min-android-sample/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /examples/min-android-sample/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "MinAndroidExample" 2 | include(":shared") 3 | include(":app") 4 | -------------------------------------------------------------------------------- /examples/min-android-sample/shared/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask 2 | 3 | plugins { 4 | kotlin("multiplatform") 5 | id("com.android.library") 6 | id("io.realm.kotlin") 7 | } 8 | 9 | version = "1.0" 10 | 11 | kotlin { 12 | jvm() 13 | androidTarget() 14 | 15 | sourceSets { 16 | val commonMain by getting 17 | val commonTest by getting 18 | val androidMain by getting { 19 | dependencies { 20 | implementation("io.realm.kotlin:library-base:${rootProject.ext["realmVersion"]}") 21 | } 22 | } 23 | val androidInstrumentedTest by getting 24 | val jvmMain by getting 25 | } 26 | } 27 | 28 | android { 29 | compileSdk = 31 30 | sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") 31 | defaultConfig { 32 | minSdk = 16 33 | targetSdk = 31 34 | } 35 | } 36 | 37 | tasks.withType>().configureEach { 38 | compilerOptions { 39 | freeCompilerArgs.add("-Xexpect-actual-classes") 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /examples/min-android-sample/shared/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/min-android-sample/shared/src/androidMain/kotlin/io/realm/sample/minandroidsample/Platform.kt: -------------------------------------------------------------------------------- 1 | package io.realm.sample.minandroidsample 2 | 3 | import io.realm.kotlin.Realm 4 | import io.realm.kotlin.RealmConfiguration 5 | import io.realm.kotlin.types.RealmObject 6 | 7 | class Sample: RealmObject { 8 | var name: String = "" 9 | } 10 | 11 | actual class Platform actual constructor() { 12 | val config = RealmConfiguration.create(schema = setOf(Sample::class)) 13 | val realm = Realm.open(config) 14 | actual val platform: String = "Android ${android.os.Build.VERSION.SDK_INT}" 15 | } 16 | -------------------------------------------------------------------------------- /examples/min-android-sample/shared/src/commonMain/kotlin/io/realm/sample/minandroidsample/Greeting.kt: -------------------------------------------------------------------------------- 1 | package io.realm.sample.minandroidsample 2 | 3 | class Greeting { 4 | fun greeting(): String { 5 | return "Hello, ${Platform().platform}!" 6 | } 7 | } -------------------------------------------------------------------------------- /examples/min-android-sample/shared/src/commonMain/kotlin/io/realm/sample/minandroidsample/Platform.kt: -------------------------------------------------------------------------------- 1 | package io.realm.sample.minandroidsample 2 | 3 | expect class Platform() { 4 | val platform: String 5 | } -------------------------------------------------------------------------------- /examples/min-android-sample/shared/src/jvmMain/kotlin/io/realm/sample/minandroidsample/Platform.kt: -------------------------------------------------------------------------------- 1 | package io.realm.sample.minandroidsample 2 | 3 | actual class Platform actual constructor() { 4 | actual val platform: String = "JVM running on: ${System.getProperty("os.name")}" 5 | } -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/java/io/realm/kotlin/demo/javacompatibility/data/Repository.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.demo.javacompatibility.data 18 | 19 | interface Repository { 20 | val count: Int 21 | } 22 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | 11 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Realm Java compatibility Demo 3 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /examples/realm-java-compatibility/buildSrc: -------------------------------------------------------------------------------- 1 | ../../buildSrc -------------------------------------------------------------------------------- /examples/realm-java-compatibility/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/examples/realm-java-compatibility/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /examples/realm-java-compatibility/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /images/RootGradle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/images/RootGradle.png -------------------------------------------------------------------------------- /images/SharedGradle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/images/SharedGradle.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/images/favicon.ico -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/images/logo.png -------------------------------------------------------------------------------- /integration-tests/README.md: -------------------------------------------------------------------------------- 1 | # Integration test projects 2 | 3 | This folder holds the various integration test projects. 4 | 5 | - `gradle/` - Various smoke test project that verifies that our top level Gradle plugin can be 6 | applied on a both single and a multi platform modules. It is currently testing: 7 | - `single-platform` - Android single module project 8 | - `multi-platform` - Kotlin Multiplatform project with JVM and Native targets running on the host 9 | platform. 10 | There are various project with specific Gradle versions that has been proven troublesome with 11 | regards to collecting analytics data and a `current` project that will use the versions used to 12 | build the SDK. 13 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/buildSrc: -------------------------------------------------------------------------------- 1 | ../../../buildSrc -------------------------------------------------------------------------------- /integration-tests/gradle/current/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kotlin.code.style=official 19 | 20 | org.gradle.jvmargs=-Xmx4096M 21 | 22 | android.useAndroidX=true 23 | android.enableJetifier=true 24 | 25 | kotlin.mpp.stability.nowarn=true 26 | 27 | # Enable new memory model as default 28 | kotlin.native.binary.memoryModel=experimental 29 | kotlin.native.binary.freezing=disabled 30 | 31 | org.gradle.configuration-cache=true 32 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/current/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integration-tests/gradle/current/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/multi-platform/src/commonMain/kotlin/io/realm/test/multiplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util 19 | 20 | object Utils { 21 | fun createRandomString(length: Int): String { 22 | val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') 23 | return (1..length) 24 | .map { allowedChars.random() } 25 | .joinToString("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util.platform 19 | 20 | import io.realm.test.multiplatform.util.Utils 21 | 22 | expect object PlatformUtils { 23 | fun createTempDir(prefix: String = Utils.createRandomString(16)): String 24 | fun deleteTempDir(path: String) 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/single-platform/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/current/single-platform/consumer-rules.pro -------------------------------------------------------------------------------- /integration-tests/gradle/current/single-platform/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/single-platform/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/single-platform/src/main/java/io/realm/test/singleplatform/model/Pojo.java: -------------------------------------------------------------------------------- 1 | package io.realm.test.singleplatform.model; 2 | 3 | // This class is only added to verify that we can access the Realm Model classes from plain old 4 | // Java source. See issue for further details https://github.com/realm/realm-kotlin/issues/1256 5 | public class Pojo { 6 | TestClass o = new TestClass(); 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/current/single-platform/src/main/kotlin/io/realm/test/singleplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.singleplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kotlin.code.style=official 19 | 20 | org.gradle.jvmargs=-Xmx4096M 21 | 22 | android.useAndroidX=true 23 | android.enableJetifier=true 24 | 25 | kotlin.mpp.stability.nowarn=true 26 | 27 | # Enable new memory model as default 28 | kotlin.native.binary.memoryModel=experimental 29 | kotlin.native.binary.freezing=disabled 30 | 31 | org.gradle.configuration-cache=true 32 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle72-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/multi-platform/src/commonMain/kotlin/io/realm/test/multiplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util 19 | 20 | object Utils { 21 | fun createRandomString(length: Int): String { 22 | val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') 23 | return (1..length) 24 | .map { allowedChars.random() } 25 | .joinToString("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util.platform 19 | 20 | import io.realm.test.multiplatform.util.Utils 21 | 22 | expect object PlatformUtils { 23 | fun createTempDir(prefix: String = Utils.createRandomString(16)): String 24 | fun deleteTempDir(path: String) 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/single-platform/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle72-test/single-platform/consumer-rules.pro -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/single-platform/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/single-platform/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/single-platform/src/main/java/io/realm/test/singleplatform/model/Pojo.java: -------------------------------------------------------------------------------- 1 | package io.realm.test.singleplatform.model; 2 | 3 | // This class is only added to verify that we can access the Realm Model classes from plain old 4 | // Java source. See issue for further details https://github.com/realm/realm-kotlin/issues/1256 5 | public class Pojo { 6 | TestClass o = new TestClass(); 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle72-test/single-platform/src/main/kotlin/io/realm/test/singleplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.singleplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kotlin.code.style=official 19 | 20 | org.gradle.jvmargs=-Xmx4096M 21 | 22 | android.useAndroidX=true 23 | android.enableJetifier=true 24 | 25 | kotlin.mpp.stability.nowarn=true 26 | 27 | # Enable new memory model as default 28 | kotlin.native.binary.memoryModel=experimental 29 | kotlin.native.binary.freezing=disabled 30 | 31 | org.gradle.configuration-cache=true 32 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle75-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/multi-platform/src/commonMain/kotlin/io/realm/test/multiplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util 19 | 20 | object Utils { 21 | fun createRandomString(length: Int): String { 22 | val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') 23 | return (1..length) 24 | .map { allowedChars.random() } 25 | .joinToString("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util.platform 19 | 20 | import io.realm.test.multiplatform.util.Utils 21 | 22 | expect object PlatformUtils { 23 | fun createTempDir(prefix: String = Utils.createRandomString(16)): String 24 | fun deleteTempDir(path: String) 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/single-platform/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle75-test/single-platform/consumer-rules.pro -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/single-platform/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/single-platform/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/single-platform/src/main/java/io/realm/test/singleplatform/model/Pojo.java: -------------------------------------------------------------------------------- 1 | package io.realm.test.singleplatform.model; 2 | 3 | // This class is only added to verify that we can access the Realm Model classes from plain old 4 | // Java source. See issue for further details https://github.com/realm/realm-kotlin/issues/1256 5 | public class Pojo { 6 | TestClass o = new TestClass(); 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle75-test/single-platform/src/main/kotlin/io/realm/test/singleplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.singleplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kotlin.code.style=official 19 | 20 | org.gradle.jvmargs=-Xmx4096M 21 | 22 | android.useAndroidX=true 23 | android.enableJetifier=true 24 | 25 | kotlin.mpp.stability.nowarn=true 26 | 27 | # Enable new memory model as default 28 | #kotlin.native.binary.memoryModel=experimental 29 | #kotlin.native.binary.freezing=disabled 30 | 31 | org.gradle.configuration-cache=true 32 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle8-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/multi-platform/src/commonMain/kotlin/io/realm/test/multiplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util 19 | 20 | object Utils { 21 | fun createRandomString(length: Int): String { 22 | val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') 23 | return (1..length) 24 | .map { allowedChars.random() } 25 | .joinToString("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util.platform 19 | 20 | import io.realm.test.multiplatform.util.Utils 21 | 22 | expect object PlatformUtils { 23 | fun createTempDir(prefix: String = Utils.createRandomString(16)): String 24 | fun deleteTempDir(path: String) 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/single-platform/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle8-test/single-platform/consumer-rules.pro -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/single-platform/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/single-platform/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/single-platform/src/main/java/io/realm/test/singleplatform/model/Pojo.java: -------------------------------------------------------------------------------- 1 | package io.realm.test.singleplatform.model; 2 | 3 | // This class is only added to verify that we can access the Realm Model classes from plain old 4 | // Java source. See issue for further details https://github.com/realm/realm-kotlin/issues/1256 5 | public class Pojo { 6 | TestClass o = new TestClass(); 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle8-test/single-platform/src/main/kotlin/io/realm/test/singleplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.singleplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2022 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | # or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | kotlin.code.style=official 19 | 20 | org.gradle.jvmargs=-Xmx4096M 21 | 22 | android.useAndroidX=true 23 | android.enableJetifier=true 24 | 25 | kotlin.mpp.stability.nowarn=true 26 | 27 | # Enable new memory model as default 28 | #kotlin.native.binary.memoryModel=experimental 29 | #kotlin.native.binary.freezing=disabled 30 | 31 | org.gradle.configuration-cache=true 32 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle85-test/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/multi-platform/src/commonMain/kotlin/io/realm/test/multiplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/Utils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util 19 | 20 | object Utils { 21 | fun createRandomString(length: Int): String { 22 | val allowedChars = ('A'..'Z') + ('a'..'z') + ('0'..'9') 23 | return (1..length) 24 | .map { allowedChars.random() } 25 | .joinToString("") 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/multi-platform/src/commonTest/kotlin/io/realm/test/multiplatform/util/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.multiplatform.util.platform 19 | 20 | import io.realm.test.multiplatform.util.Utils 21 | 22 | expect object PlatformUtils { 23 | fun createTempDir(prefix: String = Utils.createRandomString(16)): String 24 | fun deleteTempDir(path: String) 25 | } 26 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/single-platform/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/integration-tests/gradle/gradle85-test/single-platform/consumer-rules.pro -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/single-platform/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/single-platform/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/single-platform/src/main/java/io/realm/test/singleplatform/model/Pojo.java: -------------------------------------------------------------------------------- 1 | package io.realm.test.singleplatform.model; 2 | 3 | // This class is only added to verify that we can access the Realm Model classes from plain old 4 | // Java source. See issue for further details https://github.com/realm/realm-kotlin/issues/1256 5 | public class Pojo { 6 | TestClass o = new TestClass(); 7 | } 8 | -------------------------------------------------------------------------------- /integration-tests/gradle/gradle85-test/single-platform/src/main/kotlin/io/realm/test/singleplatform/model/TestClass.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.test.singleplatform.model 19 | 20 | import io.realm.kotlin.types.RealmObject 21 | import io.realm.kotlin.types.annotations.PrimaryKey 22 | 23 | class TestClass : RealmObject { 24 | @PrimaryKey 25 | var id: Long = 0 26 | 27 | var text: String = "INIT" 28 | } 29 | -------------------------------------------------------------------------------- /packages/buildSrc: -------------------------------------------------------------------------------- 1 | ../buildSrc -------------------------------------------------------------------------------- /packages/cinterop/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.enableCInteropCommonization=true 17 | kotlin.mpp.applyDefaultHierarchyTemplate=false 18 | -------------------------------------------------------------------------------- /packages/cinterop/src/androidMain/kotlin/io/realm/kotlin/internal/AndroidUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal 2 | 3 | import android.content.Context 4 | import com.getkeepsafe.relinker.ReLinker 5 | 6 | /** 7 | * Manually load the Android native libs. Must be called before any methods on RealmInterop is 8 | * called. This is done as part of the `RealmInitializer` class that is controlled by Jetpack 9 | * Startup library. 10 | * 11 | * On JVM and Native, this will happen automatically when first loading the RealmInterop class. 12 | */ 13 | @Suppress("MagicNumber") 14 | fun loadAndroidNativeLibs(context: Context, version: String) { 15 | // Only use Relinker below API 23, since all bugs it fixes are only present there. 16 | // Also, see if this might fix https://github.com/realm/realm-kotlin/issues/1202 17 | if (android.os.Build.VERSION.SDK_INT < 23) { 18 | ReLinker.loadLibrary(context, "realmc", version) 19 | } else { 20 | System.loadLibrary("realmc") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.kotlin.internal.interop 19 | 20 | object Constants { 21 | const val ENCRYPTION_KEY_LENGTH = 64 22 | } 23 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/CoreCompensatingWriteInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.realm.kotlin.internal.interop.sync 17 | 18 | import io.realm.kotlin.internal.interop.RealmValue 19 | 20 | expect class CoreCompensatingWriteInfo { 21 | val reason: String 22 | val objectName: String 23 | val primaryKey: RealmValue 24 | } 25 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/CoreConnectionState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop.sync 18 | 19 | expect enum class CoreConnectionState { 20 | RLM_SYNC_CONNECTION_STATE_DISCONNECTED, 21 | RLM_SYNC_CONNECTION_STATE_CONNECTING, 22 | RLM_SYNC_CONNECTION_STATE_CONNECTED; 23 | } 24 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/CoreUserState.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop.sync 18 | 19 | /** 20 | * Wrapper for C-API `realm_user_state`. 21 | * See https://github.com/realm/realm-core/blob/master/src/realm.h#L2513 22 | */ 23 | expect enum class CoreUserState { 24 | RLM_USER_STATE_LOGGED_OUT, 25 | RLM_USER_STATE_LOGGED_IN, 26 | RLM_USER_STATE_REMOVED 27 | } 28 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/MetadataMode.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop.sync 18 | 19 | /** 20 | * Wrapper for C-API `realm_sync_client_metadata_mode`. 21 | * See https://github.com/realm/realm-core/blob/master/src/realm.h#L3155 22 | */ 23 | expect enum class MetadataMode { 24 | RLM_SYNC_CLIENT_METADATA_MODE_DISABLED, 25 | RLM_SYNC_CLIENT_METADATA_MODE_PLAINTEXT, 26 | RLM_SYNC_CLIENT_METADATA_MODE_ENCRYPTED 27 | } 28 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/ProgressDirection.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop.sync 18 | 19 | expect enum class ProgressDirection { 20 | RLM_SYNC_PROGRESS_DIRECTION_UPLOAD, 21 | RLM_SYNC_PROGRESS_DIRECTION_DOWNLOAD, 22 | } 23 | -------------------------------------------------------------------------------- /packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/sync/SyncUserIdentity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop.sync 18 | 19 | /** 20 | * Wrapper for `realm_user_identity`. 21 | * @see https://github.com/realm/realm-core/blob/master/src/realm.h 22 | */ 23 | data class SyncUserIdentity(val id: String, val provider: AuthProvider) 24 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/jni/java_class_global_def.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "java_class_global_def.hpp" 18 | 19 | using namespace realm; 20 | using namespace realm::_impl; 21 | 22 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/ClassFlags.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop 18 | 19 | actual object ClassFlags { 20 | actual val RLM_CLASS_NORMAL = realm_class_flags_e.RLM_CLASS_NORMAL 21 | actual val RLM_CLASS_EMBEDDED = realm_class_flags_e.RLM_CLASS_EMBEDDED 22 | actual val RLM_CLASS_ASYMMETRIC = realm_class_flags_e.RLM_CLASS_ASYMMETRIC 23 | } 24 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/Enumerated.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop 18 | 19 | // Interface to hold C API enumerated constant reference by SWIG constant 20 | interface Enumerated { 21 | val value: Int 22 | } 23 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/NativeEnumerated.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop 18 | 19 | // Interface to hold C API enumerated constant reference by SWIG constant 20 | interface NativeEnumerated { 21 | val nativeValue: Int 22 | } 23 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/NotificationCallback.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.kotlin.internal.interop 19 | 20 | /** 21 | * Internal callback used from JNI to notify RealmResults or RealmObject changes. 22 | */ 23 | interface NotificationCallback { 24 | fun onChange(pointer: Long) 25 | } 26 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/SynchronizableObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal.interop 18 | 19 | actual class SynchronizableObject { 20 | actual inline fun withLock(block: () -> R): R = synchronized(this) { block() } 21 | } 22 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/sync/CoreCompensatingWriteInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.realm.kotlin.internal.interop.sync 17 | 18 | import io.realm.kotlin.internal.interop.RealmValue 19 | import io.realm.kotlin.internal.interop.wrapPtrAsRealmValueT 20 | 21 | actual class CoreCompensatingWriteInfo( 22 | actual val reason: String, 23 | actual val objectName: String, 24 | primaryKeyPtr: Long 25 | ) { 26 | 27 | actual val primaryKey: RealmValue = RealmValue(primaryKeyPtr.wrapPtrAsRealmValueT()) 28 | } 29 | -------------------------------------------------------------------------------- /packages/cinterop/src/jvm/realm-core: -------------------------------------------------------------------------------- 1 | ../../../external/core -------------------------------------------------------------------------------- /packages/cinterop/src/nativeDarwin/kotlin/io/realm/kotlin/internal/interop/sync/CoreCompensatingWriteInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.realm.kotlin.internal.interop.sync 17 | 18 | import io.realm.kotlin.internal.interop.RealmValue 19 | 20 | actual class CoreCompensatingWriteInfo( 21 | actual val reason: String, 22 | actual val objectName: String, 23 | actual val primaryKey: RealmValue 24 | ) 25 | -------------------------------------------------------------------------------- /packages/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /packages/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /packages/library-base/README.md: -------------------------------------------------------------------------------- 1 | A POC of a Realm Kotlin Multiplatform library. 2 | 3 | # Building the project 4 | 5 | - First [build](./cpp_engine/README.md) the CPP binaries. 6 | - Publish the library locally 7 | ``` 8 | cd packages 9 | ./gradlew publishToMavenLocal 10 | ``` 11 | 12 | # Running Tests: 13 | 14 | ## Running test on iOS 15 | - Start a `x86_64` simulator _(tested on iPhone 11 Pro Max)_ 16 | - Run from `/gradlew iosTest` 17 | 18 | ## Running test on Android 19 | - Start an `x86_64` emulator 20 | - Run from `/gradlew connectedAndroidTest` 21 | 22 | # Example project 23 | 24 | A sample project under [example](../example) directory demonstrate how to consume this library in a Multiplatform Kotlin Project targeting iOS and Android. 25 | -------------------------------------------------------------------------------- /packages/library-base/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.applyDefaultHierarchyTemplate=false 17 | -------------------------------------------------------------------------------- /packages/library-base/overview.md: -------------------------------------------------------------------------------- 1 | # Module Realm Kotlin Multiplatform SDK 2 | 3 | Module containing all documentation on configuration and usage of local realms. 4 | -------------------------------------------------------------------------------- /packages/library-base/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 20 | 21 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Deleteable.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin 18 | 19 | import io.realm.kotlin.dynamic.DynamicMutableRealm 20 | 21 | /** 22 | * A **deleteable** is an entity that can be deleted in a write transaction or as part of a 23 | * migration. 24 | * 25 | * @see MutableRealm.delete 26 | * @see DynamicMutableRealm.delete 27 | */ 28 | public interface Deleteable 29 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/UpdatePolicy.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin 2 | 3 | /** 4 | * Update policy that controls how to handle import of objects with existing primary keys when 5 | * import them with [MutableRealm.copyToRealm] and 6 | * [io.realm.kotlin.dynamic.DynamicMutableRealm.copyToRealm]. 7 | * 8 | * @see MutableRealm.copyToRealm 9 | * @see DynamicMutableRealm.copyToRealm 10 | */ 11 | public enum class UpdatePolicy { 12 | /** 13 | * Update policy that will disallow updating existing objects and instead throw an exception if 14 | * an object already exists with the same primary key. 15 | */ 16 | ERROR, 17 | 18 | /** 19 | * Update policy that will update all properties on any existing objects identified with the same 20 | * primary key. Properties will be marked as updated in change listeners, even if the property 21 | * was updated to the same value. 22 | */ 23 | ALL, 24 | } 25 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/Versioned.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 10 | * or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | * 14 | */ 15 | 16 | package io.realm.kotlin 17 | 18 | public interface Versioned { 19 | /** 20 | * Returns the Realm version of this object. This version number is tied to the transaction the object was read from. 21 | */ 22 | public fun version(): VersionId 23 | } 24 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/dynamic/info.md: -------------------------------------------------------------------------------- 1 | # package io.realm.kotlin.dynamic 2 | 3 | Interfaces for accessing realms through a dynamic string based API. 4 | 5 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/exceptions/RealmException.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.exceptions 2 | 3 | /** 4 | * Top level class for all exceptions that are Realm specific and doesn't have a better 5 | * existing platform exception like [IllegalArgumentException] or [IllegalStateException]. 6 | * 7 | * In most cases, a subclass of this type will be thrown. Exactly which, will will be documented by 8 | * the individual API entry points. 9 | */ 10 | public open class RealmException : RuntimeException { 11 | public constructor() : super() 12 | public constructor(message: String?) : super(message) 13 | public constructor(message: String?, cause: Throwable?) : super(message, cause) 14 | public constructor(cause: Throwable?) : super(cause) 15 | } 16 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/info.md: -------------------------------------------------------------------------------- 1 | # Package io.realm.kotlin 2 | 3 | Core functions and types. 4 | 5 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal 18 | 19 | internal object Constants { 20 | internal const val FILE_COPY_BUFFER_SIZE = 4096 21 | } 22 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/VersionData.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.internal 18 | 19 | import io.realm.kotlin.VersionId 20 | 21 | /** 22 | * Version meta data for a single instance. 23 | */ 24 | public data class VersionData(val current: VersionId?, val active: Set) { 25 | val versions: Set = (current?.let { setOf(it) } ?: emptySet()) + active 26 | } 27 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/geo/UnmanagedGeoCircle.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.geo 2 | 3 | import io.realm.kotlin.annotations.ExperimentalGeoSpatialApi 4 | import io.realm.kotlin.types.geo.Distance 5 | import io.realm.kotlin.types.geo.GeoCircle 6 | import io.realm.kotlin.types.geo.GeoPoint 7 | 8 | @OptIn(ExperimentalGeoSpatialApi::class) 9 | public data class UnmanagedGeoCircle( 10 | public override val center: GeoPoint, 11 | public override val radius: Distance 12 | ) : GeoCircle { 13 | init { 14 | if (radius.inRadians < 0) { 15 | // Currently `Distance` does not allow negative values, but since a UDouble doesn't 16 | // exists, we also validate the input here, just in case. 17 | throw IllegalArgumentException("A negative radius is not allowed: $radius") 18 | } 19 | } 20 | 21 | override fun toString(): String { 22 | return "geoCircle([${center.longitude}, ${center.latitude}], ${radius.inRadians})" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/platform/WeakReference.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.platform 2 | 3 | /** 4 | * Platform agnostic _WeakReference_ wrapper. 5 | * 6 | * Basically just wrapping underlying platform implementations. 7 | */ 8 | // TODO This is currently public because making it public breaks something in Kotlins type check for Strict mode 9 | public expect class WeakReference(referred: T) { 10 | public fun clear() 11 | public fun get(): T? 12 | } 13 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/query/QueryUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.query 2 | 3 | import io.realm.kotlin.internal.Mediator 4 | import io.realm.kotlin.internal.RealmReference 5 | import io.realm.kotlin.internal.RealmResultsImpl 6 | import io.realm.kotlin.internal.interop.ClassKey 7 | import io.realm.kotlin.internal.interop.RealmInterop 8 | import io.realm.kotlin.internal.interop.RealmResultsPointer 9 | import io.realm.kotlin.types.BaseRealmObject 10 | import kotlin.reflect.KClass 11 | 12 | internal fun thawResults( 13 | liveRealm: RealmReference, 14 | resultsPointer: RealmResultsPointer, 15 | classKey: ClassKey, 16 | clazz: KClass, 17 | mediator: Mediator 18 | ): RealmResultsImpl { 19 | val liveResultPtr = RealmInterop.realm_results_resolve_in(resultsPointer, liveRealm.dbPointer) 20 | return RealmResultsImpl(liveRealm, liveResultPtr, classKey, clazz, mediator) 21 | } 22 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/RealmLogger.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.log 18 | 19 | /** 20 | * Interface describing a logger implementation. 21 | * 22 | * @see RealmLog 23 | */ 24 | public interface RealmLogger { 25 | /** 26 | * Log an event. 27 | */ 28 | public fun log( 29 | category: LogCategory, 30 | level: LogLevel, 31 | throwable: Throwable?, 32 | message: String?, 33 | vararg args: Any?, 34 | ) 35 | } 36 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/log/info.md: -------------------------------------------------------------------------------- 1 | # Package io.realm.kotlin.log 2 | 3 | Logging related functions and types. 4 | 5 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/migration/RealmMigration.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.migration 18 | 19 | import io.realm.kotlin.RealmConfiguration 20 | 21 | /** 22 | * A base class for the various **realm migration** schemes. 23 | * 24 | * The migration scheme controls how schema and data is migrated when there are changes to the realm 25 | * object model. 26 | * 27 | * @see RealmConfiguration.Builder.migration 28 | * @see AutomaticSchemaMigration 29 | */ 30 | public sealed interface RealmMigration 31 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/migration/info.md: -------------------------------------------------------------------------------- 1 | # package io.realm.kotlin 2 | 3 | Interfaces related to migration of realms. 4 | 5 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/notifications/internal/RealmChangeImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.notifications.internal 18 | 19 | import io.realm.kotlin.BaseRealm 20 | import io.realm.kotlin.notifications.InitialRealm 21 | import io.realm.kotlin.notifications.UpdatedRealm 22 | 23 | internal class InitialRealmImpl(override val realm: R) : InitialRealm 24 | 25 | internal class UpdatedRealmImpl(override val realm: R) : UpdatedRealm 26 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/query/Sort.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.query 18 | 19 | /** 20 | * This enum describes the sorting order used in Realm queries. 21 | * 22 | * @see [RealmQuery.sort] 23 | */ 24 | public enum class Sort { 25 | ASCENDING, 26 | DESCENDING 27 | } 28 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/BaseRealmObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.types 18 | 19 | import io.realm.kotlin.Deleteable 20 | 21 | /** 22 | * Base interface for all realm classes. 23 | */ 24 | public interface BaseRealmObject : Deleteable 25 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/RealmObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.types 18 | 19 | /** 20 | * Marker interface to define a model (managed by Realm). 21 | */ 22 | public interface RealmObject : TypedRealmObject 23 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/TypedRealmObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.types 18 | 19 | /** 20 | * Base interface for all statically typed realm classes. 21 | */ 22 | public interface TypedRealmObject : BaseRealmObject 23 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/annotations/Ignore.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.types.annotations 18 | 19 | @Retention(AnnotationRetention.RUNTIME) 20 | @Target(AnnotationTarget.FIELD, AnnotationTarget.PROPERTY) 21 | @MustBeDocumented 22 | /** 23 | * Annotation marking a field as ignored inside Realm, meaning that it will not be part of the models' schema. 24 | * 25 | * Any field in a [RealmObject] class can have this annotation. 26 | */ 27 | public annotation class Ignore 28 | -------------------------------------------------------------------------------- /packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/info.md: -------------------------------------------------------------------------------- 1 | # package io.realm.kotlin.types 2 | 3 | Package with all types used to define realm models 4 | -------------------------------------------------------------------------------- /packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/CoroutineUtilsSharedJvm.kt: -------------------------------------------------------------------------------- 1 | @file:OptIn(ExperimentalCoroutinesApi::class) 2 | 3 | package io.realm.kotlin.internal.platform 4 | 5 | import kotlinx.coroutines.CloseableCoroutineDispatcher 6 | import kotlinx.coroutines.CoroutineScope 7 | import kotlinx.coroutines.ExperimentalCoroutinesApi 8 | import kotlinx.coroutines.asCoroutineDispatcher 9 | import java.util.concurrent.Executors 10 | import kotlin.coroutines.CoroutineContext 11 | 12 | public actual fun singleThreadDispatcher(id: String): CloseableCoroutineDispatcher { 13 | return Executors.newSingleThreadExecutor { action: Runnable -> 14 | Thread(action).apply { 15 | name = id 16 | priority = Thread.NORM_PRIORITY 17 | } 18 | }.asCoroutineDispatcher() 19 | } 20 | 21 | public actual fun multiThreadDispatcher(size: Int): CloseableCoroutineDispatcher = 22 | Executors.newFixedThreadPool(size).asCoroutineDispatcher() 23 | 24 | public actual fun runBlocking(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T { 25 | return kotlinx.coroutines.runBlocking(context, block) 26 | } 27 | -------------------------------------------------------------------------------- /packages/library-base/src/jvm/kotlin/io/realm/kotlin/internal/platform/WeakReference.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.platform 2 | 3 | public actual typealias WeakReference = java.lang.ref.WeakReference 4 | -------------------------------------------------------------------------------- /packages/library-base/src/nativeDarwin/kotlin/io/realm/kotlin/internal/platform/CoroutineUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.platform 2 | 3 | import kotlinx.coroutines.CloseableCoroutineDispatcher 4 | import kotlinx.coroutines.CoroutineScope 5 | import kotlinx.coroutines.newFixedThreadPoolContext 6 | import kotlin.coroutines.CoroutineContext 7 | 8 | // Expose platform runBlocking through common interface 9 | public actual fun runBlocking( 10 | context: CoroutineContext, 11 | block: suspend CoroutineScope.() -> T 12 | ): T { 13 | return kotlinx.coroutines.runBlocking(context, block) 14 | } 15 | 16 | /** 17 | * The default dispatcher for Darwin platforms spawns a new thread with a run loop. 18 | */ 19 | public actual fun singleThreadDispatcher(id: String): CloseableCoroutineDispatcher { 20 | // Work-around for https://github.com/Kotlin/kotlinx.coroutines/issues/3768 21 | return newFixedThreadPoolContext(1, id) 22 | } 23 | 24 | public actual fun multiThreadDispatcher(size: Int): CloseableCoroutineDispatcher { 25 | // TODO https://github.com/realm/realm-kotlin/issues/501 26 | return singleThreadDispatcher("singleThreadDispatcher") 27 | } 28 | -------------------------------------------------------------------------------- /packages/library-base/src/nativeDarwin/kotlin/io/realm/kotlin/internal/platform/WeakReference.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.internal.platform 2 | 3 | import kotlin.experimental.ExperimentalNativeApi 4 | 5 | @OptIn(ExperimentalNativeApi::class) 6 | public actual typealias WeakReference = kotlin.native.ref.WeakReference 7 | -------------------------------------------------------------------------------- /packages/library-sync/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.applyDefaultHierarchyTemplate=false 17 | -------------------------------------------------------------------------------- /packages/library-sync/overview.md: -------------------------------------------------------------------------------- 1 | # Module Realm Kotlin Multiplatform Sync SDK 2 | 3 | Module containing documentation on how to setup and work with Atlas App Services and Device Sync. 4 | 5 | You can read more about App Services [here](https://www.mongodb.com/docs/atlas/app-services/) and 6 | Device Sync [here](https://www.mongodb.com/docs/atlas/app-services/sync/learn/overview/). 7 | 8 | # package io.realm.kotlin.mongodb 9 | 10 | Classes for setting up and authentication with an App Services Application. 11 | 12 | # package io.realm.kotlin.mongodb.sync 13 | 14 | Classes for setting up and working with Device Sync. 15 | -------------------------------------------------------------------------------- /packages/library-sync/proguard-rules-consumer-common.pro: -------------------------------------------------------------------------------- 1 | # Add sync-exclusive proguard exceptions here 2 | # DO NOT PUT THEM IN THIS CONSUMER IN CASE THEY ARE UNDER 'cinterop' 3 | # in which case they should be added to the 'library-base' proguard consumer instead. 4 | -keep class io.realm.kotlin.internal.interop.sync.ResponseCallbackImpl { 5 | # TODO OPTIMIZE Only keep actually required symbols 6 | *; 7 | } 8 | 9 | -keep class io.realm.kotlin.internal.interop.sync.ApiKeyWrapper { 10 | # TODO OPTIMIZE Only keep actually required symbols 11 | *; 12 | } 13 | -------------------------------------------------------------------------------- /packages/library-sync/src/androidMain/kotlin/io/realm/kotlin/mongodb/internal/NetworkStateObserver.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.internal 2 | 3 | internal actual fun registerSystemNetworkObserver() { 4 | // Registering network state listeners are done in io.realm.kotlin.mongodb.RealmSyncInitializer 5 | // so we do not have to store the Android Context. 6 | } 7 | -------------------------------------------------------------------------------- /packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/exceptions/DownloadingRealmTimeOutException.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.exceptions 2 | 3 | import io.realm.kotlin.exceptions.RealmException 4 | import io.realm.kotlin.mongodb.sync.SyncConfiguration 5 | 6 | /** 7 | * Thrown when opening a Realm and it didn't finish download server data in the allocated timeframe. 8 | * 9 | * This can only happen if [SyncConfiguration.Builder.waitForInitialRemoteData] is set. 10 | */ 11 | public class DownloadingRealmTimeOutException : RealmException { 12 | internal constructor(syncConfig: SyncConfiguration) : super( 13 | "Realm did not manage to download all initial data in time: ${syncConfig.path}, " + 14 | "timeout: ${syncConfig.initialRemoteData!!.timeout}." 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/AuthenticationChangeImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.realm.kotlin.mongodb.internal 17 | 18 | import io.realm.kotlin.mongodb.LoggedIn 19 | import io.realm.kotlin.mongodb.LoggedOut 20 | import io.realm.kotlin.mongodb.Removed 21 | import io.realm.kotlin.mongodb.User 22 | 23 | internal class LoggedInImpl(override val user: User) : LoggedIn 24 | internal class LoggedOutImpl(override val user: User) : LoggedOut 25 | internal class RemovedImpl(override val user: User) : Removed 26 | -------------------------------------------------------------------------------- /packages/library-sync/src/commonMain/kotlin/io/realm/kotlin/mongodb/internal/SyncImpl.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.internal 2 | 3 | import io.realm.kotlin.internal.interop.RealmAppPointer 4 | import io.realm.kotlin.internal.interop.RealmInterop 5 | import io.realm.kotlin.mongodb.sync.Sync 6 | 7 | internal class SyncImpl(private val app: RealmAppPointer) : Sync { 8 | 9 | override val hasSyncSessions: Boolean 10 | get() = RealmInterop.realm_app_sync_client_has_sessions(app) 11 | 12 | override fun reconnect() { 13 | RealmInterop.realm_app_sync_client_reconnect(app) 14 | } 15 | 16 | override fun waitForSessionsToTerminate() { 17 | RealmInterop.realm_app_sync_client_wait_for_sessions_to_terminate(app) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /packages/library-sync/src/jvm/kotlin/io/realm/kotlin/mongodb/internal/HttpClientCache.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("HttpClientCacheJVM") 2 | package io.realm.kotlin.mongodb.internal 3 | 4 | import io.ktor.client.HttpClient 5 | import io.ktor.client.HttpClientConfig 6 | import io.ktor.client.engine.okhttp.OkHttp 7 | import io.ktor.client.plugins.logging.Logger 8 | 9 | /** 10 | * Cache HttpClient on Android and JVM. 11 | * https://github.com/realm/realm-kotlin/issues/480 only seem to be a problem on macOS. 12 | */ 13 | internal actual class HttpClientCache actual constructor(timeoutMs: Long, customLogger: Logger?) { 14 | private val httpClient: HttpClient by lazy { createClient(timeoutMs, customLogger) } 15 | actual fun getClient(): HttpClient { 16 | return httpClient 17 | } 18 | actual fun close() { 19 | httpClient.close() 20 | } 21 | } 22 | 23 | public actual fun createPlatformClient(block: HttpClientConfig<*>.() -> Unit): HttpClient { 24 | return HttpClient(OkHttp) { 25 | engine { 26 | config { 27 | retryOnConnectionFailure(true) 28 | } 29 | } 30 | this.apply(block) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/library-sync/src/jvmMain/kotlin/io/realm/kotlin/mongodb/internal/NetworkStateObserver.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.internal 2 | 3 | internal actual fun registerSystemNetworkObserver() { 4 | // Do nothing on JVM. 5 | // There isn't a great way to detect network connectivity on this platform. 6 | } 7 | -------------------------------------------------------------------------------- /packages/library-sync/src/nativeDarwin/kotlin/io/realm/kotlin/mongodb/internal/HttpClientCache.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.internal 2 | 3 | import io.ktor.client.HttpClient 4 | import io.ktor.client.HttpClientConfig 5 | import io.ktor.client.engine.darwin.Darwin 6 | import io.ktor.client.plugins.logging.Logger 7 | 8 | /** 9 | * Cache HttpClient on iOS. 10 | */ 11 | internal actual class HttpClientCache actual constructor(timeoutMs: Long, customLogger: Logger?) { 12 | private val client: HttpClient by lazy { createClient(timeoutMs, customLogger) } 13 | actual fun getClient(): HttpClient { 14 | return client 15 | } 16 | actual fun close() { 17 | client.close() 18 | } 19 | } 20 | 21 | public actual fun createPlatformClient(block: HttpClientConfig<*>.() -> Unit): HttpClient { 22 | return HttpClient(Darwin, block) 23 | } 24 | -------------------------------------------------------------------------------- /packages/library-sync/src/nativeDarwin/kotlin/io/realm/kotlin/mongodb/internal/NetworkStateObserver.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.mongodb.internal 2 | 3 | import io.realm.kotlin.internal.interop.sync.WebSocketClient 4 | import io.realm.kotlin.internal.interop.sync.WebSocketObserver 5 | import io.realm.kotlin.internal.interop.sync.WebsocketEngine 6 | 7 | internal actual fun registerSystemNetworkObserver() { 8 | // This is handled automatically by Realm Core which will also call `Sync.reconnect()` 9 | // automatically. So on iOS/macOS we do not do anything. 10 | // See https://github.com/realm/realm-core/blob/a678c36a85cf299f745f68f8b5ceff364d714181/src/realm/object-store/sync/impl/sync_client.hpp#L82C3-L82C3 11 | // for further details. 12 | } 13 | 14 | public actual fun platformWebsocketClient( 15 | observer: WebSocketObserver, 16 | path: String, 17 | address: String, 18 | port: Long, 19 | isSsl: Boolean, 20 | supportedSyncProtocols: String, 21 | transport: RealmWebSocketTransport 22 | ): WebSocketClient = TODO() 23 | 24 | public actual fun websocketEngine(timeoutMs: Long): WebsocketEngine = TODO() 25 | -------------------------------------------------------------------------------- /packages/plugin-compiler/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.applyDefaultHierarchyTemplate=false 17 | -------------------------------------------------------------------------------- /packages/plugin-compiler/src/main/kotlin/io/realm/kotlin/compiler/fir/RealmPluginGeneratorKey.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.compiler.fir 18 | 19 | import org.jetbrains.kotlin.GeneratedDeclarationKey 20 | 21 | /** 22 | * Key to mark all additions made by our compile plugin. 23 | */ 24 | object RealmPluginGeneratorKey : GeneratedDeclarationKey() { 25 | override fun toString(): String { 26 | return "RealmApiGenerator" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/plugin-compiler/src/test/resources/schema/input/Schema.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package schema.input 18 | 19 | import io.realm.kotlin.RealmConfiguration 20 | import io.realm.kotlin.types.RealmObject 21 | 22 | class A : RealmObject 23 | class B : RealmObject 24 | class C : RealmObject 25 | 26 | val conf1 = RealmConfiguration.Builder(schema = setOf(A::class, B::class, C::class)) 27 | .build() 28 | 29 | val conf2 = RealmConfiguration.create(schema = setOf(A::class, C::class)) 30 | -------------------------------------------------------------------------------- /packages/test-base/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.applyDefaultHierarchyTemplate=false 17 | -------------------------------------------------------------------------------- /packages/test-base/proguard-rules-test.pro: -------------------------------------------------------------------------------- 1 | # We cannot discard unused symbols for the non-test configurations as it might all symbols not used 2 | -dontoptimize 3 | -dontshrink 4 | 5 | ## Required to make assertions on incorrect type messages in dynamic realm object tests pass 6 | -keep class io.realm.kotlin.types.BaseRealmObject 7 | -keep class io.realm.kotlin.types.RealmUUID 8 | 9 | ## Required to make introspection by reflection in NullabilityTests work 10 | -keep class io.realm.kotlin.types.MutableRealmInt 11 | -keep class io.realm.kotlin.entities.Nullability { 12 | *; 13 | } 14 | 15 | ## Required to make introspection by reflection in PrimaryKeyTests work 16 | -keepclassmembers class io.realm.kotlin.entities.primarykey.* { 17 | *; 18 | } 19 | -------------------------------------------------------------------------------- /packages/test-base/src/androidInstrumentedTest/kotlin/io/realm/kotlin/test/common: -------------------------------------------------------------------------------- 1 | ./../../../../../../commonTest/kotlin/io/realm/kotlin/test/common -------------------------------------------------------------------------------- /packages/test-base/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /packages/test-base/src/androidMain/assets/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/androidMain/assets/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-base/src/androidMain/assets/subdir/asset.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/androidMain/assets/subdir/asset.realm -------------------------------------------------------------------------------- /packages/test-base/src/androidMain/kotlin/io/realm/kotlin/test/platform/FileUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.platform 2 | 3 | import okio.FileSystem 4 | 5 | actual val platformFileSystem: FileSystem = FileSystem.SYSTEM 6 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/CyclicReference.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PrimaryKey 21 | 22 | interface Generic 23 | 24 | class CyclicReference : RealmObject, Generic { 25 | @PrimaryKey 26 | var name: String? = null 27 | 28 | class Inner 29 | } 30 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/FqNameImport.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities 18 | 19 | class FqNameImportParent : io.realm.kotlin.types.RealmObject { 20 | var name: String? = null 21 | var child: FqNameImportEmbeddedChild? = null 22 | } 23 | 24 | class FqNameImportEmbeddedChild : io.realm.kotlin.types.EmbeddedRealmObject { 25 | var name: String? = null 26 | } 27 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/MultipleConstructors.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class MultipleConstructors(var firstName: String, var lastName: String, var age: Int) : RealmObject { 22 | @Suppress("MagicNumber") 23 | constructor(firstName: String, lastName: String) : this (firstName, lastName, 42) 24 | constructor(foreName: String) : this (foreName, "Doe") 25 | constructor() : this ("John") 26 | } 27 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/StringPropertyWithPrimaryKey.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PrimaryKey 21 | import kotlin.random.Random 22 | import kotlin.random.nextULong 23 | 24 | class StringPropertyWithPrimaryKey : RealmObject { 25 | @PrimaryKey 26 | var id: String = Random.nextULong().toString() 27 | var value: String? = null 28 | } 29 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/embedded/CyclicReferenceEmbedded.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.embedded 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | interface Generic 22 | 23 | class CyclicReferenceEmbedded : EmbeddedRealmObject, Generic { 24 | var name: String? = null 25 | 26 | class Inner 27 | } 28 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/embedded/EmbeddedChild.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.embedded 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | class EmbeddedChild(var id: String?) : EmbeddedRealmObject { 22 | constructor() : this("Embedded child") 23 | var subTree: EmbeddedParent? = null 24 | var innerChild: EmbeddedInnerChild? = null 25 | } 26 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/embedded/EmbeddedChildWithInitializer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package io.realm.kotlin.entities.embedded 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class EmbeddedChildWithInitializer : RealmObject { 22 | var child: EmbeddedChild? = EmbeddedChild("Initial child") 23 | } 24 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/embedded/EmbeddedChildWithPrimaryKeyParent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.embedded 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | class EmbeddedChildWithPrimaryKeyParent(var id: String?) : EmbeddedRealmObject { 22 | constructor() : this("Embedded child") 23 | var subTree: EmbeddedParentWithPrimaryKey? = null 24 | var innerChild: EmbeddedInnerChild? = null 25 | } 26 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/embedded/EmbeddedInnerChild.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package io.realm.kotlin.entities.embedded 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | class EmbeddedInnerChild : EmbeddedRealmObject { 22 | var id: String? = "Embedded child" 23 | } 24 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/link/Child.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.link 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class Child : RealmObject { 22 | var name: String = "DEFAULT" 23 | } 24 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/link/Parent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.link 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class Parent : RealmObject { 22 | var name: String = "N.N." 23 | var child: Child? = null 24 | } 25 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/migration/Sample.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.migration 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PersistedName 21 | 22 | @Suppress("MagicNumber") 23 | class Sample : RealmObject { 24 | var name: String = "Migration" 25 | var stringField: String = "Realm" 26 | var intField: Int = 42 27 | 28 | @PersistedName("persistedStringField") 29 | var publicStringField = "" 30 | } 31 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/migration/embedded/after/EmbeddedMigrationChild.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.migration.embedded.after 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | class EmbeddedMigrationChild : EmbeddedRealmObject { 22 | var id: String = "child" 23 | } 24 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/migration/embedded/after/EmbeddedMigrationParent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.migration.embedded.after 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class EmbeddedMigrationParent : RealmObject { 22 | var id: String = "parent" 23 | var child: EmbeddedMigrationChild? = null 24 | } 25 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/migration/embedded/before/EmbeddedMigrationChild.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.migration.embedded.before 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class EmbeddedMigrationChild : RealmObject { 22 | var id: String = "child" 23 | } 24 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/entities/migration/embedded/before/EmbeddedMigrationParent.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.migration.embedded.before 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | 21 | class EmbeddedMigrationParent : RealmObject { 22 | var id: String = "parent" 23 | var child: EmbeddedMigrationChild? = null 24 | } 25 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/platform/FileUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.platform 2 | 3 | import okio.FileSystem 4 | 5 | /** 6 | * Reference to Okio's [FileSystem] in a platform-agnostic way. 7 | */ 8 | expect val platformFileSystem: FileSystem 9 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/platform/PlatformUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.platform 2 | 3 | import io.realm.kotlin.test.util.Utils 4 | import kotlin.time.Duration 5 | 6 | // Platform dependant helper methods 7 | expect object PlatformUtils { 8 | fun createTempDir(prefix: String = Utils.createRandomString(16), readOnly: Boolean = false): String 9 | fun deleteTempDir(path: String) 10 | fun copyFile(originPath: String, targetPath: String) 11 | fun sleep(duration: Duration) 12 | fun threadId(): ULong 13 | fun triggerGC() 14 | } 15 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/platform/RunLoopThread.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.test.platform 18 | 19 | expect class RunLoopThread { 20 | 21 | fun run(block: RunLoopThread.() -> Unit) 22 | 23 | fun terminate() 24 | } 25 | -------------------------------------------------------------------------------- /packages/test-base/src/commonMain/kotlin/io/realm/kotlin/test/util/TestLogger.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.util 2 | 3 | import io.realm.kotlin.log.LogCategory 4 | import io.realm.kotlin.log.LogLevel 5 | import io.realm.kotlin.log.RealmLogger 6 | 7 | /** 8 | * Logger implementation that track latest log event, so we are able to inspect it. 9 | */ 10 | class TestLogger : RealmLogger { 11 | var logLevel: LogLevel = LogLevel.NONE 12 | var throwable: Throwable? = null 13 | var message: String? = null 14 | var args: Array = arrayOf() 15 | private lateinit var category: LogCategory 16 | 17 | override fun log(category: LogCategory, level: LogLevel, throwable: Throwable?, message: String?, vararg args: Any?) { 18 | this.category = category 19 | this.logLevel = level 20 | this.throwable = throwable 21 | this.message = message 22 | this.args = args 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/test-base/src/commonTest/kotlin/io/realm/kotlin/test/common/utils/KeyPathFlowableTests.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.common.utils 2 | 3 | import kotlin.test.Test 4 | 5 | /** 6 | * All tests classes that tests classes exposing keypath notifications (RealmObject, RealmResults, 7 | * RealmList, RealmSet, RealmMap) should implement this interface to be sure that we test common 8 | * behaviour across those classes. 9 | */ 10 | interface KeyPathFlowableTests { 11 | @Test 12 | fun keyPath_topLevelProperty() 13 | 14 | @Test 15 | fun keyPath_nestedProperty() 16 | 17 | @Test 18 | fun keyPath_defaultDepth() 19 | 20 | @Test 21 | fun keyPath_propertyBelowDefaultLimit() 22 | 23 | @Test 24 | fun keyPath_unknownTopLevelProperty() 25 | 26 | @Test 27 | fun keyPath_unknownNestedProperty() 28 | 29 | @Test 30 | fun keyPath_invalidNestedProperty() 31 | } 32 | -------------------------------------------------------------------------------- /packages/test-base/src/iosTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/iosTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-base/src/iosTest/resources/subdir/asset.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/iosTest/resources/subdir/asset.realm -------------------------------------------------------------------------------- /packages/test-base/src/jvmMain/kotlin/io/realm/kotlin/test/platform/FileUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.platform 2 | 3 | import okio.FileSystem 4 | 5 | actual val platformFileSystem: FileSystem = FileSystem.SYSTEM 6 | -------------------------------------------------------------------------------- /packages/test-base/src/jvmTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/jvmTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-base/src/jvmTest/resources/subdir/asset.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/jvmTest/resources/subdir/asset.realm -------------------------------------------------------------------------------- /packages/test-base/src/macosTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/macosTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-base/src/macosTest/resources/subdir/asset.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-base/src/macosTest/resources/subdir/asset.realm -------------------------------------------------------------------------------- /packages/test-base/src/nativeDarwin/kotlin/io/realm/kotlin/test/platform/FileUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.platform 2 | 3 | import okio.FileSystem 4 | 5 | actual val platformFileSystem: FileSystem = FileSystem.SYSTEM 6 | -------------------------------------------------------------------------------- /packages/test-sync/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2024 Realm Inc. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | kotlin.mpp.applyDefaultHierarchyTemplate=false 17 | -------------------------------------------------------------------------------- /packages/test-sync/src/androidInstrumentedTest/kotlin/io/realm/kotlin/test/mongodb/common: -------------------------------------------------------------------------------- 1 | ./../../../../../../../commonTest/kotlin/io/realm/kotlin/test/mongodb/common -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/assets/asset-fs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/androidMain/assets/asset-fs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/assets/asset-local.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/androidMain/assets/asset-local.realm -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/assets/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/androidMain/assets/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.mongodb 2 | 3 | import android.os.Bundle 4 | import androidx.test.platform.app.InstrumentationRegistry 5 | 6 | actual fun baasTestUrl(): String { 7 | val arguments: Bundle = InstrumentationRegistry.getArguments() 8 | // if the test runner provided an argument for the BAAS URL use it 9 | // Example: adb shell am instrument -w -e baas_url "http"//8.8.8.8:2134" -r io.realm.sync.testapp.test/androidx.test.runner.AndroidJUnitRunner 10 | return arguments.getString("baas_url") ?: SyncServerConfig.url 11 | } 12 | -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/kotlin/io/realm/kotlin/test/mongodb/sync/SyncDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.kotlin.test.mongodb.sync 19 | 20 | import kotlinx.coroutines.CoroutineDispatcher 21 | import kotlinx.coroutines.Dispatchers 22 | 23 | actual fun getDispatcher(): CoroutineDispatcher = Dispatchers.IO 24 | -------------------------------------------------------------------------------- /packages/test-sync/src/androidMain/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | localhost 10 | 127.0.0.1 11 | 12 | 13 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/ObjectIdPk.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * Licensed under the Apache License, Version 2.0 (the "License"); 4 | * you may not use this file except in compliance with the License. 5 | * You may obtain a copy of the License at 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 10 | * or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | * 14 | */ 15 | package io.realm.kotlin.entities.sync 16 | 17 | import io.realm.kotlin.types.RealmObject 18 | import io.realm.kotlin.types.annotations.PrimaryKey 19 | import org.mongodb.kbson.BsonObjectId 20 | 21 | class ObjectIdPk : RealmObject { 22 | @PrimaryKey 23 | @Suppress("VariableNaming") 24 | var _id: BsonObjectId = BsonObjectId() 25 | var name: String = "" 26 | } 27 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/ParentPk.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.sync 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PrimaryKey 21 | 22 | class ParentPk : RealmObject { 23 | @Suppress("VariableNaming") 24 | @PrimaryKey var _id: String = "" 25 | var name: String = "N.N." 26 | var child: ChildPk? = null 27 | } 28 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncPerson.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.sync 18 | 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PrimaryKey 21 | import org.mongodb.kbson.BsonObjectId 22 | 23 | class SyncPerson : RealmObject { 24 | @PrimaryKey 25 | @Suppress("VariableNaming") 26 | var _id: BsonObjectId? = BsonObjectId() 27 | var age: Long = 0 28 | var firstName: String = "" 29 | var lastName: String = "" 30 | } 31 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/SyncRestaurant.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.realm.kotlin.entities.sync 17 | 18 | import io.realm.kotlin.entities.Location 19 | import io.realm.kotlin.types.RealmObject 20 | import io.realm.kotlin.types.annotations.PrimaryKey 21 | import org.mongodb.kbson.ObjectId 22 | 23 | class SyncRestaurant : RealmObject { 24 | @PrimaryKey 25 | @Suppress("VariableNaming") 26 | var _id = ObjectId() 27 | var section: ObjectId? = null 28 | var location: Location? = null 29 | } 30 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/entities/sync/flx/FlexEmbeddedObject.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.entities.sync.flx 18 | 19 | import io.realm.kotlin.types.EmbeddedRealmObject 20 | 21 | /** 22 | * Embedded Object used when testing Flexible Sync. 23 | */ 24 | class FlexEmbeddedObject : EmbeddedRealmObject { 25 | var embeddedName: String = "" 26 | } 27 | -------------------------------------------------------------------------------- /packages/test-sync/src/commonMain/kotlin/io/realm/kotlin/test/mongodb/sync/SyncDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.test.mongodb.sync 18 | 19 | import kotlinx.coroutines.CoroutineDispatcher 20 | 21 | expect fun getDispatcher(): CoroutineDispatcher 22 | -------------------------------------------------------------------------------- /packages/test-sync/src/iosTest/resources/asset-fs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/iosTest/resources/asset-fs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/iosTest/resources/asset-local.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/iosTest/resources/asset-local.realm -------------------------------------------------------------------------------- /packages/test-sync/src/iosTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/iosTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/jvmMain/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.mongodb 2 | 3 | actual fun baasTestUrl(): String = SyncServerConfig.url 4 | -------------------------------------------------------------------------------- /packages/test-sync/src/jvmMain/kotlin/io/realm/kotlin/test/mongodb/sync/SyncDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package io.realm.kotlin.test.mongodb.sync 19 | 20 | import kotlinx.coroutines.CoroutineDispatcher 21 | import kotlinx.coroutines.Dispatchers 22 | 23 | actual fun getDispatcher(): CoroutineDispatcher = Dispatchers.IO 24 | -------------------------------------------------------------------------------- /packages/test-sync/src/jvmTest/resources/asset-fs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/jvmTest/resources/asset-fs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/jvmTest/resources/asset-local.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/jvmTest/resources/asset-local.realm -------------------------------------------------------------------------------- /packages/test-sync/src/jvmTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/jvmTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/macosTest/resources/asset-fs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/macosTest/resources/asset-fs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/macosTest/resources/asset-local.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/macosTest/resources/asset-local.realm -------------------------------------------------------------------------------- /packages/test-sync/src/macosTest/resources/asset-pbs.realm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/realm/realm-kotlin/9cdc4556f9ee05c4eb04fb94c9d3ef44fe06d652/packages/test-sync/src/macosTest/resources/asset-pbs.realm -------------------------------------------------------------------------------- /packages/test-sync/src/nativeDarwin/kotlin/io/realm/kotlin/test/mongodb/BaasUtils.kt: -------------------------------------------------------------------------------- 1 | package io.realm.kotlin.test.mongodb 2 | 3 | actual fun baasTestUrl(): String = SyncServerConfig.url 4 | -------------------------------------------------------------------------------- /packages/test-sync/src/nativeDarwin/kotlin/io/realm/kotlin/test/mongodb/sync/SyncDispatcher.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package io.realm.kotlin.test.mongodb.sync 18 | 19 | import io.realm.kotlin.internal.platform.singleThreadDispatcher 20 | import kotlinx.coroutines.CoroutineDispatcher 21 | 22 | actual fun getDispatcher(): CoroutineDispatcher = singleThreadDispatcher("Sync Dispatcher") 23 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020 Realm Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express 13 | * or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | rootProject.name = "realm-kotlin-root" 19 | 20 | -------------------------------------------------------------------------------- /tools/fix-h1s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | usage() { 4 | cat < 6 | EOF 7 | } 8 | 9 | if [ "$#" -ne 1 ] ; then 10 | usage 11 | exit 1 12 | fi 13 | 14 | # Assume Dokka has been run 15 | pushd $1 16 | 17 | # Make the output SEO friendly by converting the "h2" title to the proper "h1". 18 | # For Dokka, this is only an issue on the index page (apparently). 19 | sed -i -e 's|||' index.html 20 | find . -iname "*.html-e" | xargs rm 21 | 22 | popd 23 | -------------------------------------------------------------------------------- /tools/gpg_with_pinentry.sh: -------------------------------------------------------------------------------- 1 | gpg --pinentry-mode loopback "$@" 2 | 3 | -------------------------------------------------------------------------------- /tools/sync_test_server/bind_android_ports.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # This scripts tries to bind the android emulator ports to point the local development server. 4 | 5 | adb reverse tcp:9443 tcp:9443 && \ 6 | adb reverse tcp:9080 tcp:9080 && \ 7 | adb reverse tcp:9090 tcp:9090 && \ 8 | echo "Done" || { echo "Failed to reverse android emulator ports." ;} 9 | -------------------------------------------------------------------------------- /tools/sync_test_server/stop_local_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | WORK_PATH="$HOME/.realm_baas" 4 | BAAS_PID="" 5 | MONGOD_PID="" 6 | if [[ -f $WORK_PATH/baas_server.pid ]]; then 7 | BAAS_PID="$(< "$WORK_PATH/baas_server.pid")" 8 | fi 9 | 10 | if [[ -f $WORK_PATH/mongod.pid ]]; then 11 | MONGOD_PID="$(< "$WORK_PATH/mongod.pid")" 12 | fi 13 | 14 | if [[ -n "$BAAS_PID" ]]; then 15 | echo "Stopping baas $BAAS_PID" 16 | kill -9 "$BAAS_PID" 17 | rm "$WORK_PATH/baas_server.pid" 18 | fi 19 | 20 | 21 | if [[ -n "$MONGOD_PID" ]]; then 22 | echo "Killing mongod $MONGOD_PID" 23 | kill -9 "$MONGOD_PID" 24 | rm "$WORK_PATH/mongod.pid" 25 | fi 26 | -------------------------------------------------------------------------------- /tools/sync_test_server/stop_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | docker stop mongodb-realm -t0 4 | --------------------------------------------------------------------------------