Skip to content

Commit

Permalink
enable circuit codegen
Browse files Browse the repository at this point in the history
  • Loading branch information
frett committed Dec 8, 2023
1 parent f0aeeef commit 88f4ac9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 43 deletions.

This file was deleted.

1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies {
implementation(libs.json)
implementation(libs.kotlin.gradlePlugin)
implementation(libs.kotlin.kover.gradlePlugin)
implementation(libs.ksp.gradlePlugin)
implementation(libs.onesky.gradlePlugin)
}

Expand Down
10 changes: 6 additions & 4 deletions build-logic/src/main/kotlin/AndroidConfiguration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ fun CommonExtension<*, *, *, *, *>.configureCompose(project: Project, enableCirc
}

if (enableCircuit) {
project.plugins.apply("kotlin-parcelize")
project.pluginManager.apply("com.google.devtools.ksp")
project.pluginManager.apply("kotlin-parcelize")

project.dependencies.apply {
addProvider("implementation", project.libs.findBundle("circuit").get())
}
project.dependencies.addProvider("implementation", project.libs.findBundle("circuit").get())
project.dependencies.addProvider("ksp", project.libs.findLibrary("circuit-codegen").get())

project.ksp.arg("circuit.codegen.mode", "hilt")
}
}

Expand Down
2 changes: 2 additions & 0 deletions build-logic/src/main/kotlin/Project.kt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.android.build.api.variant.AndroidComponentsExtension
import com.google.devtools.ksp.gradle.KspExtension
import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.artifacts.VersionCatalogsExtension
Expand All @@ -13,3 +14,4 @@ internal fun Project.kapt(configure: KaptExtension.() -> Unit) = extensions.conf
internal val Project.libs get() = project.extensions.getByType<VersionCatalogsExtension>().named("libs")
internal val Project.androidComponents
get() = project.extensions.getByName("androidComponents") as AndroidComponentsExtension<*, *, *>
internal val Project.ksp get() = project.extensions.getByType<KspExtension>()
5 changes: 4 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ gtoSupport = "4.2.0-SNAPSHOT"
kotlin = "1.9.21"
kotlinCoroutines = "1.7.3"
kotlinKover = "0.7.5"
ksp = "1.9.21-1.0.15"
ktlint = "1.0.1"
ktlintGradle = "12.0.2"
lottie = "6.2.0"
Expand Down Expand Up @@ -78,6 +79,7 @@ androidx-viewpager2 = { module = "androidx.viewpager2:viewpager2", version.ref =
androidx-work = { module = "androidx.work:work-runtime", version.ref = "androidx-work" }
androidx-work-ktx = { module = "androidx.work:work-runtime-ktx", version.ref = "androidx-work" }
appsflyer = "com.appsflyer:af-android-sdk:6.12.4"
circuit-codegen = { module = "com.slack.circuit:circuit-codegen", version.ref = "circuit" }
circuit-codegen-annotations = { module = "com.slack.circuit:circuit-codegen-annotations", version.ref = "circuit" }
circuit-foundation = { module = "com.slack.circuit:circuit-foundation", version.ref = "circuit" }
circuit-test = { module = "com.slack.circuit:circuit-test", version.ref = "circuit" }
Expand Down Expand Up @@ -173,6 +175,7 @@ kotlin-gradlePlugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", ve
kotlin-kover-gradlePlugin = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version.ref = "kotlinKover" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
ksp-gradlePlugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlintGradle" }
leakcanary = "com.squareup.leakcanary:leakcanary-android:2.12"
lottie = { module = "com.airbnb.android:lottie", version.ref = "lottie" }
Expand Down Expand Up @@ -228,5 +231,5 @@ firebase-perf = { id = "com.google.firebase.firebase-perf", version = "1.4.2" }
google-services = { id = "com.google.gms.google-services", version = "4.4.0" }
grgit = { id = "org.ajoberstar.grgit", version = "5.2.1" }
hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" }
ksp = { id = "com.google.devtools.ksp", version = "1.9.21-1.0.15" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlintGradle" }

0 comments on commit 88f4ac9

Please sign in to comment.