-
-
Notifications
You must be signed in to change notification settings - Fork 69
Migrate to Gradle KTS and Version Catalogs #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Converted all .gradle (Groovy) files to .gradle.kts (Kotlin DSL): - settings.gradle - build.gradle (root) - whynotimagecarousel/build.gradle - sample/build.gradle Introduced Gradle Version Catalog (libs.versions.toml) to manage dependencies and plugin versions centrally. Updated Gradle plugin versions where necessary (e.g., com.vanniktech.maven.publish). Refactored Spotless configuration for KTS compatibility. Adjusted Dokka configuration for KTS. Build verification: - Gradle tasks can be listed. - Spotless formatting applies successfully. - Android module compilation and Dokka generation could not be fully verified due to limitations in accessing/configuring the Android SDK path in the execution environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @ImaginativeShohag, 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!
This pull request undertakes a significant modernization of the project's build system. It transitions all Gradle build scripts from Groovy to Kotlin DSL and establishes a centralized dependency management system using Gradle Version Catalogs. These changes aim to enhance build script readability, maintainability, and type-safety, while also updating various build tool configurations for compatibility and improved practices.
Highlights
- Gradle Build Script Migration: All existing Groovy-based Gradle build scripts (
.gradle
files) have been successfully converted to Kotlin DSL (.gradle.kts
) across the root project and its submodules (whynotimagecarousel
,sample
). This includessettings.gradle
, rootbuild.gradle
,whynotimagecarousel/build.gradle
, andsample/build.gradle
. - Centralized Dependency Management: A new Gradle Version Catalog (
gradle/libs.versions.toml
) has been introduced to centralize the management of all project dependencies, plugins, and their versions. This improves consistency, readability, and maintainability of dependencies across the project. - Build Tooling Updates and Refactoring: Gradle plugin versions, including
com.vanniktech.maven.publish
, have been updated. Configurations for Spotless (code formatter) and Dokka (documentation generator) have been refactored to be fully compatible with the Kotlin DSL, ensuring continued code quality and documentation generation.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR migrates the project’s Groovy-based Gradle scripts to Kotlin DSL and centralizes dependency/plugin versions via a Version Catalog.
- Converted all module and root
.gradle
files to.gradle.kts
- Introduced
libs.versions.toml
for centralized version management - Updated plugin versions, refactored Dokka/Spotless configs for KTS compatibility
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
whynotimagecarousel/build.gradle.kts | Kotlin DSL migration, added version catalog aliases and Maven publish block |
whynotimagecarousel/build.gradle | Removed old Groovy build script |
settings.gradle.kts | Converted to KTS, updated include syntax and rootProject name |
sample/build.gradle.kts | Kotlin DSL migration with Version Catalog aliases |
sample/build.gradle | Removed old Groovy build script |
gradle/libs.versions.toml | Defined versions, libraries, plugins, and bundles |
gradle.properties | Added VERSION_NAME property for sample/app |
Comments suppressed due to low confidence (2)
whynotimagecarousel/build.gradle.kts:1
- The library module currently has no tests configured. Consider adding unit or integration tests to validate core carousel functionality.
/**
gradle/libs.versions.toml:6
- [nitpick] Verify that the Kotlin plugin version
2.1.21
is intentional and compatible with the Kotlin DSL and Android Gradle Plugin; an unexpected major version may cause build failures.
kotlin = "2.1.21"
// The version here (2.1.1) was hardcoded in the original Groovy script. | ||
// Ideally, this would also come from a single source of truth, like gradle.properties or version catalog if static. | ||
// For now, keeping it as it was. | ||
coordinates("org.imaginativeworld.whynotimagecarousel", "whynotimagecarousel", "2.1.1") |
Copilot
AI
Jun 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Hardcoding the publication version here can lead to inconsistencies. Consider sourcing this version from project properties or the version catalog for centralized version management.
Copilot uses AI. Check for mistakes.
versionCode = 1 | ||
// Assuming VERSION_NAME is defined in gradle.properties | ||
// If not, this will fail. Plan includes checking/adding it to gradle.properties. | ||
versionName = project.property("VERSION_NAME") as String? ?: "1.0" // Provide a default or handle missing property |
Copilot
AI
Jun 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Providing a fallback versionName may mask a missing VERSION_NAME
configuration. Prefer failing early or ensuring VERSION_NAME
is always set in gradle.properties
instead of defaulting here.
Copilot uses AI. Check for mistakes.
|
||
buildFeatures { | ||
viewBinding = true | ||
dataBinding = true // Ensure dataBinding is still needed. If so, keep it. |
Copilot
AI
Jun 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Resolve this placeholder comment by confirming whether dataBinding
is required; then remove the comment or the feature flag if it's no longer needed.
dataBinding = true // Ensure dataBinding is still needed. If so, keep it. | |
dataBinding = true |
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request migrates the build system to Gradle Kotlin DSL and adopts Version Catalogs. Review highlights potential issues with KSP and Android SDK versions, and suggests centralizing version and copyright information for better maintainability.
[versions] | ||
agp = "8.10.1" | ||
kotlin = "2.1.21" | ||
ksp = "2.1.21-2.0.2" # Note: KSP version is often tightly coupled with Kotlin version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compileSdk = "36" | ||
minSdk = "21" | ||
targetSdk = "36" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
versionCode = 1 | ||
// Assuming VERSION_NAME is defined in gradle.properties | ||
// If not, this will fail. Plan includes checking/adding it to gradle.properties. | ||
versionName = project.property("VERSION_NAME") as String? ?: "1.0" // Provide a default or handle missing property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The version here (2.1.1) was hardcoded in the original Groovy script. | ||
// Ideally, this would also come from a single source of truth, like gradle.properties or version catalog if static. | ||
// For now, keeping it as it was. | ||
coordinates("org.imaginativeworld.whynotimagecarousel", "whynotimagecarousel", "2.1.1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pluginsMapConfiguration.set( | ||
mapOf( | ||
"org.jetbrains.dokka.base.DokkaBase" to """{ | ||
"footerMessage": "Copyright © 2021 Md. Mahmudul Hasan Shohag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pluginsMapConfiguration.set( | ||
mapOf( | ||
"org.jetbrains.dokka.base.DokkaBase" to """{ | ||
"footerMessage": "Copyright © 2020 Md. Mahmudul Hasan Shohag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted all .gradle (Groovy) files to .gradle.kts (Kotlin DSL):
Introduced Gradle Version Catalog (libs.versions.toml) to manage dependencies and plugin versions centrally.
Updated Gradle plugin versions where necessary (e.g., com.vanniktech.maven.publish). Refactored Spotless configuration for KTS compatibility. Adjusted Dokka configuration for KTS.
Build verification: