Skip to content

Add ProGuardTransformer to merge META-INF/proguard/*.pro files#1997

Open
Copilot wants to merge 7 commits intomainfrom
copilot/fix-issue-1696
Open

Add ProGuardTransformer to merge META-INF/proguard/*.pro files#1997
Copilot wants to merge 7 commits intomainfrom
copilot/fix-issue-1696

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 27, 2026

Fixes #1696

Summary

Adds a new ProGuardTransformer resource transformer that merges ProGuard rules files under META-INF/proguard/** by concatenating their lines — similar to how ServiceFileTransformer works for META-INF/services files.

Changes

  • ProGuardTransformer.kt: New transformer extending PatternFilterableResourceTransformer. Matches META-INF/proguard/** by default; accumulates lines per file path; writes merged output to the shadow JAR.
  • ShadowJar.kt: Added mergeProGuardFiles(action) convenience method (mirrors mergeServiceFiles).
  • Unit test (src/test/.../ProGuardTransformerTest.kt): Tests canTransformResource, multi-file merging, modifyOutputStream output, and alternate path configuration.
  • Functional test (src/functionalTest/.../ProGuardTransformerTest.kt): End-to-end test verifying both the short mergeProGuardFiles() syntax and the generic transform<ProGuardTransformer> syntax.

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 merging and relocating ProGuard rules

2 participants