-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
94 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
build-logic/dependencies/src/main/kotlin/RoomLibraryConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import AppExt.currentLibs | ||
import androidx.room.gradle.RoomExtension | ||
import com.google.devtools.ksp.gradle.KspExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
|
||
class RoomLibraryConventionPlugin : Plugin<Project> { | ||
|
||
override fun apply(target: Project) { | ||
with(target) { | ||
pluginManager.apply("androidx.room") | ||
pluginManager.apply("com.google.devtools.ksp") | ||
|
||
extensions.configure<KspExtension> { | ||
arg("room.generateKotlin", "true") | ||
} | ||
|
||
extensions.configure<RoomExtension> { | ||
// The schemas directory contains a schema file for each version of the Room database. | ||
// This is required to enable Room auto migrations. | ||
// See https://developer.android.com/reference/kotlin/androidx/room/AutoMigration. | ||
schemaDirectory("$projectDir/schemas") | ||
} | ||
|
||
dependencies { | ||
"implementation"(currentLibs.findBundle("room").get()) | ||
"annotationProcessor"(currentLibs.findLibrary("androidx-room-compiler").get()) | ||
"implementation"(currentLibs.findLibrary("androidx-paging-runtime").get()) | ||
"androidTestApi"(currentLibs.findLibrary("androidx-room-testing").get()) | ||
"ksp"(currentLibs.findLibrary("androidx-room-compiler").get()) | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,10 @@ | ||
plugins { | ||
id("csplashscreen.android.library") | ||
alias(libs.plugins.convention.library) | ||
alias(libs.plugins.convention.room.library) | ||
} | ||
|
||
android.namespace = "st.slex.csplashscreen.core.database" | ||
|
||
ksp { | ||
arg("room.schemaLocation", "$projectDir/schemas") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core:core")) | ||
implementation(libs.bundles.room) | ||
annotationProcessor(libs.androidx.room.compiler) | ||
ksp(libs.androidx.room.compiler) | ||
implementation(libs.androidx.paging.runtime) | ||
androidTestApi(libs.androidx.room.testing) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters