diff --git a/app/build.gradle b/app/build.gradle index 7addb102..14def7f0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,10 +1,18 @@ plugins { alias libs.plugins.android.application alias libs.plugins.jetbrains.kotlin.android + alias libs.plugins.androidx.room alias libs.plugins.google.dagger.hilt.android alias libs.plugins.google.devtools.ksp } +kotlin { + jvmToolchain(17) + compilerOptions { + freeCompilerArgs.add('-opt-in=kotlin.RequiresOptIn') + } +} + def keystorePropertiesFile = rootProject.file('keystore.properties') def keystoreProperties = new Properties() if (keystorePropertiesFile.exists()) keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) @@ -35,10 +43,6 @@ android { versionName "${version.major}.${version.minor}.${version.patch}" testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' - - ksp { - arg 'room.schemaLocation', "$projectDir/schemas" - } } buildTypes { @@ -49,12 +53,6 @@ android { } } - kotlin { - jvmToolchain(17) - } - kotlinOptions { - freeCompilerArgs += '-opt-in=kotlin.RequiresOptIn' - } buildFeatures { compose true } @@ -96,3 +94,12 @@ dependencies { androidTestImplementation libs.androidx.test.rules androidTestImplementation libs.androidx.test.extJunit } + +ksp { + arg 'room.incremental', 'true' + arg 'room.generateKotlin', 'true' +} + +room { + schemaDirectory "$projectDir/schemas" +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cf7b3d82..90ff466d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ kspPlugin = "1.9.10-1.0.13" # Must be "$kotlin-$ksp" composeCompiler = "1.5.3" hilt = "2.48.1" lifecycle = "2.6.2" -room = "2.5.2" +room = "2.6.0" [libraries] @@ -40,3 +40,4 @@ android-application = "com.android.application:8.1.2" jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } google-dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } google-devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "kspPlugin" } +androidx-room = { id = "androidx.room", version.ref = "room" }