Conversation
- multi-project build - move convention plugins to `:kstreamlined-gradle-plugin` project - add new CI job for running `build-logic` checks
There was a problem hiding this comment.
Hello @ychescale9, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request focuses on refactoring the build-logic module to improve its structure and maintainability. It introduces a multi-project build setup, moves convention plugins to a dedicated kstreamlined-gradle-plugin project, and adds a new CI job to ensure the build-logic module remains consistent and correct. The changes primarily involve moving existing convention plugins and updating package names to reflect the new module structure.
Highlights
- Multi-project build: The build logic is now structured as a multi-project build, which should improve modularity and separation of concerns.
- Convention plugins: Convention plugins have been moved to the
kstreamlined-gradle-pluginproject, promoting better organization and reusability. - CI Job: A new CI job has been added to run checks specifically for the
build-logicmodule, ensuring its quality and consistency. - Package name changes: Package names have been updated to reflect the new module structure, specifically moving convention plugins from
io.github.reactivecircus.kstreamlined.buildlogic.conventiontoio.github.reactivecircus.kstreamlined.gradle.
Changelog
Click here to see the changelog
- .github/actions/cache-build-logic/action.yml
- Updated the cache key to include all subdirectories under
build-logic/src/to ensure the cache is invalidated when any source file changes.
- Updated the cache key to include all subdirectories under
- android/app/build.gradle.kts
- Updated import statements for
FlavorDimensionsandProductFlavorsto reflect the new package location inio.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated import statements for
- android/benchmark/build.gradle.kts
- Updated import statements for
FlavorDimensionsandProductFlavorsto reflect the new package location inio.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated import statements for
- build-logic/.gitignore
- Removed
buildfrom .gitignore.
- Removed
- build-logic/kstreamlined-gradle-plugin/build.gradle.kts
- Updated the detekt config file path to be absolute, using
$rootDir/../detekt.yml. - Updated the implementation class for each gradle plugin registration to use the new package
io.github.reactivecircus.kstreamlined.gradle.
- Updated the detekt config file path to be absolute, using
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/AndroidApplicationConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/AndroidLibraryConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/AndroidScreenshotTestConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/AndroidTestConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/ComposeConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KMPAndroidAndIosConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KMPCommonConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KMPIosOnlyConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KMPTestConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KotlinJvmConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle. - Updated import statements to reflect the new package locations for configuration functions.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/KspConventionPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/RootPlugin.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/AndroidSdk.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic. - Made the
AndroidSdkobject internal.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/androidBuildLogic.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/detektBuildLogic.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/kmpBuildLogic.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/kotlinBuildLogic.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/languageSettings.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/productFlavors.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/kstreamlined-gradle-plugin/src/main/kotlin/io/github/reactivecircus/kstreamlined/gradle/buildlogic/unitTestBuildLogic.kt
- Updated the package declaration to
io.github.reactivecircus.kstreamlined.gradle.buildlogic.
- Updated the package declaration to
- build-logic/settings.gradle.kts
- Added
rootProject.name = "build-logic"to explicitly set the root project name. - Included the
kstreamlined-gradle-pluginproject in the build.
- Added
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
A plugin's new home,
Gradle's logic takes new form,
Build's future unfolds.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
The pull request focuses on refactoring the build-logic module to improve its structure and maintainability. This includes moving convention plugins to a dedicated project and adding a CI job for build-logic checks. The changes seem well-organized and contribute to a more modular codebase.
Summary of Findings
- Inconsistent package names: The package names in the convention plugins have been changed from
io.github.reactivecircus.kstreamlined.buildlogic.conventiontoio.github.reactivecircus.kstreamlined.gradle, but the build logic functions they call still reside in theio.github.reactivecircus.kstreamlined.gradle.buildlogicpackage. This inconsistency could lead to confusion and should be addressed. - Redundant
builddirectory exclusion: The.gitignorefile in thebuild-logicdirectory previously excluded thebuilddirectory, but this exclusion is no longer present. It's important to ensure that build artifacts are not accidentally committed to the repository. - Hardcoded path in detekt configuration: The path to
detekt.ymlis hardcoded using$rootDir. While this works, it might be better to use a more robust and flexible approach for resolving the file path.
Merge Readiness
The pull request introduces significant improvements to the build logic structure. However, the package name inconsistency and the .gitignore change should be addressed before merging. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging.
| detekt { | ||
| source.from(files("src/")) | ||
| config.from(files("../detekt.yml")) | ||
| config.from(files("$rootDir/../detekt.yml")) |
kstreamlined-gradle-pluginprojectbuild-logicchecks