Skip to content

Commit

Permalink
Merge pull request DroidKaigi#1245 from CookieySun/feature/migrate_fr…
Browse files Browse the repository at this point in the history
…om_kapt_to_ksp

Migrate dagger hilt from kapt to ksp.
  • Loading branch information
takahirom authored Sep 16, 2023
2 parents 193e4a1 + 0cd710d commit 0164f74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ package io.github.droidkaigi.confsched2023.primitive

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.gradle.plugin.KaptExtension

@Suppress("unused")
class AndroidFirebasePlugin : Plugin<Project> {
Expand All @@ -27,9 +25,6 @@ class AndroidFirebasePlugin : Plugin<Project> {
implementation(libs.library("firebaseCommon"))
implementation(libs.library("multiplatformFirebaseAuth"))
}
extensions.configure<KaptExtension> {
correctErrorTypes = true
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ package io.github.droidkaigi.confsched2023.primitive

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
import org.jetbrains.kotlin.gradle.plugin.KaptExtension

@Suppress("unused")
class AndroidHiltPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("kotlin-kapt")
apply("com.google.devtools.ksp")
apply("dagger.hilt.android.plugin")
}

Expand All @@ -26,12 +24,9 @@ class AndroidHiltPlugin : Plugin<Project> {
implementation(libs.library("daggerHiltAndroid"))
// https://issuetracker.google.com/issues/237567009
implementation(libs.library("androidxFragment"))
kapt(libs.library("daggerHiltAndroidCompiler"))
ksp(libs.library("daggerHiltAndroidCompiler"))
testImplementation(libs.library("daggerHiltAndroidTesting"))
kaptTest(libs.library("daggerHiltAndroidTesting"))
}
extensions.configure<KaptExtension> {
correctErrorTypes = true
kspTest(libs.library("daggerHiltAndroidTesting"))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ fun DependencyHandlerScope.ksp(
add("ksp", artifact)
}

fun DependencyHandlerScope.kaptTest(
fun DependencyHandlerScope.kspTest(
artifact: MinimalExternalModuleDependency,
) {
add("kaptTest", artifact)
add("kspTest", artifact)
}

0 comments on commit 0164f74

Please sign in to comment.