Add a whitespace trimming mode to ManifestAppenderTransformer #620
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.
Hi there,
We use the ManifestAppenderTransformer in a Gradle plugin that wraps the Shadow plugin: https://github.com/palantir/gradle-shadow-jar.
We've tried to use the ManifestAppenderTransformer to add tags to an existing manifest file. However, existing manifest files often have a blank line at the end, and so the current transformer if used to extend such a file will leave a blank line between the existing content and any added tags. In other words, if we tried to add the tag
bar: 1234
to a manifest with a tagfoo: 123
and a blank line at the end, we getThis PR extends the transformer with a mode where it trims whitespace, so that tags are added to the last section of the manifest (as opposed to beginning a new section). This would allow using this transformer to add tags to the main section of an existing manifest (which is what we are trying to do with the plugin when shading a multi-release jar). With this mode you would obtain
This is strictly opt-in, so existing users should not be affected.
@iamdanfox for SA