Skip to content

Add absentProviderCompat for providers.absent() - #2357

Merged
Goooler merged 1 commit into
mainfrom
g/20261107/provider-absent
Nov 7, 2026
Merged

Goooler merged 1 commit into
mainfrom
g/20261107/provider-absent

Conversation

@Goooler

@Goooler Goooler commented Nov 7, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the absent-provider compatibility change.

No open issues 🎉

What changed in this PR

Adds an internal compatibility helper for absent Gradle providers and uses it when ShadowJar sources JAR generation is disabled.

Changes:

  • Uses providers.absent() on Gradle 9.9 and newer, with provider { null } as the fallback.
  • Replaces the empty file property in ShadowJar with the compatibility helper, preserving the absent-output behavior.
File Description
src/​main/​kotlin/​com/​github/​jengelman/​gradle/​plugins/​shadow/​tasks/​ShadowJar.kt Uses the helper when sources JAR generation is disabled.
src/​main/​kotlin/​com/​github/​jengelman/​gradle/​plugins/​shadow/​internal/​GradleCompat.kt Adds the version-aware absentProviderCompat helper.

Review effort: Balanced

@Goooler
Goooler enabled auto-merge (squash) November 7, 2026 07:08
@Goooler
Goooler merged commit f885498 into main Nov 7, 2026
7 checks passed
@Goooler
Goooler deleted the g/20261107/provider-absent branch November 7, 2026 07:21
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.

2 participants