Skip to content
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

Extract dependencies from Gradle Version Catalogs #3542

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Jan 13, 2025

This adds partial support for Gradle builds that use a version catalog (i.e. a gradle/libs.versions.toml file). Dependencies are extracted from the version catalog just by parsing the libs.versions.toml file. Since the version catalog only contains libraries and no resolvers, the default resolver is used for the Scope of these libraries.

The support is only partial, because

  • a default resolver is assumed (as mentioned above)
  • dependencies and plugins that are defined in other Gradle build files are ignored
  • additional version catalogs are ignored
  • a version catalog with a custom name is ignored

Closes: #3534

@fthomas fthomas added enhancement New feature or request cat:build-tool labels Jan 13, 2025
@fthomas fthomas added this to the 0.32.2 milestone Jan 13, 2025
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 98.52941% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.88%. Comparing base (5b13f31) to head (7ea401d).

Files with missing lines Patch % Lines
...scalasteward/core/buildtool/gradle/GradleAlg.scala 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3542      +/-   ##
==========================================
+ Coverage   89.81%   89.88%   +0.06%     
==========================================
  Files         171      174       +3     
  Lines        4989     5022      +33     
  Branches      496      486      -10     
==========================================
+ Hits         4481     4514      +33     
  Misses        508      508              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fthomas fthomas force-pushed the topic/gradle-version-catalog branch 4 times, most recently from b5d3b0a to 74cbed5 Compare January 17, 2025 11:15
This adds partial support for Gradle builds that use a [version
catalog](https://docs.gradle.org/current/userguide/version_catalogs.html)
(i.e. a `gradle/libs.versions.toml` file). Dependencies are extracted
from the version catalog just by parsing the `libs.versions.toml` file.
Since the version catalog only contains libraries and no resolvers, the
default resolver is used for the `Scope` of these libraries. This is
one reason why this Gradle support is only partial. The other is that
additional dependencies and plugins that are defined in other Gradle
build files are also ignored.

Closes: #3534
@fthomas fthomas force-pushed the topic/gradle-version-catalog branch from 74cbed5 to 7ea401d Compare January 17, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:build-tool enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract dependencies from Gradle Version Catalogs
1 participant