From 42130503104c990797c425fa82b1abe03296428b Mon Sep 17 00:00:00 2001 From: Chris Banes Date: Wed, 19 Oct 2022 16:22:31 +0100 Subject: [PATCH] Revert "Migrate to sergei-lapin/napt" This reverts commit 06d365ad. Unfortunately it was causing too many issues with Hilt/Dagger. See https://github.com/sergei-lapin/napt/issues/11 --- api/tmdb/build.gradle.kts | 4 ++-- api/trakt-auth/build.gradle.kts | 4 ++-- api/trakt/build.gradle.kts | 4 ++-- app/build.gradle.kts | 6 +++--- build.gradle.kts | 9 ++++++--- common/imageloading/build.gradle.kts | 4 ++-- core/analytics/build.gradle.kts | 4 ++-- core/logging/build.gradle.kts | 4 ++-- data-android/build.gradle.kts | 6 +++--- domain/build.gradle.kts | 4 ++-- gradle/libs.versions.toml | 2 +- tasks/build.gradle.kts | 6 ++++-- ui/account/build.gradle.kts | 4 ++-- ui/discover/build.gradle.kts | 4 ++-- ui/episodedetails/build.gradle.kts | 4 ++-- ui/followed/build.gradle.kts | 4 ++-- ui/popular/build.gradle.kts | 4 ++-- ui/recommended/build.gradle.kts | 4 ++-- ui/search/build.gradle.kts | 4 ++-- ui/settings/build.gradle.kts | 4 ++-- ui/showdetails/build.gradle.kts | 4 ++-- ui/showseasons/build.gradle.kts | 4 ++-- ui/trending/build.gradle.kts | 4 ++-- ui/watched/build.gradle.kts | 4 ++-- 24 files changed, 55 insertions(+), 50 deletions(-) diff --git a/api/tmdb/build.gradle.kts b/api/tmdb/build.gradle.kts index d830902df6..f66ddca741 100644 --- a/api/tmdb/build.gradle.kts +++ b/api/tmdb/build.gradle.kts @@ -17,7 +17,7 @@ plugins { id("kotlin") - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.android.lint) } @@ -31,5 +31,5 @@ dependencies { implementation(libs.okhttp.okhttp) - annotationProcessor(libs.dagger.compiler) + kapt(libs.dagger.compiler) } diff --git a/api/trakt-auth/build.gradle.kts b/api/trakt-auth/build.gradle.kts index 6d0773fcd4..20cfdf7245 100644 --- a/api/trakt-auth/build.gradle.kts +++ b/api/trakt-auth/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -37,7 +37,7 @@ dependencies { api(projects.api.trakt) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) implementation(libs.androidx.browser) implementation(libs.androidx.core) diff --git a/api/trakt/build.gradle.kts b/api/trakt/build.gradle.kts index 078fd3dcc9..4a85abd52b 100644 --- a/api/trakt/build.gradle.kts +++ b/api/trakt/build.gradle.kts @@ -17,7 +17,7 @@ plugins { id("kotlin") - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.android.lint) } @@ -33,5 +33,5 @@ dependencies { implementation(libs.retrofit.retrofit) implementation(libs.retrofit.gsonConverter) - annotationProcessor(libs.dagger.compiler) + kapt(libs.dagger.compiler) } diff --git a/app/build.gradle.kts b/app/build.gradle.kts index fa2752b6d5..a978feba28 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -213,10 +213,10 @@ dependencies { implementation(libs.hilt.library) implementation(libs.hilt.compose) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) implementation(libs.hilt.work) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) implementation(libs.google.crashlytics) implementation(libs.google.analytics) diff --git a/build.gradle.kts b/build.gradle.kts index c07ff13e1c..40bd0527e0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,7 @@ import com.android.build.gradle.BaseExtension import com.android.build.gradle.BasePlugin import dagger.hilt.android.plugin.HiltExtension +import org.jetbrains.kotlin.gradle.plugin.KaptExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -26,7 +27,7 @@ plugins { alias(libs.plugins.android.lint) apply false alias(libs.plugins.android.test) apply false alias(libs.plugins.kotlin.android) apply false - alias(libs.plugins.kotlin.napt) apply false + alias(libs.plugins.kotlin.kapt) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.hilt) apply false alias(libs.plugins.gms.googleServices) apply false @@ -92,8 +93,10 @@ subprojects { } plugins.withId(rootProject.libs.plugins.hilt.get().pluginId) { - // Had to turn this off for napt to work - extensions.getByType().enableAggregatingTask = false + extensions.getByType().enableAggregatingTask = true + } + plugins.withId(rootProject.libs.plugins.kotlin.kapt.get().pluginId) { + extensions.getByType().correctErrorTypes = true } plugins.withType().configureEach { extensions.configure { diff --git a/common/imageloading/build.gradle.kts b/common/imageloading/build.gradle.kts index fe3e67237f..7365c5d63e 100644 --- a/common/imageloading/build.gradle.kts +++ b/common/imageloading/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -34,7 +34,7 @@ dependencies { implementation(libs.androidx.core) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) api(libs.coil.coil) } diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index f95046e817..9085691d28 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -31,5 +31,5 @@ dependencies { implementation(libs.google.analytics) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/core/logging/build.gradle.kts b/core/logging/build.gradle.kts index 94faa8c024..6e1e673b95 100644 --- a/core/logging/build.gradle.kts +++ b/core/logging/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -32,5 +32,5 @@ dependencies { implementation(libs.timber) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/data-android/build.gradle.kts b/data-android/build.gradle.kts index 4e3c64f780..5b3c2af98a 100644 --- a/data-android/build.gradle.kts +++ b/data-android/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.ksp) } @@ -58,7 +58,7 @@ dependencies { implementation(libs.androidx.paging.runtime) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) testImplementation(libs.junit) testImplementation(libs.robolectric) @@ -73,7 +73,7 @@ dependencies { testImplementation(libs.hilt.testing) kspTest(libs.androidx.room.compiler) - testAnnotationProcessor(libs.hilt.compiler) + kaptTest(libs.hilt.compiler) // Needed for Tzdb testImplementation("org.threeten:threetenbp:${libs.versions.threetenbp.get()}") diff --git a/domain/build.gradle.kts b/domain/build.gradle.kts index e9ff910514..5373704411 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -33,7 +33,7 @@ dependencies { implementation(projects.api.tmdb) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) api(libs.androidx.paging.common) implementation(libs.androidx.paging.runtime) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 43d8a8c9ad..8464332a3b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,7 +27,7 @@ android-library = { id = "com.android.library", version.ref = "agp" } android-lint = { id = "com.android.lint", version.ref = "agp" } android-test = { id = "com.android.test", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlin-napt = "com.sergei-lapin.napt:1.17" +kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } ksp = "com.google.devtools.ksp:1.7.20-1.0.7" hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" } gms-googleServices = "com.google.gms.google-services:4.3.14" diff --git a/tasks/build.gradle.kts b/tasks/build.gradle.kts index a3318cf740..98d17c4342 100644 --- a/tasks/build.gradle.kts +++ b/tasks/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) } android { @@ -38,6 +38,8 @@ dependencies { api(libs.androidx.work.runtime) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) + implementation(libs.hilt.work) + kapt(libs.hilt.compiler) } diff --git a/ui/account/build.gradle.kts b/ui/account/build.gradle.kts index 549565cb8e..cd245403c8 100644 --- a/ui/account/build.gradle.kts +++ b/ui/account/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -61,5 +61,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/discover/build.gradle.kts b/ui/discover/build.gradle.kts index 86cc0edd80..241afa669f 100644 --- a/ui/discover/build.gradle.kts +++ b/ui/discover/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -55,5 +55,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/episodedetails/build.gradle.kts b/ui/episodedetails/build.gradle.kts index f0feabfc42..8a933933a4 100644 --- a/ui/episodedetails/build.gradle.kts +++ b/ui/episodedetails/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -56,5 +56,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/followed/build.gradle.kts b/ui/followed/build.gradle.kts index 9f88001414..44002c5a97 100644 --- a/ui/followed/build.gradle.kts +++ b/ui/followed/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -61,5 +61,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/popular/build.gradle.kts b/ui/popular/build.gradle.kts index 0fe733094b..3b5fd1f0b1 100644 --- a/ui/popular/build.gradle.kts +++ b/ui/popular/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -52,5 +52,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/recommended/build.gradle.kts b/ui/recommended/build.gradle.kts index 7954df8528..2f27f0bb83 100644 --- a/ui/recommended/build.gradle.kts +++ b/ui/recommended/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -52,5 +52,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/search/build.gradle.kts b/ui/search/build.gradle.kts index 7ebfb59599..fe024c5b1c 100644 --- a/ui/search/build.gradle.kts +++ b/ui/search/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -52,5 +52,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/settings/build.gradle.kts b/ui/settings/build.gradle.kts index 28777a2c90..ab87d9fb5a 100644 --- a/ui/settings/build.gradle.kts +++ b/ui/settings/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -36,5 +36,5 @@ dependencies { implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/showdetails/build.gradle.kts b/ui/showdetails/build.gradle.kts index 66c0c9f9e5..fd93d2a3dd 100644 --- a/ui/showdetails/build.gradle.kts +++ b/ui/showdetails/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -58,5 +58,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/showseasons/build.gradle.kts b/ui/showseasons/build.gradle.kts index ede418d099..a90c6217ab 100644 --- a/ui/showseasons/build.gradle.kts +++ b/ui/showseasons/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -58,5 +58,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/trending/build.gradle.kts b/ui/trending/build.gradle.kts index 9e126042e5..efd397564f 100644 --- a/ui/trending/build.gradle.kts +++ b/ui/trending/build.gradle.kts @@ -18,7 +18,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -52,5 +52,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) } diff --git a/ui/watched/build.gradle.kts b/ui/watched/build.gradle.kts index 8847e16214..aa2925f133 100644 --- a/ui/watched/build.gradle.kts +++ b/ui/watched/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.napt) + alias(libs.plugins.kotlin.kapt) alias(libs.plugins.hilt) } @@ -58,5 +58,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - annotationProcessor(libs.hilt.compiler) + kapt(libs.hilt.compiler) }