-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·17 lines (16 loc) · 1.05 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# check for closure
closurepath=$(which closure)
if ! [[ closurepath ]]; then
closurepath=$(which closure-compiler)
fi
if ! [[ closurepath && $($closurepath --version | grep "Closure Compiler") ]]; then
if ! [[ $(find ./closure*.jar) ]]; then
echo "closure doesn't seem to be installed! downloading latest in current dir for building. if you'd prefer, you can install and then delete the jar file in this directory"
base="https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/"$(curl -s https://repo1.maven.org/maven2/com/google/javascript/closure-compiler/ | grep "v[0-9]*/" | tail -1 | sed "s/>v.*/><\/a>/" | xmllint --html --format --xpath "string(.//a//@href)" 2>/dev/null -)
wget -nv -show-progress $base$(curl -s $base | xmllint --html --format --xpath "string(//a[substring(@href, string-length(@href)-3) = '.jar' and not(contains(@href, 'javadoc')) and not(contains(@href, 'sources'))]//@href)" 2>/dev/null -)
fi
closurepath=$(find ./closure*.jar | head -1)
fi
# go!!!!
python3 concat.py
$closurepath ./build/all.js > ./build/all.min.js