Skip to content

Commit

Permalink
Merge pull request terrakok#12 from nhachicha/Realm_Dependency
Browse files Browse the repository at this point in the history
Add Realm Multiplatform Database support
  • Loading branch information
terrakok authored Feb 9, 2022
2 parents 9811fba + f32fabb commit b8c9a64
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ plugins {
${if (GradlePlugin.APPLICATION in projectInfo.gradlePlugins) "application" else NAN}
${if (GradlePlugin.PUBLISH in projectInfo.gradlePlugins) "`maven-publish`" else NAN}
${if (GradlePlugin.SQL_DELIGHT in projectInfo.gradlePlugins) "id(\"com.squareup.sqldelight\")" else NAN}
${if (GradlePlugin.REALM in projectInfo.gradlePlugins) "id(\"io.realm.kotlin\")" else NAN}
}
""".trimIndent().deleteNans()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ buildscript {
${if (projectInfo.dependencies.contains(KmpLibrary.SERIALIZATION)) "classpath(\"org.jetbrains.kotlin:kotlin-serialization:${projectInfo.kotlinVersion.versionName}\")" else NAN}
${if (projectInfo.targets.contains(Target.ANDROID)) "classpath(\"com.android.tools.build:gradle:7.0.4\")" else NAN}
${if (GradlePlugin.SQL_DELIGHT in projectInfo.gradlePlugins) "classpath(\"com.squareup.sqldelight:gradle-plugin:1.5.3\")" else NAN}
${if (GradlePlugin.REALM in projectInfo.gradlePlugins) "classpath(\"io.realm.kotlin:gradle-plugin:0.9.0\")" else NAN}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ enum class GradlePlugin(
emptySet(),
emptySet(),
"SQLDelight"
),
REALM(
emptySet(),
emptySet(),
"Realm Kotlin Multiplatform"
);

fun canBeApplied(targets: Set<Target>): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.jetbrains.webwiz.models.Target.*

private const val KtorVersion = "2.0.0-beta-1"
private const val SqlDelightVersion = "1.5.3"
private const val RealmVersion = "0.9.0"

enum class KmpLibrary(
val targets: Set<Target>?, //null means any target
Expand Down Expand Up @@ -54,6 +55,12 @@ enum class KmpLibrary(
"io.ktor:ktor-client-core:$KtorVersion",
MAIN
),
REALM_KOTLIN(
setOf(JVM, ANDROID, IOS, MACOS),
"Realm Kotlin Multiplatform",
"io.realm.kotlin:library-base:$RealmVersion",
MAIN
),
}

enum class SingleTargetLibrary(
Expand Down

0 comments on commit b8c9a64

Please sign in to comment.