-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate anvil contribution merging to KSP (#902)
**Background** This PR migrates current kapt-based Anvil contribution merging to KSP one. Works with K2 🙂 **Changes** - Replaced `flipper.anvil.kapt` plugin with `flipper.anvil.entrypoint` - Upgraded Anvil to ZacSweers Anvil 0.3.3 - Upgraded `anvil-utils` to `0.3.0-beta01`. It supports ZacSweers Anvil plugin. - Introduced new `commonKsp` configuration to remove warnings about usage of `ksp` configuration in KMP projects - Use default kotlin hierarchy instead of specifying `dependsOn` manually. - Disabled warning about `expect/actual` classes being in Beta **Test plan** If it builds, it works --------- Co-authored-by: Nikita Kulikov <[email protected]> Co-authored-by: Roman Makeev <[email protected]>
- Loading branch information
1 parent
8f293e5
commit 1e2564a
Showing
27 changed files
with
87 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
build-logic/plugins/convention/src/main/kotlin/commonKspConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import org.gradle.api.Project | ||
|
||
fun Project.includeCommonKspConfigurationTo( | ||
vararg toConfigurations: String, | ||
) { | ||
pluginManager.withPlugin("com.google.devtools.ksp") { | ||
val commonKsp = configurations.create("commonKsp") | ||
toConfigurations.forEach { configurationName -> | ||
configurations.getByName(configurationName).extendsFrom(commonKsp) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,5 @@ plugins { | |
configure<BaseExtension> { | ||
commonAndroid(project) | ||
} | ||
|
||
includeCommonKspConfigurationTo("ksp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
build-logic/plugins/convention/src/main/kotlin/flipper.anvil.entrypoint.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import com.google.devtools.ksp.gradle.KspExtension | ||
|
||
plugins { | ||
id("com.squareup.anvil") | ||
} | ||
|
||
anvil { | ||
useKsp( | ||
contributesAndFactoryGeneration = true, | ||
componentMerging = true, | ||
) | ||
} | ||
|
||
the<KspExtension>().apply { | ||
arg("anvil.ksp.generateShims", "false") | ||
} | ||
|
||
dependencies { | ||
"implementation"(libs.dagger) | ||
"implementation"(libs.anvil.utils.annotations) | ||
"commonKsp"(libs.anvil.utils.compiler) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 0 additions & 29 deletions
29
build-logic/plugins/convention/src/main/kotlin/flipper.anvil.kapt.gradle.kts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.