4c5d83
#!/bin/sh
4c5d83
set -e -x
4c5d83
test $# -eq 1
4c5d83
test ! -d guice
4c5d83
git clone git://github.com/google/guice.git
4c5d83
cd ./guice
4c5d83
git checkout ${1}
4c5d83
git branch unbundled-${1}
4c5d83
git checkout unbundled-${1}
4c5d83
rm -rf $(ls . | grep -E -v 'core|extensions|pom|bom|jdk8-tests|COPYING|common.xml')
4c5d83
find . -name "*.jar" -delete
4c5d83
find . -name "*.class" -delete
4c5d83
git commit -a -m "Remove unneeded stuff"
4c5d83
git tag unbundled-${1}
4c5d83
git archive --format=tar --prefix=google-guice-${1}/ unbundled-${1} \
4c5d83
    | xz >../google-guice-${1}.tar.xz