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

Support using type-safe dependency accessors in ShadowJar.dependencies #1322

Merged
merged 10 commits into from
Mar 11, 2025

Conversation

Goooler
Copy link
Member

@Goooler Goooler commented Mar 7, 2025

Closes #923.


  • CHANGELOG's "Unreleased" section has been updated, if applicable.

Sorry, something went wrong.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 updates the dependency resolution logic in AbstractDependencyFilter.kt to handle Provider and DependencyValueSource types. This change aims to improve the flexibility of dependency filtering. The addition to lint-baseline.xml suppresses a lint error related to internal Gradle API usage.

Summary of Findings

  • Internal Gradle API Usage: The code introduces a dependency on org.gradle.api.internal.catalog.DependencyValueSource, which is an internal Gradle API. While the lint baseline is updated to suppress the warning, it's crucial to understand the implications of using internal APIs, as they are subject to change without notice and can break the plugin in future Gradle versions. Consider if there are public APIs that can achieve the same result.
  • Nullability of dependencyNotation.obtain(): The code uses requireNotNull(dependencyNotation.obtain()). While this prevents a potential NullPointerException, it would be useful to understand the conditions under which dependencyNotation.obtain() can return null, and whether a more graceful handling mechanism is possible.

Merge Readiness

The pull request introduces changes that touch internal Gradle APIs. While the immediate functionality might be correct, the long-term maintainability and compatibility with future Gradle versions should be carefully considered. Given the use of internal APIs, I recommend a thorough review by someone with deep knowledge of Gradle internals. I am unable to approve this pull request, and recommend that others review and approve this code before merging. At a minimum, the high severity issue should be addressed before merging.

Goooler added 4 commits March 11, 2025 09:58
…pport-type-safe-accessors
@Goooler Goooler marked this pull request as ready for review March 11, 2025 02:27
@Goooler Goooler changed the title Update dependency resolution for types Support using type-safe dependency accessors in ShadowJar.dependencies Mar 11, 2025
@Goooler Goooler requested a review from Copilot March 11, 2025 02:30

Choose a reason for hiding this comment

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

PR Overview

This PR adds support for using type-safe dependency accessors in ShadowJar.dependencies, as noted in the changelog update.

  • Introduces a changelog entry for the new feature.

Reviewed Changes

File Description
docs/changes/README.md Updated changelog with a new entry for type-safe dependency accessor usage.

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

…pe-safe-accessors
@Goooler Goooler enabled auto-merge (squash) March 11, 2025 03:41
@Goooler Goooler merged commit 2c0d047 into main Mar 11, 2025
7 checks passed
@Goooler Goooler deleted the g/20250307/support-type-safe-accessors branch March 11, 2025 03:47
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.

Support excluding type-safe dependency accessors from dendencies
1 participant