Skip to content

Commit

Permalink
[CHORE] #14 : ksp + hilt 종속성 및 플러그인 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Oct 5, 2023
1 parent 27cfa39 commit 43cfd51
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class AndroidFeatureConventionPlugin: Plugin<Project>{
with(pluginManager){
apply("com.wap.wapp.library")
apply("com.wap.wapp.compose")
apply("com.wap.wapp.hilt")
}
configureBinding()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.wap.wapp.plugin

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType

class AndroidHiltPlugin: Plugin<Project> {
override fun apply(target: Project) {
with(target){
pluginManager.apply("com.google.dagger.hilt.android")
pluginManager.apply("com.google.devtools.ksp")

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")

dependencies {
"implementation"(libs.findLibrary("hilt").get())
"ksp"(libs.findLibrary("hilt.ksp").get())
}
}
}
}
10 changes: 10 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ versionCode = "1"
gradleplugin = "8.1.2"

kotlin = "1.9.10"
ksp = "1.9.10-1.0.13"

androidx-core = "1.12.0"
androidx-appcompat = "1.6.1"
Expand All @@ -34,9 +35,12 @@ junit = "4.13.2"
material = "1.9.0"
ktlint = "11.3.1"

hilt = "2.48"

[libraries]
android-build = { module = "com.android.tools.build:gradle", version.ref = "gradleplugin" }
kotlin-gradle = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
hilt-gradle = { group = "com.google.dagger", name = "hilt-android-gradle-plugin", version.ref = "hilt" }

kotlin = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" }

Expand Down Expand Up @@ -69,6 +73,10 @@ firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics-ktx"
firebase-auth = { module = "com.google.firebase:firebase-auth-ktx" }
firebase-firestore = { module = "com.google.firebase:firebase-firestore-ktx" }

hilt = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
hilt-ksp = { module = "com.google.dagger:hilt-compiler", version.ref = "hilt" }
hilt-plugin = { group = "com.google.dagger", name = "hilt-android-gradle-plugin", version.ref = "hilt" }

junit = { module = "junit:junit", version.ref = "junit" }
androidx-test-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-test-junit" }
androidx-test-espresso = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-test-espresso" }
Expand Down Expand Up @@ -102,6 +110,8 @@ compose = [
android-application = { id = "com.android.application", version.ref = "gradleplugin" }
android-library = { id = "com.android.library", version.ref = "gradleplugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
google-services = { id = "com.google.gms.google-services", version.ref = "google-services-plugin" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "google-crashlytics-plguin" }
dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" }

0 comments on commit 43cfd51

Please sign in to comment.