Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid empty lines in the middle of the manifest when shading a multi-release jar #77

Merged
merged 4 commits into from
Dec 15, 2020

Conversation

jeremyk-91
Copy link
Contributor

Before this PR

#76 was a problem

After this PR

#76 should be fixed.

Possible downsides?

Is there a case I've missed out on / where the blank lines I'm removing lose semantic information?

The test I've added is a bit weak.

@changelog-app
Copy link

changelog-app bot commented Dec 7, 2020

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

Previously, projects that shaded multi-release jars may have had an empty line in the middle of their manifest, which would prevent the manifest from being parsed. This has been removed.

Check the box to generate changelog(s)

  • Generate changelog entry

@policy-bot policy-bot bot requested a review from ferozco December 7, 2020 20:36
import static java.util.jar.JarFile.*

// Originally taken from https://github.com/johnrengelman/shadow/blob/6.1.0/src/main/groovy/com/github/jengelman/
// gradle/plugins/shadow/transformers/ManifestAppenderTransformer.groovy
Copy link
Contributor

Choose a reason for hiding this comment

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

surely we should just be PRing this upstream to mr johnrengelman?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm happy to do this if you think that makes sense, though was a bit concerned as to timescales since the last thing was merged in early October!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll PR this upstream, but also think we should get this through here as we need it for atlasdb-proxy's migrations and I don't know how actively the shadow plugin is maintained (as mentioned, the last time anything was merged was in early October, and there is a 26 day old PR that has seen no response)

Copy link
Contributor

@iamdanfox iamdanfox left a comment

Choose a reason for hiding this comment

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

I'm happy to merge this as @jeremyk-91 has opened GradleUp/shadow#620 so hopefully we can delete our version of this code if that gets merged :)

@bulldozer-bot bulldozer-bot bot merged commit 0674f72 into develop Dec 15, 2020
@bulldozer-bot bulldozer-bot bot deleted the jkong/multiples branch December 15, 2020 14:55
@svc-autorelease
Copy link
Collaborator

Released 1.3.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants