From 60345f40638df3153c28897a3e3ffd2f1d68e5e2 Mon Sep 17 00:00:00 2001 From: Blake Dunn Date: Thu, 19 Oct 2023 23:23:03 -0500 Subject: [PATCH] Migrate kapt to ksp --- .gitignore | 34 +++++++++++++++++++++++++--------- app/build.gradle.kts | 8 ++------ build.gradle.kts | 8 +------- gradle/libs.versions.toml | 6 ++---- 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index 794eb0d..c2810ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,27 @@ +# built applications +*.apk + +# Java class files +*.class + +# generated files +bin/ +gen/ +out/ +build/ + +# Local configuration files +local.properties + +# Windows thumbnail db +.DS_Store + +# IDEA/Android Studio project files *.iml +.idea/* + +# Gradle cache .gradle -/local.properties -/.idea -.DS_Store -/build -/app/release -/captures -.externalNativeBuild -.cxx -local.properties + +# Android Studio captures +captures/ diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 4bb0013..9a66caa 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,7 +1,7 @@ plugins { alias(libs.plugins.android.application) alias(libs.plugins.kotlin.android) - alias(libs.plugins.kotlin.kapt) + alias(libs.plugins.ksp) alias(libs.plugins.safeargs) alias(libs.plugins.hilt) alias(libs.plugins.protobuf) @@ -59,10 +59,6 @@ android { } } -kapt { - correctErrorTypes = true -} - dependencies { implementation(libs.androidx.appcompat) implementation(libs.androidx.constraintLayout) @@ -88,7 +84,7 @@ dependencies { implementation(libs.exoplayer.mediaSession) implementation(libs.hilt.android) - kapt(libs.hilt.compiler) + ksp(libs.hilt.compiler) implementation(libs.retrofit.core) implementation(libs.retrofit.converter.gson) diff --git a/build.gradle.kts b/build.gradle.kts index bd699ad..f6232d0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.kotlin.android) apply false - alias(libs.plugins.kotlin.kapt) apply false + alias(libs.plugins.ksp) apply false alias(libs.plugins.safeargs) apply false alias(libs.plugins.hilt) apply false } @@ -11,10 +11,4 @@ buildscript { google() mavenCentral() } - - dependencies { - classpath(libs.android.gradlePlugin) - classpath(libs.kotlin.gradlePlugin) - classpath(libs.androidx.navigation.safeArgs) - } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f9c8336..e4b1259 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,6 +25,7 @@ hilt = "2.48.1" junit4 = "4.13.2" kotlin = "1.9.10" kotlinxCoroutines = "1.7.1" +ksp = "1.9.10-1.0.13" material = "1.10.0" mockWebserver = "4.11.0" protobuf = "3.24.1" @@ -33,7 +34,6 @@ retrofit = "2.9.0" [libraries] accompanist-themeAdapter-material3 = { group = "com.google.accompanist", name = "accompanist-themeadapter-material3", version.ref = "accompanist" } -android-gradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" } androidx-compose-animation = { group = "androidx.compose.animation", name = "animation", version.ref = "androidxCompose" } @@ -55,7 +55,6 @@ androidx-lifecycle-viewModelCompose = { group = "androidx.lifecycle", name = "li androidx-media = { group = "androidx.media", name = "media", version.ref = "androidxMedia" } androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "androidxNavigation" } androidx-navigation-fragment = { group = "androidx.navigation", name = "navigation-fragment", version.ref = "androidxNavigation" } -androidx-navigation-safeArgs = { group = "androidx.navigation", name = "navigation-safe-args-gradle-plugin", version.ref = "androidxNavigation" } androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "androidxNavigation" } androidx-palette-ktx = { group = "androidx.palette", name = "palette-ktx", version.ref = "androidxPalette" } androidx-preference-ktx = { group = "androidx.preference", name = "preference-ktx", version.ref = "androidxPreference" } @@ -69,7 +68,6 @@ exoplayer-mediaSession = { group = "com.google.android.exoplayer", name = "exten hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" } hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" } junit4 = { group = "junit", name = "junit", version.ref = "junit4" } -kotlin-gradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } okhttp-mockWebServer = { group = "com.squareup.okhttp3", name = "mockwebserver", version.ref = "mockWebserver" } @@ -82,6 +80,6 @@ retrofit-converter-gson = { group = "com.squareup.retrofit2", name = "converter- android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } -kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" } safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidxNavigation" }