forked from bcgit/bc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathensurejar.sh
executable file
·47 lines (31 loc) · 1.22 KB
/
ensurejar.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ "$1" = "force" ]; then
rm -Rf $DIR/jars
fi
if [ ! -d "$DIR/jars" ]; then
mkdir $DIR/jars
pushd $DIR/../../../
BCDIR=`pwd`
popd
pushd $DIR/jars
curl -o ver.index https://downloads.bouncycastle.org/betas/index.html
bcver=`fgrep bcprov-ext ver.index | fgrep .jar | sed -e "s:^.*bcprov-ext-jdk15on-::" | sed -e "s:.jar<.*$::"`
if type curl > /dev/null; then
curl -o bcprov.jar https://downloads.bouncycastle.org/betas/bcprov-jdk15on-$bcver.jar
curl -o bctls.jar https://downloads.bouncycastle.org/betas/bctls-jdk15on-$bcver.jar
curl -o suffixlist.dat https://www.publicsuffix.org/list/public_suffix_list.dat
elif type wget > /dev/null ; then
wget -O bcprov.jar https://downloads.bouncycastle.org/betas/bcprov-jdk15on-$bcver.jar
wget -O bctls.jar https://downloads.bouncycastle.org/betas/bctls-jdk15on-$bcver.jar
wget -O suffixlist.dat https://www.publicsuffix.org/list/public_suffix_list.dat
else
echo "No wget or curl to download provider jar"
fi
popd
cd $BCDIR
gradle -x test clean jar
cp $BCDIR/test/build/libs/test-*.jar $DIR/jars/test.jar
cp $BCDIR/pkix/build/libs/bcpkix-*.jar $DIR/jars/pkix.jar
fi