diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0fd9cf0..8909ffb 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,4 +1,3 @@ -import org.jetbrains.kotlin.incremental.createDirectory import java.io.FileInputStream import java.util.Properties @@ -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") @@ -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 { - return listOf("room.schemaLocation=${schemaDir.path}") - } -} - android { namespace = "com.muedsa.jcytv" compileSdk = 34 @@ -109,6 +93,10 @@ android { excludes += "/META-INF/{AL2.0,LGPL2.1}" } } + + room { + schemaDirectory("$projectDir/schemas") + } } dependencies { @@ -175,5 +163,5 @@ dependencies { } ksp { - arg(RoomSchemaArgProvider(File(projectDir, "schemas"))) + arg("room.generateKotlin", "true") } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c81ea4d..6d49caf 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 016bc77..2d6ff15 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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] @@ -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" } \ No newline at end of file +compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } +android-room = { id = "androidx.room", version.ref = "room" } \ No newline at end of file