[#123] Modernize Gradle build structure (prep for Gradle 9)#129
Open
ssawchenko wants to merge 11 commits into
Open
[#123] Modernize Gradle build structure (prep for Gradle 9)#129ssawchenko wants to merge 11 commits into
ssawchenko wants to merge 11 commits into
Conversation
- Add gradle/libs.versions.toml with all library dependency versions - Update app and steamclog modules to use catalog references (libs.xxx) - Add missing testImplementation junit to both modules - Upgrade Gradle wrapper 8.13 -> 8.14.4 (required by Kotlin 2.4.0) - Replace deprecated android.defaults.buildfeatures.buildconfig property with explicit buildConfig true in app and steamclog modules - Fix API 24 lint errors in Destinations.kt by replacing forEach with for loops Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add pluginManagement and dependencyResolutionManagement blocks to settings.gradle so all repository declarations live in one place. Remove the allprojects repositories block from build.gradle and the redundant buildscript repositories block from app/build.gradle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the legacy buildscript { dependencies { classpath } } pattern
with a modern plugins {} block. All four plugins are declared with
apply false at the root so submodules inherit versions without
re-declaring them. Removes the kotlin entry from ext.versions as it
was only needed for the old classpath reference.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace deprecated compileSdkVersion/minSdkVersion/targetSdkVersion with the modern compileSdk/minSdk/targetSdk forms. Remove the unused fileTree libs dependency from steamclog (the libs directory is empty). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AGP disables minification for debuggable builds regardless, so the setting had no effect. Proguard is still tested via the release build. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove stale tools:replace from io.sentry.auto-init meta-data; newer Sentry versions no longer inject a conflicting declaration so there is nothing to replace. Update CHANGELOG to reflect Gradle wrapper bump and API 23 forEach fix landed in this branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR modernizes the project’s Gradle build configuration by introducing a version catalog, centralizing repository configuration in settings.gradle, and migrating build scripts toward the modern plugins {} + AGP DSL style. It also includes a small Kotlin source change to improve API 23 compatibility by avoiding Java forEach calls.
Changes:
- Added
gradle/libs.versions.tomland migrated module dependencies tolibs.*catalog references. - Centralized plugin/dependency repositories in
settings.gradleand updated the Gradle wrapper to 8.14.4. - Updated Android/AGP DSL usage (
compileSdk,minSdk,targetSdk,buildFeatures.buildConfig) and adjusted some logging/file-iteration code inDestinations.kt.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
steamclog/src/main/java/com/steamclock/steamclog/Destinations.kt |
Replaces Java forEach usages with Kotlin for loops for API 23 compatibility and adjusts file iteration logic. |
steamclog/build.gradle |
Migrates dependency declarations to version-catalog aliases and updates AGP DSL fields. |
settings.gradle |
Centralizes repository declarations via pluginManagement and dependencyResolutionManagement. |
gradle/wrapper/gradle-wrapper.properties |
Updates Gradle wrapper distribution to 8.14.4. |
gradle/libs.versions.toml |
Introduces a version catalog for libraries and plugins. |
gradle.properties |
Removes deprecated android.defaults.buildfeatures.buildconfig. |
CHANGELOG.md |
Updates unreleased notes to reflect the build/dependency modernization. |
build.gradle |
Switches root build to modern plugins {} version management and trims legacy buildscript usage. |
app/src/main/AndroidManifest.xml |
Removes a stale tools:replace attribute from Sentry metadata. |
app/build.gradle |
Migrates dependencies to the version catalog, updates AGP DSL fields, and removes ineffective debug minification config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace kotlin-android alias with org.jetbrains.kotlin.android so
submodule plugin declarations match the root plugins block exactly.
The alias was a holdover from the buildscript classpath approach and
is fragile in the modern plugins {} resolution system.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids allocating a Date object per file and keeps the expiry check consistent across all files in a single removeOldLogFiles pass. Use System.currentTimeMillis() directly instead of Date().time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
File.delete() returns false on failure; check the result and emit a console log so failed cleanup is observable rather than silent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tools:replace attribute was removed in a prior commit; the tools namespace declaration is now unused. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dc81c5e to
28238bf
Compare
737f786 to
28238bf
Compare
munl
approved these changes
Jul 3, 2026
| agp = "8.13.2" | ||
| kotlin = "2.4.0" | ||
| sentry = "8.43.1" | ||
| sentry-plugin = "6.10.0" |
Collaborator
There was a problem hiding this comment.
ignore my comment in my previous PR review and just update to 6.14.0 here
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gradle/libs.versions.tomlversion catalog; migrate all library dependency declarations to use catalog referencessettings.gradleusingpluginManagementanddependencyResolutionManagementbuild.gradlefrom legacybuildscript { classpath }pattern to modernplugins {}blockcompileSdk/minSdk/targetSdk)Pre-existing issues also fixed:
testImplementation junitto both modulesDestinations.kt— JavaforEachcalls replaced withforloopsandroid.defaults.buildfeatures.buildconfigfromgradle.properties; add explicitbuildConfig trueper moduleminifyEnabled truefrom debug build type (AGP silently ignores it for debuggable builds)tools:replacefromio.sentry.auto-initmanifest entryCopilot feedback addressed:
org.jetbrains.kotlin.androidplugin ID in module build filesxmlns:toolsnamespace fromAndroidManifest.xmlNote
Test plan
./gradlew buildpasses with no new warningsNote, I am seeing a bunch of these warnings which I hope to address after moving to Gradle 9
./gradlew :steamclog:assembleReleasecompletes successfully🤖 Generated with Claude Code