forked from aas-integration/integration-test2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetch_dependencies.sh
executable file
·113 lines (92 loc) · 3.14 KB
/
fetch_dependencies.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/usr/bin/env bash
# Fail the whole script if any command fails
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd ${DIR} &> /dev/null
# Libraries
mkdir -p libs
pushd libs &> /dev/null
JARS=(
"https://github.com/aas-integration/prog2dfg/releases/download/v0.1/prog2dfg.jar"
"https://github.com/junit-team/junit/releases/download/r4.12/junit-4.12.jar"
"http://search.maven.org/remotecontent?filepath=org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
"https://github.com/aas-integration/clusterer/releases/download/v0.6/clusterer.jar"
"https://github.com/SRI-CSL/bixie/releases/download/0.3/bixie.jar"
)
for jar in "${JARS[@]}"
do
base=$(basename ${jar})
echo Fetching ${base}
if curl -fLo ${base} ${jar} &> /dev/null; then
:
else
echo Fetching ${base} failed.
exit 1;
fi
done
# Fetch the current version of randoop jars
RANDOOPBASEURL="https://github.com/randoop/randoop/releases/download"
RANDOOPVERSION=`curl --silent "https://api.github.com/repos/randoop/randoop/releases/latest"|grep '"tag_name"'|sed -E 's/.*"v([^"]+)".*/\1/'`
jar=$RANDOOPBASEURL/v$RANDOOPVERSION/randoop-all-$RANDOOPVERSION.jar
base=$(basename ${jar})
echo Fetching ${base}
if curl -fLo ${base} ${jar} &> /dev/null; then
# Rename randoop's release-specific-name to just randoop.jar
mv ${base} "randoop.jar"
else
echo Fetching ${base} failed.
exit 1;
fi
jar=$RANDOOPBASEURL/v$RANDOOPVERSION/replacecall-$RANDOOPVERSION.jar
base=$(basename ${jar})
echo Fetching ${base}
if curl -fLo ${base} ${jar} &> /dev/null; then
# Rename replacecall's release-specific-name to just replacecall.jar
mv ${base} "replacecall.jar"
else
echo Fetching ${base} failed.
exit 1;
fi
# extract the default replacements file
jar -xf replacecall.jar default-replacements.txt
popd &> /dev/null # Exit libs
# Tools
mkdir -p tools
pushd tools &> /dev/null
# Fetch do-like-javac if not using external
if [[ -z "${DLJCDIR}" ]]; then
if [ -d do-like-javac ]; then
rm -rf do-like-javac
fi
git clone https://github.com/SRI-CSL/do-like-javac.git
fi
# Fetch Daikon if not using external
if [[ -z "${DAIKONDIR}" ]]; then
DAIKONBASEURL="http://plse.cs.washington.edu/daikon"
DAIKONVERSION=`curl --fail -s $DAIKONBASEURL/download/doc/VERSION | xargs echo -n`
DAIKON_SRC=$DAIKONBASEURL/download/daikon-$DAIKONVERSION.tar.gz
DAIKON_SRC_FILE=$(basename ${DAIKON_SRC})
if [ ! -e $DAIKON_SRC_FILE ]; then
rm -rf daikon-src
if curl -fLo $DAIKON_SRC_FILE $DAIKON_SRC; then
bash ../build_daikon.sh `pwd`/$DAIKON_SRC_FILE
cp daikon-src/daikon.jar ../libs/daikon.jar
else
echo "Fetching $DAIKON_SRC failed."
exit 1;
fi
else
echo "Daikon already up to date."
fi
fi
if [ -d "ontology" ]; then
rm -rf ontology
fi
git clone https://github.com/pascaliUWat/ontology.git
pushd ontology &> /dev/null
export TRAVIS_BUILD_DIR=`pwd`
./pascali-setup.sh
ln -s dist/ontology.jar ../../libs/ontology.jar
popd &> /dev/null # Exit ontology
popd &> /dev/null # Exit tools
popd &> /dev/null # Exit integration-test