forked from wcygan/java-callgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunone.sh
executable file
·45 lines (32 loc) · 1.12 KB
/
runone.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
#!/bin/bash
# exit if anything throws a bad exit code
set -e
# SET JCG_HOME based on the directory where this script resides
JCG_HOME="$(pwd)/$( dirname -- "$0"; )";
cd $JCG_HOME || exit
mkdir -p serializedGraphs
# check $1 to be sure it is at least 1 character and only contains alpha, number, _, and -.
if [[ $# -ne 1 || ! $1 =~ ^[A-Za-z0-9_\-]+$ ]]; then
echo "Provide a project name (alphanumeric with _ and - allowed).";
else
projectName=$1
# clean project
rm -rf "$projectName"
# clean output
rm -rf output
mkdir output
# add results (if not exists)
mkdir -p "artifacts/results/$projectName"
# git project
java -jar ./target/javacg-0.1-SNAPSHOT-jar-with-dependencies.jar git -c $projectName
# build project
java -jar ./target/javacg-0.1-SNAPSHOT-jar-with-dependencies.jar build -c $projectName -o serializedGraphs/$projectName
# test project
java -jar ./target/javacg-0.1-SNAPSHOT-jar-with-dependencies.jar test -c $projectName -f serializedGraphs/$projectName
# copy output
rm -rf output-$projectName
mv output output-$projectName
cd output-$projectName || exit
../buildsvg.sh
cd ..
fi