Skip to content

Conversation

@Goooler
Copy link
Member

@Goooler Goooler commented Jul 30, 2025

Closes #1357.


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

@Goooler
Copy link
Member Author

Goooler commented Jul 30, 2025

Noted the breaking change in #1547, we can't set the strategy back as it fails the transformers.

https://scans.gradle.com/s/ul6xobwusbbwm/tests/overview?outcome=FAILED

@Goooler
Copy link
Member Author

Goooler commented Jul 30, 2025

May need to add a new transformer to prevent duplicate files to fallback the case like GrimAnticheat/Grim#2229 (comment).

@Goooler Goooler changed the title Try to set the default duplicatesStrategy back to EXCLUDE Add PreserveFirstFoundResourceTransformer Jul 30, 2025
@Goooler Goooler marked this pull request as ready for review July 30, 2025 12:41
@Goooler Goooler requested a review from Copilot July 30, 2025 12:41

This comment was marked as outdated.

…nsformers/PreserveFirstFoundResourceTransformer.kt
@Goooler Goooler enabled auto-merge (squash) July 30, 2025 12:58
@Goooler Goooler requested a review from Copilot July 30, 2025 12:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new PreserveFirstFoundResourceTransformer class that provides a way to handle duplicate resources by preserving only the first instance found. This is particularly useful when using the default DuplicatesStrategy.INCLUDE and wanting to ensure only the first found resource (typically from the project itself) is included in the final JAR.

Key changes:

  • Implements a new transformer that tracks found resources and excludes subsequent duplicates
  • Adds comprehensive functional tests to verify the transformer behavior
  • Updates documentation to reference the new transformer

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
PreserveFirstFoundResourceTransformer.kt New transformer implementation with resource tracking logic
TransformersTest.kt Functional test verifying the transformer preserves first found resources
docs/configuration/merging/README.md Documentation update referencing the new transformer
docs/changes/README.md Changelog entry documenting the addition
api/shadow.api API definition for the new transformer class

@Goooler Goooler merged commit 15e394a into main Jul 30, 2025
13 checks passed
@Goooler Goooler deleted the g/20250730/set-dup-strategy-back branch July 30, 2025 13:08
@Goooler Goooler mentioned this pull request Nov 15, 2025
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.

Exclude a specific class from a dependency but it's the same name as a local one

2 participants