Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate dagger hilt from kapt to ksp. #1245

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading