Skip to content
Snippets Groups Projects
Commit 706b6ed1 authored by Denis Zhidkikh's avatar Denis Zhidkikh :horse:
Browse files

Add JarJar and ComTest repackage script

parent 75cbdf89
No related branches found
No related tags found
No related merge requests found
File added
#!/bin/bash
# This scripts repacks ComTest.jar by renaming comtest package to comtest.vN where N is passed as arg
# Usage: repack_comtest.sh <path to ComTest.jar> <N>
# The script will create ComTest_vN.jar in the same directory as ComTest.jar
# This script uses jarjar tool from http://code.google.com/p/jarjar/
# Read args
if [ $# -ne 2 ]; then
echo "Usage: repack_comtest1.sh <path to ComTest.jar> <N>"
exit 1
fi
JAR=$1
JAR_PATH=$(dirname $JAR)
N=$2
jarjar="java -jar jarjar.jar"
rules="
rule comtest.** comtest.v$N.@1
"
# Create temporary rules file
rules_file=$(mktemp)
echo "$rules" > "$rules_file"
# Repack ComTest.jar
$jarjar process "$rules_file" "$JAR" "$JAR_PATH/ComTest_v$N.jar"
# Remove temporary rules file
rm "$rules_file"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment