-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_all.sh
executable file
·63 lines (53 loc) · 1.69 KB
/
run_all.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
#!/bin/bash
# Execute all the experiments declared in run_all_config and collect results
# args
# output folder
log_dir=$1
# config
# edit this part with your own setting
# MBT module directory
mbt_module_dir=/Users/myUser/tools/mbt-module
# do not edit the following lines
res_dir=$mbt_module_dir/src/main/resources
handler_dir=$mbt_module_dir/src/main/java/it/unimi/di/se/monitor/
# -----------------------------------------------------------------------------
# execution
while read args; do
source_dir=$(echo $args | cut -d' ' -f1)
rectangles=$(echo $args | cut -d' ' -f2)
target_dir=$(echo $args | cut -d' ' -f3)
target_name=$source_dir-"${rectangles##*/}"
mdp=$source_dir/*.mdp
jmdp=$source_dir/*.jmdp
handler=$source_dir/*.aj
tmp=$(ls -d $mdp)
mdp_name="${tmp##*/}"
tmp=$(ls -d $jmdp)
jmdp_name="${tmp##*/}"
handler_name="${handler##*/}"
echo copying...
echo $mdp $jmdp into $res_dir
cp $mdp $res_dir
cp $jmdp $res_dir
echo $rectangles into $res_dir/rectangles
cp $rectangles $res_dir/rectangles
echo $handler into $handler_dir
cp $handler $handler_dir
pushd $mbt_module_dir > /dev/null
echo building...
./gradlew --no-daemon clean build 1>&2
echo executing...
./gradlew --no-daemon run -PappArgs='['"'-i', 'src/main/resources/"$jmdp_name"'"']' 1>&2
echo cleanup...
rm src/main/resources/$mdp_name
echo src/main/resources/$mdp_name
rm src/main/resources/$jmdp_name
echo src/main/resources/$jmdp_name
rm src/main/resources/rectangles
echo src/main/resources/rectangles
popd > /dev/null
echo copying results...
cp $mbt_module_dir/mylogs.log $log_dir/$target_name
echo $log_dir/$target_name
rm $mbt_module_dir/mylogs.log
done <run_all_config