Last active
August 29, 2015 14:16
-
-
Save agronholm/48d5eda810588dfed2db to your computer and use it in GitHub Desktop.
Jython standalone -> Java Web Start jar converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Converts a Jython standalone jar into something usable with Java Web Start | |
if [ -z $1 ]; then | |
echo "Please give the path to the standalone jar as the first argument." | |
exit 1 | |
fi | |
CURRDIR=$(pwd) | |
JAR_PATH="$1" | |
CONVERTED_JAR_PATH="$CURRDIR/jython-webstart.jar" | |
TEMPDIR=$(mktemp -d) | |
cd "$TEMPDIR" | |
jar xf "$JAR_PATH" | |
rm -rf Lib/test # including Jython's own unit tests is pointless | |
java -jar "$JAR_PATH" -m compileall Lib | |
find Lib -name "*.py" -delete | |
mv Lib/* . | |
rmdir Lib | |
jar cfm "$CONVERTED_JAR_PATH" META-INF/MANIFEST.MF * | |
rm -rf "$TEMPDIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment