Skip to content

Commit cf942dd

Browse files
authored
Decouple generators from Anvil and move them to KSP (duckduckgo#8397)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1214119362406643/task/1214427159097979?focus=true ### Description Move the code generators from Anvil compiler to KSP. ### Steps to test this PR All tests pass, we have: * existing integration tests * new tests added in this PR Also smoke test the app <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **High Risk** > Replaces the custom `:anvil-compiler` annotation processor with a new KSP-based processor and updates multiple modules’ build configuration; codegen/DI wiring changes can break compilation or runtime bindings across the app. > > **Overview** > Migrates DuckDuckGo’s custom Anvil-based code generation off the `:anvil-compiler` module and onto a new KSP module, `:anvil-ksp`. > > Updates affected Android modules to apply the KSP plugin and swap `anvil project(':anvil-compiler')` for `ksp project(':anvil-ksp')`. > > Removes the Anvil `CodeGenerator` implementations (e.g., plugin points, remote feature toggles, workers, view models, activity starters) and introduces a KSP implementation for `@ContributeToActivityStarter` (`ContributeToActivityStarterProcessor` + provider) that generates the same activity/params mapper bindings and optional deeplink parsing helpers. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 34598ec. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 62346e4 commit cf942dd

140 files changed

Lines changed: 6729 additions & 3208 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ad-click/ad-click-impl/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ android {
3838
}
3939

4040
dependencies {
41-
anvil project(path: ':anvil-compiler')
41+
ksp project(':anvil-ksp')
4242
implementation project(path: ':anvil-annotations')
4343
implementation project(path: ':browser-api')
4444
implementation project(path: ':ad-click-api')

‎android-design-system/design-system-internal/build.gradle‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ dependencies {
4848
implementation project(path: ':design-system')
4949

5050
implementation project(path: ':di')
51-
anvil project(path: ':anvil-compiler')
5251
implementation project(path: ':anvil-annotations')
5352
implementation project(path: ':app-build-config-api')
5453
implementation project(':internal-features-api')

‎android-design-system/design-system/build.gradle‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ plugins {
1818
id 'com.android.library'
1919
id 'kotlin-android'
2020
id 'com.squareup.anvil'
21+
id 'com.google.devtools.ksp'
2122
}
2223

2324
apply from: "$rootProject.projectDir/gradle/android-library.gradle"
@@ -45,6 +46,7 @@ android {
4546
}
4647

4748
dependencies {
49+
ksp project(':anvil-ksp')
4850

4951
if (rootProject.ext.proprietaryFontAvailable) {
5052
implementation "com.duckduckgo:ddg-proprietary-fonts:1.0.2"
@@ -55,7 +57,6 @@ dependencies {
5557
implementation project(path: ':common-utils')
5658

5759
implementation project(path: ':di')
58-
anvil project(path: ':anvil-compiler')
5960
implementation project(path: ':anvil-annotations')
6061
implementation project(path: ':app-build-config-api')
6162
implementation project(':internal-features-api')

‎anrs/anrs-impl/build.gradle‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ plugins {
1818
id 'com.android.library'
1919
id 'kotlin-android'
2020
id 'com.squareup.anvil'
21+
id 'com.google.devtools.ksp'
2122
}
2223

2324
apply from: "$rootProject.projectDir/gradle/android-library.gradle"
2425

2526
dependencies {
26-
anvil project(':anvil-compiler')
27+
ksp project(':anvil-ksp')
2728
implementation project(':anvil-annotations')
2829

2930
implementation project(':app-build-config-api')

‎anrs/anrs-internal/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ dependencies {
2828
implementation project(":anrs-impl")
2929
implementation project(":anrs-store")
3030

31-
anvil project(':anvil-compiler')
31+
ksp project(':anvil-ksp')
3232
implementation project(':anvil-annotations')
3333
implementation project(':di')
3434
implementation project(':design-system')

‎anvil/anvil-compiler/build.gradle‎

Lines changed: 0 additions & 48 deletions
This file was deleted.

‎anvil/anvil-compiler/src/main/java/com/duckduckgo/anvil/compiler/ContributeToActivityStarterCodeGenerator.kt‎

Lines changed: 0 additions & 265 deletions
This file was deleted.

0 commit comments

Comments
 (0)