From ac97ab9dcc45a3276e60c5c48f0ca5d810a2f766 Mon Sep 17 00:00:00 2001 From: Goooler Date: Mon, 26 Sep 2022 17:27:40 +0800 Subject: [PATCH] Re-enable Napt This reverts commit 42130503104c990797c425fa82b1abe03296428b. Seems issues had been solved, see https://github.com/sergei-lapin/napt/issues/11#issuecomment-1315288577 --- 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, 50 insertions(+), 55 deletions(-) diff --git a/api/tmdb/build.gradle.kts b/api/tmdb/build.gradle.kts index 494858c83f..b195b5bec4 100644 --- a/api/tmdb/build.gradle.kts +++ b/api/tmdb/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("kotlin") - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.android.lint) } @@ -30,5 +30,5 @@ dependencies { implementation(libs.okhttp.okhttp) - kapt(libs.dagger.compiler) + annotationProcessor(libs.dagger.compiler) } diff --git a/api/trakt-auth/build.gradle.kts b/api/trakt-auth/build.gradle.kts index 6ef683cbb1..39c0881669 100644 --- a/api/trakt-auth/build.gradle.kts +++ b/api/trakt-auth/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -36,7 +36,7 @@ dependencies { api(projects.api.trakt) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(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 f651afe16b..309cf0befb 100644 --- a/api/trakt/build.gradle.kts +++ b/api/trakt/build.gradle.kts @@ -16,7 +16,7 @@ plugins { id("kotlin") - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.android.lint) } @@ -32,5 +32,5 @@ dependencies { implementation(libs.retrofit.retrofit) implementation(libs.retrofit.gsonConverter) - kapt(libs.dagger.compiler) + annotationProcessor(libs.dagger.compiler) } diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 58268a5573..ddbed9e7e8 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -207,10 +207,10 @@ dependencies { implementation(libs.hilt.library) implementation(libs.hilt.compose) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) implementation(libs.hilt.work) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) implementation(libs.google.crashlytics) implementation(libs.google.analytics) diff --git a/build.gradle.kts b/build.gradle.kts index 1c777fb34d..5c8aec60da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,7 +18,6 @@ import com.android.build.gradle.BaseExtension import com.android.build.gradle.BasePlugin import com.diffplug.gradle.spotless.SpotlessExtension import dagger.hilt.android.plugin.HiltExtension -import org.jetbrains.kotlin.gradle.plugin.KaptExtension import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -27,7 +26,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.kapt) apply false + alias(libs.plugins.napt) apply false alias(libs.plugins.ksp) apply false alias(libs.plugins.hilt) apply false alias(libs.plugins.gms.googleServices) apply false @@ -109,10 +108,8 @@ allprojects { } plugins.withId(rootProject.libs.plugins.hilt.get().pluginId) { - extensions.getByType().enableAggregatingTask = true - } - plugins.withId(rootProject.libs.plugins.kotlin.kapt.get().pluginId) { - extensions.getByType().correctErrorTypes = true + // Had to turn this off for napt to work + extensions.getByType().enableAggregatingTask = false } plugins.withType().configureEach { extensions.configure { diff --git a/common/imageloading/build.gradle.kts b/common/imageloading/build.gradle.kts index c1f4bd323a..c2d53658ed 100644 --- a/common/imageloading/build.gradle.kts +++ b/common/imageloading/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -33,7 +33,7 @@ dependencies { implementation(libs.androidx.core) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) api(libs.coil.coil) } diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index e1fc8736ef..fa17015a78 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -30,5 +30,5 @@ dependencies { implementation(libs.google.analytics) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/core/logging/build.gradle.kts b/core/logging/build.gradle.kts index 0578f90ebe..6cb39c19b0 100644 --- a/core/logging/build.gradle.kts +++ b/core/logging/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -31,5 +31,5 @@ dependencies { implementation(libs.timber) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/data-android/build.gradle.kts b/data-android/build.gradle.kts index 1daf131c46..38cdc01b04 100644 --- a/data-android/build.gradle.kts +++ b/data-android/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.ksp) } @@ -57,7 +57,7 @@ dependencies { implementation(libs.androidx.paging.runtime) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) testImplementation(libs.junit) testImplementation(libs.robolectric) @@ -72,7 +72,7 @@ dependencies { testImplementation(libs.hilt.testing) kspTest(libs.androidx.room.compiler) - kaptTest(libs.hilt.compiler) + testAnnotationProcessor(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 b2b911eebd..108cb7312e 100644 --- a/domain/build.gradle.kts +++ b/domain/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -32,7 +32,7 @@ dependencies { implementation(projects.api.tmdb) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(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 e32b92824f..586369909b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,9 +26,9 @@ 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-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } ksp = "com.google.devtools.ksp:1.7.21-1.0.8" hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" } +napt = "com.sergei-lapin.napt:1.19" gms-googleServices = "com.google.gms.google-services:4.3.14" firebase-crashlytics = "com.google.firebase.crashlytics:2.9.2" spotless = "com.diffplug.spotless:6.12.0" diff --git a/tasks/build.gradle.kts b/tasks/build.gradle.kts index ebba039b40..cb1de89e01 100644 --- a/tasks/build.gradle.kts +++ b/tasks/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) } android { @@ -37,8 +37,6 @@ dependencies { api(libs.androidx.work.runtime) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) - + annotationProcessor(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 96a4a800bf..33f9f770bb 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.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -60,5 +60,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/discover/build.gradle.kts b/ui/discover/build.gradle.kts index 5e2ad2d5bc..f7b1fa7c5e 100644 --- a/ui/discover/build.gradle.kts +++ b/ui/discover/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -52,5 +52,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/episodedetails/build.gradle.kts b/ui/episodedetails/build.gradle.kts index 867745086c..d5a37187ad 100644 --- a/ui/episodedetails/build.gradle.kts +++ b/ui/episodedetails/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -55,5 +55,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/followed/build.gradle.kts b/ui/followed/build.gradle.kts index db1cb1a1c9..e86cbddc29 100644 --- a/ui/followed/build.gradle.kts +++ b/ui/followed/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -58,5 +58,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/popular/build.gradle.kts b/ui/popular/build.gradle.kts index aed402f8d4..cc8ee134a1 100644 --- a/ui/popular/build.gradle.kts +++ b/ui/popular/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -51,5 +51,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/recommended/build.gradle.kts b/ui/recommended/build.gradle.kts index 9e1fc9a65b..67df9a7794 100644 --- a/ui/recommended/build.gradle.kts +++ b/ui/recommended/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -51,5 +51,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/search/build.gradle.kts b/ui/search/build.gradle.kts index 0168dd274d..fce16d6022 100644 --- a/ui/search/build.gradle.kts +++ b/ui/search/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -51,5 +51,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/settings/build.gradle.kts b/ui/settings/build.gradle.kts index 6df78e7373..580a6c64b6 100644 --- a/ui/settings/build.gradle.kts +++ b/ui/settings/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -35,5 +35,5 @@ dependencies { implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/showdetails/build.gradle.kts b/ui/showdetails/build.gradle.kts index a1cd3d0d6f..770963bdef 100644 --- a/ui/showdetails/build.gradle.kts +++ b/ui/showdetails/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -57,5 +57,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/showseasons/build.gradle.kts b/ui/showseasons/build.gradle.kts index 05b91e4066..a8d83d5982 100644 --- a/ui/showseasons/build.gradle.kts +++ b/ui/showseasons/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -57,5 +57,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/trending/build.gradle.kts b/ui/trending/build.gradle.kts index 3ecbc57f76..bdbfcdf2c8 100644 --- a/ui/trending/build.gradle.kts +++ b/ui/trending/build.gradle.kts @@ -17,7 +17,7 @@ plugins { alias(libs.plugins.android.library) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -51,5 +51,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) } diff --git a/ui/watched/build.gradle.kts b/ui/watched/build.gradle.kts index 74a9e778c4..62604dd624 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.kapt) + alias(libs.plugins.napt) alias(libs.plugins.hilt) } @@ -56,5 +56,5 @@ dependencies { implementation(libs.hilt.compose) implementation(libs.hilt.library) - kapt(libs.hilt.compiler) + annotationProcessor(libs.hilt.compiler) }