Skip to content

Add ManifestAppenderTransformer to support sealing packages in jars.#474

Merged
johnrengelman merged 3 commits intoGradleUp:masterfrom
chrisr3:chrisr3-manifest-appender
Jun 29, 2019
Merged

Add ManifestAppenderTransformer to support sealing packages in jars.#474
johnrengelman merged 3 commits intoGradleUp:masterfrom
chrisr3:chrisr3-manifest-appender

Conversation

@chrisr3
Copy link
Copy Markdown
Contributor

@chrisr3 chrisr3 commented Mar 26, 2019

Java's manifest attributes are implemented using a HashMap, which makes them useless when the attributes must be written in a particular order. E.g. for sealing packages in jars:

Name: com/example/
Sealed: true

Implement a Transformer which can append tags to a manifest while preserving their order.

Note: This is a WIP - my transformer's current UI is based on Groovy's Tuple2. However, I'm sure that Groovy can support something better.

The transformer's current API is:

shadowJar {
    transform(ManifestAppenderTransformer) {
        append('Name', 'first/sealed/package/')
        append('Sealed', true)
        append('Name', 'second/sealed/package/')
        append('Sealed', true)
    }
}

@chrisr3
Copy link
Copy Markdown
Contributor Author

chrisr3 commented Mar 27, 2019

BTW, can this plugin be installed into a local repository? I would like to test it properly on an actual project 😉.

@chrisr3 chrisr3 force-pushed the chrisr3-manifest-appender branch from eef7c0c to eaa8a90 Compare March 27, 2019 00:14
@chrisr3 chrisr3 force-pushed the chrisr3-manifest-appender branch from b626534 to a091d0c Compare March 27, 2019 09:59
@johnrengelman johnrengelman merged commit 9e62399 into GradleUp:master Jun 29, 2019
@johnrengelman johnrengelman added this to the 5.1.0 milestone Jun 29, 2019
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.

2 participants