Skip to content

Commit

Permalink
Migrate from kapt to KSP (#261)
Browse files Browse the repository at this point in the history
* Migrate from kapt to KSP

* Commented `kotlin.compiler.execution.strategy=in-process` in CI to circumvent OOMs due to increased metaspace usage.
  • Loading branch information
fornewid authored Dec 10, 2023
1 parent 9fd0be7 commit f45d2ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/ci-gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.workers.max=2

kotlin.compiler.execution.strategy=in-process
kotlin.incremental=false
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ import org.gradle.api.artifacts.VersionCatalogsExtension
import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.getByType
import soup.movie.buildlogic.implementation
import soup.movie.buildlogic.kapt
import soup.movie.buildlogic.ksp

class AndroidHiltConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("dagger.hilt.android.plugin")
apply("org.jetbrains.kotlin.kapt")
apply("com.google.devtools.ksp")
}

val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
dependencies {
implementation(libs.findLibrary("dagger.hilt.android").get())
kapt(libs.findLibrary("dagger.hilt.compiler").get())
ksp(libs.findLibrary("dagger.hilt.compiler").get())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ fun DependencyHandler.implementation(dependencyNotation: Any): Dependency? {
return add("implementation", dependencyNotation)
}

fun DependencyHandler.kapt(dependencyNotation: Any): Dependency? {
return add("kapt", dependencyNotation)
fun DependencyHandler.ksp(dependencyNotation: Any): Dependency? {
return add("ksp", dependencyNotation)
}

fun DependencyHandler.androidTestImplementation(dependencyNotation: Any): Dependency? {
Expand Down
1 change: 0 additions & 1 deletion data/network/api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
plugins {
id "moop.android.library"
id "org.jetbrains.kotlin.kapt"
id "org.jetbrains.kotlin.plugin.serialization"
}

Expand Down
4 changes: 2 additions & 2 deletions feature/tasks/impl/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "moop.android.library"
id "moop.android.hilt"
id "org.jetbrains.kotlin.kapt"
id "com.google.devtools.ksp"
}

android {
Expand All @@ -26,7 +26,7 @@ dependencies {
implementation libs.kotlin.stdlib

implementation libs.androidx.hilt.work
kapt libs.androidx.hilt.compiler
ksp libs.androidx.hilt.compiler

implementation libs.androidx.work.runtime
androidTestImplementation libs.androidx.work.testing
Expand Down

0 comments on commit f45d2ff

Please sign in to comment.