Fail build when inputting AAR files or using Shadow with AGP#1530
Merged
Fail build when inputting AAR files or using Shadow with AGP#1530
Conversation
6792c27 to
2bc8bae
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements build-time validation to prevent incompatible usage of the Shadow plugin with Android projects. The changes add error handling for AAR files in shadow tasks and block the Shadow plugin from being used with Android Gradle Plugin (AGP).
- Adds runtime validation to fail builds when AAR files are processed during shadowing
- Prevents Shadow plugin initialization when any Android Gradle Plugin is detected
- Includes comprehensive test coverage for both validation scenarios
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ShadowJar.kt | Adds AAR file detection and error handling in the copy task |
| ShadowPlugin.kt | Adds AGP compatibility check that fails plugin initialization |
| JavaPluginTest.kt | Adds test case for AAR file processing failure |
| BasePluginTest.kt | Extends test infrastructure to support custom repository configuration |
| AndroidPluginTest.kt | New test class covering AGP compatibility failures for multiple Android plugin types |
| libs.versions.toml | Adds AGP dependency for testing with version pinning comment |
| README.md | Updates changelog with the new feature |
| renovate.json5 | Disables automatic AGP version updates to maintain test compatibility |
src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/tasks/ShadowJar.kt
Outdated
Show resolved
Hide resolved
src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/AndroidPluginTest.kt
Outdated
Show resolved
Hide resolved
…ks/ShadowJar.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…shadow/AndroidPluginTest.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
85c59c8 to
7b0cd2b
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1454.