Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 10, 2025

This PR consolidates all hardcoded dependencies across the project's build.gradle.kts files into the centralized version catalog (gradle/libs.versions.toml), improving dependency management and consistency.

Changes Made

Updated gradle/libs.versions.toml

  • Added version entries for previously hardcoded dependencies:
    • junit = "5.10.1"
    • kotest = "5.8.0"
    • syntaxerrorJson5 = "2.1.0"
  • Added library entries for all testing dependencies:
    • junit, kotestRunner, kotestAssertions, kotestProperty
  • Added external library entry for syntaxerrorJson5
  • Created a testing bundle that groups all test dependencies for convenient importing

Updated lib/build.gradle.kts

  • Replaced 4 hardcoded test dependencies with a single bundle reference:
    // Before
    testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
    testImplementation("io.kotest:kotest-runner-junit5:5.8.0")
    testImplementation("io.kotest:kotest-assertions-core:5.8.0")
    testImplementation("io.kotest:kotest-property:5.8.0")
    
    // After
    testImplementation(libs.bundles.testing)

Updated benchmark/build.gradle.kts

  • Replaced hardcoded dependencies with catalog references:
    // Before
    implementation("at.syntaxerror:json5:2.1.0")
    testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
    
    // After
    implementation(libs.syntaxerrorJson5)
    testImplementation(libs.junit)

Benefits

  • Centralized version management: All dependency versions are now managed in one place
  • Consistency: Ensures the same versions are used across all modules
  • Maintainability: Version updates only need to be made in the version catalog
  • Type safety: Gradle's type-safe accessors provide compile-time validation
  • Reduced duplication: The testing bundle eliminates repeated dependency declarations

Verification

  • ✅ All builds pass (./gradlew build)
  • ✅ All tests continue to pass (127 tests completed, 2 skipped)
  • ✅ No functionality changes - this is purely a refactoring for better dependency management

Fixes #36.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: hossain-khan <99822+hossain-khan@users.noreply.github.com>
Copilot AI changed the title [WIP] Use centralized version catalog libs.versions.toml Centralize all dependencies in version catalog Jun 10, 2025
Copilot AI requested a review from hossain-khan June 10, 2025 00:22
Copilot finished work on behalf of hossain-khan June 10, 2025 00:22
Comment on lines 31 to +33
[bundles]
kotlinxEcosystem = ["kotlinxDatetime", "kotlinxSerialization", "kotlinxCoroutines"]
testing = ["junit", "kotestRunner", "kotestAssertions", "kotestProperty"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL! 🤯

@hossain-khan hossain-khan marked this pull request as ready for review June 10, 2025 00:24
@hossain-khan hossain-khan merged commit f9584c9 into main Jun 10, 2025
2 checks passed
@hossain-khan hossain-khan deleted the copilot/fix-36 branch June 10, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use centralized version catalog libs.versions.toml

2 participants