Merge pull request #1739 from Jaehwa-Noh/without-type-safe

Followed Kotlin DSL without type-safe accessors documentation
pull/1238/merge
Don Turner 6 days ago committed by GitHub
commit f66fd84f92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -34,7 +34,7 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin<Project> {
dependencies { dependencies {
val bom = libs.findLibrary("firebase-bom").get() val bom = libs.findLibrary("firebase-bom").get()
add("implementation", platform(bom)) "implementation"(platform(bom))
"implementation"(libs.findLibrary("firebase.analytics").get()) "implementation"(libs.findLibrary("firebase.analytics").get())
"implementation"(libs.findLibrary("firebase.performance").get()) { "implementation"(libs.findLibrary("firebase.performance").get()) {
/* /*

@ -36,18 +36,18 @@ class AndroidFeatureConventionPlugin : Plugin<Project> {
} }
dependencies { dependencies {
add("implementation", project(":core:ui")) "implementation"(project(":core:ui"))
add("implementation", project(":core:designsystem")) "implementation"(project(":core:designsystem"))
add("implementation", libs.findLibrary("androidx.hilt.navigation.compose").get()) "implementation"(libs.findLibrary("androidx.hilt.navigation.compose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get()) "implementation"(libs.findLibrary("androidx.lifecycle.runtimeCompose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get()) "implementation"(libs.findLibrary("androidx.lifecycle.viewModelCompose").get())
add("implementation", libs.findLibrary("androidx.navigation.compose").get()) "implementation"(libs.findLibrary("androidx.navigation.compose").get())
add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) "implementation"(libs.findLibrary("androidx.tracing.ktx").get())
add("implementation", libs.findLibrary("kotlinx.serialization.json").get()) "implementation"(libs.findLibrary("kotlinx.serialization.json").get())
add("testImplementation", libs.findLibrary("androidx.navigation.testing").get()) "testImplementation"(libs.findLibrary("androidx.navigation.testing").get())
add("androidTestImplementation", libs.findLibrary("androidx.lifecycle.runtimeTesting").get()) "androidTestImplementation"(libs.findLibrary("androidx.lifecycle.runtimeTesting").get())
} }
} }
} }

@ -26,7 +26,6 @@ import org.gradle.api.Plugin
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin
class AndroidLibraryConventionPlugin : Plugin<Project> { class AndroidLibraryConventionPlugin : Plugin<Project> {
override fun apply(target: Project) { override fun apply(target: Project) {
@ -53,10 +52,10 @@ class AndroidLibraryConventionPlugin : Plugin<Project> {
disableUnnecessaryAndroidTests(target) disableUnnecessaryAndroidTests(target)
} }
dependencies { dependencies {
add("androidTestImplementation", libs.findLibrary("kotlin.test").get()) "androidTestImplementation"(libs.findLibrary("kotlin.test").get())
add("testImplementation", libs.findLibrary("kotlin.test").get()) "testImplementation"(libs.findLibrary("kotlin.test").get())
add("implementation", libs.findLibrary("androidx.tracing.ktx").get()) "implementation"(libs.findLibrary("androidx.tracing.ktx").get())
} }
} }
} }

@ -41,9 +41,9 @@ class AndroidRoomConventionPlugin : Plugin<Project> {
} }
dependencies { dependencies {
add("implementation", libs.findLibrary("room.runtime").get()) "implementation"(libs.findLibrary("room.runtime").get())
add("implementation", libs.findLibrary("room.ktx").get()) "implementation"(libs.findLibrary("room.ktx").get())
add("ksp", libs.findLibrary("room.compiler").get()) "ksp"(libs.findLibrary("room.compiler").get())
} }
} }
} }

@ -25,13 +25,13 @@ class HiltConventionPlugin : Plugin<Project> {
with(target) { with(target) {
pluginManager.apply("com.google.devtools.ksp") pluginManager.apply("com.google.devtools.ksp")
dependencies { dependencies {
add("ksp", libs.findLibrary("hilt.compiler").get()) "ksp"(libs.findLibrary("hilt.compiler").get())
} }
// Add support for Jvm Module, base on org.jetbrains.kotlin.jvm // Add support for Jvm Module, base on org.jetbrains.kotlin.jvm
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") { pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
dependencies { dependencies {
add("implementation", libs.findLibrary("hilt.core").get()) "implementation"(libs.findLibrary("hilt.core").get())
} }
} }
@ -39,7 +39,7 @@ class HiltConventionPlugin : Plugin<Project> {
pluginManager.withPlugin("com.android.base") { pluginManager.withPlugin("com.android.base") {
pluginManager.apply("dagger.hilt.android.plugin") pluginManager.apply("dagger.hilt.android.plugin")
dependencies { dependencies {
add("implementation", libs.findLibrary("hilt.android").get()) "implementation"(libs.findLibrary("hilt.android").get())
} }
} }
} }

@ -19,7 +19,6 @@ import com.google.samples.apps.nowinandroid.libs
import org.gradle.api.Plugin import org.gradle.api.Plugin
import org.gradle.api.Project import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin
class JvmLibraryConventionPlugin : Plugin<Project> { class JvmLibraryConventionPlugin : Plugin<Project> {
override fun apply(target: Project) { override fun apply(target: Project) {
@ -30,7 +29,7 @@ class JvmLibraryConventionPlugin : Plugin<Project> {
} }
configureKotlinJvm() configureKotlinJvm()
dependencies { dependencies {
add("testImplementation", libs.findLibrary("kotlin.test").get()) "testImplementation"(libs.findLibrary("kotlin.test").get())
} }
} }
} }

@ -37,10 +37,10 @@ internal fun Project.configureAndroidCompose(
dependencies { dependencies {
val bom = libs.findLibrary("androidx-compose-bom").get() val bom = libs.findLibrary("androidx-compose-bom").get()
add("implementation", platform(bom)) "implementation"(platform(bom))
add("androidTestImplementation", platform(bom)) "androidTestImplementation"(platform(bom))
add("implementation", libs.findLibrary("androidx-compose-ui-tooling-preview").get()) "implementation"(libs.findLibrary("androidx-compose-ui-tooling-preview").get())
add("debugImplementation", libs.findLibrary("androidx-compose-ui-tooling").get()) "debugImplementation"(libs.findLibrary("androidx-compose-ui-tooling").get())
} }
testOptions { testOptions {

@ -54,7 +54,7 @@ internal fun Project.configureKotlinAndroid(
configureKotlin<KotlinAndroidProjectExtension>() configureKotlin<KotlinAndroidProjectExtension>()
dependencies { dependencies {
add("coreLibraryDesugaring", libs.findLibrary("android.desugarJdkLibs").get()) "coreLibraryDesugaring"(libs.findLibrary("android.desugarJdkLibs").get())
} }
} }

Loading…
Cancel
Save