Skip to content

Use _minimizeJar.flatMap to guard toMinimize and apiJars - #2277

Merged
Goooler merged 1 commit into
mainfrom
g/20260903/simplify-again
Sep 3, 2026
Merged

Use _minimizeJar.flatMap to guard toMinimize and apiJars#2277
Goooler merged 1 commit into
mainfrom
g/20260903/simplify-again

Conversation

@Goooler

@Goooler Goooler commented Sep 3, 2026

Copy link
Copy Markdown
Member

Closes #2276.

@Goooler Goooler changed the title Use _minimizeJar.flatMap to guard toMinimize and apiJars Use _minimizeJar.flatMap to guard toMinimize and apiJars Sep 3, 2026
@Goooler
Goooler requested a lite review from Copilot September 3, 2026 10:01

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

The change improves provider laziness without altering the enabled minimization behavior, and no code-level correctness issues were found.

Pull request overview

This PR refines the lazy wiring of minimization-related task inputs in ShadowJar so classpath-related providers aren’t realized when minimization is disabled, aligning provider chaining with Gradle’s flatMap idioms.

Changes:

  • Updated toMinimize to use _minimizeJar.flatMap { ... } and defer configurations access via configurations.map { ... } only when minimization is enabled.
  • Updated apiJars to use _minimizeJar.flatMap { ... } to avoid nested providers and keep API jar resolution disabled when minimization is off.
File summaries
File Description
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt Switches minimization-related file collection inputs to flatMap to avoid unnecessary classpath resolution when minimization is disabled.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Goooler
Goooler enabled auto-merge (squash) September 3, 2026 10:06
@Goooler
Goooler merged commit aecc30a into main Sep 3, 2026
7 checks passed
@Goooler
Goooler deleted the g/20260903/simplify-again branch September 3, 2026 10:16
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