A CLI wrapper around Jar Jar Abrams. Builds a command line utility which can process and shade JAR files.
See Releases for downloads
$ jarjar-abrams-cli -h
-j, --jar <arg> The JAR to process
-o, --out <arg> The output JAR path
-r, --rules <arg> The JSON rules file containing jarjar rules
-v, --verbose Run in verbose mode
-h, --help Show help message
Jar Jar Abrams CLI takes in a rules.json
file in the following format:
{
"rename": [{"from": "<pattern>", "to": "<result>"}, ...],
"zap": ["<pattern>", ...],
"keep": ["<pattern>", ...]
}
These patterns are in the same format as described by jarjar-links
$ cat rules.json
{
"rename": [{"from": "com.google.protobuf.**", "to": "shaded.com.google.protobuf.@1"}]
}
$ jarjar-abrams-cli -r rules.json -j protobuf-java-3.5.1.jar -o test.jar
In order to build Jar Jar Abrams
yourself, assuming you have sbt
installed, you can run:
$ sbt assembly
This will output an executable to target/scala-2.12/jarjar-abrams-cli-<version>
. Note that this executable requires Java 8 to run.
Licensed under the Apache License, Version 2.0.
- Eugene Yokota for creating and maintaining jarjar-abrams
Credits as listed in jarjar-abrams' README:
- Jar Jar Links was created by herbyderby (Chris Nokleberg) in 2004.
- Pants build team has been maintaining a fork pantsbuild/jarjar since 2015.
- In 2015, Wu Xiang added shading support in sbt-assembly#162.
- In 2020, Jeroen ter Voorde added Scala signature processor in sbt-assembly#393.