Skip to content

Commit

Permalink
update: androidx.room version 2.7.0-alpha05 & android-room gradle plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Jul 19, 2024
1 parent c06e7fb commit 5475d90
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
24 changes: 6 additions & 18 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import org.jetbrains.kotlin.incremental.createDirectory
import java.io.FileInputStream
import java.util.Properties

Expand All @@ -11,6 +10,7 @@ plugins {
alias(libs.plugins.gmsGoogleService)
alias(libs.plugins.firebaseCrashlytics)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.android.room)
}

val keystorePropertiesFile: File = rootProject.file("keystore.properties")
Expand All @@ -19,22 +19,6 @@ if (keystorePropertiesFile.exists() && keystorePropertiesFile.canRead()) {
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
}

val schemasDir: File = project.file("schemas")
if (!schemasDir.exists()) {
schemasDir.createDirectory()
}

class RoomSchemaArgProvider(
@get:InputDirectory
@get:PathSensitive(PathSensitivity.RELATIVE)
val schemaDir: File
) : CommandLineArgumentProvider {

override fun asArguments(): Iterable<String> {
return listOf("room.schemaLocation=${schemaDir.path}")
}
}

android {
namespace = "com.muedsa.jcytv"
compileSdk = 34
Expand Down Expand Up @@ -109,6 +93,10 @@ android {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

room {
schemaDirectory("$projectDir/schemas")
}
}

dependencies {
Expand Down Expand Up @@ -175,5 +163,5 @@ dependencies {
}

ksp {
arg(RoomSchemaArgProvider(File(projectDir, "schemas")))
arg("room.generateKotlin", "true")
}
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ plugins {
alias(libs.plugins.gmsGoogleService) apply false
alias(libs.plugins.firebaseCrashlytics) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.android.room) apply false
}
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ktx-serialization = "1.7.1"
retrofit2 = "2.11.0"
retrofit2-ktx-serialization = "1.0.0"
okhttp3-logging = "4.12.0"
room = "2.6.1"
room = "2.7.0-alpha05"
bcprov-jdk15to18 = "1.78.1"

[libraries]
Expand Down Expand Up @@ -87,4 +87,5 @@ ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
hiltAndroid = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
gmsGoogleService = { id = "com.google.gms.google-services", version.ref = "google-services" }
firebaseCrashlytics = { id = "com.google.firebase.crashlytics", version.ref = "firebase-crashlytics-gradle-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
android-room = { id = "androidx.room", version.ref = "room" }

0 comments on commit 5475d90

Please sign in to comment.