2018-10-09 10:31:57 +05:30
|
|
|
#!/bin/sh
|
2018-09-25 20:16:32 +05:30
|
|
|
set -e # this makes the whole script fail immediately if any one of these commands fails
|
|
|
|
./gradlew build
|
2018-09-25 20:36:39 +05:30
|
|
|
export VERSION=$(cat build.gradle | grep "version '" | cut -d "'" -f 2-2)
|
2018-09-25 23:49:25 +05:30
|
|
|
|
2018-10-12 09:35:00 +05:30
|
|
|
unzip -p build/libs/baritone-$VERSION.jar "mixins.baritone.refmap.json" | jq --sort-keys -c -M '.' > mixins.baritone.refmap.json
|
2018-10-12 09:34:07 +05:30
|
|
|
zip -u build/libs/baritone-$VERSION.jar mixins.baritone.refmap.json
|
|
|
|
rm mixins.baritone.refmap.json
|
|
|
|
|
2018-10-12 07:21:33 +05:30
|
|
|
cd scripts
|
|
|
|
javac Determinizer.java
|
|
|
|
java Determinizer ../build/libs/baritone-$VERSION.jar temp.jar
|
|
|
|
mv temp.jar ../build/libs/baritone-$VERSION.jar
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
|
2018-09-26 00:57:24 +05:30
|
|
|
wget -nv https://downloads.sourceforge.net/project/proguard/proguard/6.0/proguard6.0.3.zip
|
2018-09-25 20:16:32 +05:30
|
|
|
unzip proguard6.0.3.zip 2>&1 > /dev/null
|
|
|
|
cd build/libs
|
2018-10-12 07:21:33 +05:30
|
|
|
rm -rf api.pro
|
2018-09-25 20:16:32 +05:30
|
|
|
echo "-injars 'baritone-$VERSION.jar'" >> api.pro # insert current version
|
2018-09-25 20:36:39 +05:30
|
|
|
cat ../../scripts/proguard.pro | grep -v "this is the rt jar" | grep -v "\-injars" >> api.pro # remove default rt jar and injar lines
|
2018-09-25 20:19:46 +05:30
|
|
|
echo "-libraryjars '$(java -verbose 2>/dev/null | sed -ne '1 s/\[Opened \(.*\)\]/\1/p')'" >> api.pro # insert correct rt.jar location
|
2018-09-25 20:16:32 +05:30
|
|
|
tail api.pro # debug, print out what the previous two commands generated
|
2018-10-11 23:40:59 +05:30
|
|
|
cat api.pro | grep -v "this is the keep api" > standalone.pro # standalone doesn't keep baritone api
|
2018-09-26 22:36:52 +05:30
|
|
|
|
|
|
|
#instead of downloading these jars from my dropbox in a zip, just assume gradle's already got them for us
|
2018-09-26 22:37:44 +05:30
|
|
|
mkdir -p tempLibraries
|
2018-09-26 22:48:08 +05:30
|
|
|
cat ../../scripts/proguard.pro | grep tempLibraries | grep .jar | cut -d "/" -f 2- | cut -d "'" -f -1 | xargs -n1 -I{} bash -c "find ~/.gradle -name {}" | tee /dev/stderr | xargs -n1 -I{} cp {} tempLibraries
|
2018-09-26 22:36:52 +05:30
|
|
|
|
2018-10-12 07:21:33 +05:30
|
|
|
rm -rf ../../dist
|
2018-09-25 20:16:32 +05:30
|
|
|
mkdir ../../dist
|
|
|
|
java -jar ../../proguard6.0.3/lib/proguard.jar @api.pro
|
2018-10-12 07:21:33 +05:30
|
|
|
cd ../../scripts
|
|
|
|
java Determinizer ../build/libs/Obfuscated/baritone-$VERSION.jar ../dist/baritone-api-$VERSION.jar
|
|
|
|
cd ../build/libs
|
|
|
|
rm -rf Obfuscated/*
|
2018-09-25 20:16:32 +05:30
|
|
|
java -jar ../../proguard6.0.3/lib/proguard.jar @standalone.pro
|
2018-10-12 07:21:33 +05:30
|
|
|
cd ../../scripts
|
|
|
|
java Determinizer ../build/libs/Obfuscated/baritone-$VERSION.jar ../dist/baritone-standalone-$VERSION.jar
|
|
|
|
cd ../build/libs
|
2018-09-25 20:16:32 +05:30
|
|
|
mv baritone-$VERSION.jar ../../dist/baritone-unoptimized-$VERSION.jar
|
2018-09-26 00:55:35 +05:30
|
|
|
cd ../../dist
|
|
|
|
shasum * | tee checksums.txt
|
|
|
|
cd ..
|