forked from bears-bugs/bears-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compress_deps
executable file
·28 lines (21 loc) · 1.13 KB
/
compress_deps
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
#!/bin/bash
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
benchmark_name=$(echo $script_dir | rev | cut -d "/" -f 3 | rev)
project_name=$(echo $script_dir | rev | cut -d "/" -f 2 | rev)
bug_id=$(echo $script_dir | rev | cut -d "/" -f 1 | rev)
dir_name=/experiment/$benchmark_name/$project_name/$bug_id
TARGET_PATH=$dir_name/src/
DEPENDENCY_PATH=$TARGET_PATH/dependency
EXTRACTED_DEPENDENCIES_PATH=$TARGET_PATH/extracted_dependencies
cd $TARGET_PATH/;
mvn dependency:copy-dependencies
rm -rf "$EXTRACTED_DEPENDENCIES_PATH" \
&& mkdir "$EXTRACTED_DEPENDENCIES_PATH" \
&& cd "$EXTRACTED_DEPENDENCIES_PATH" \
&& echo "Extract all dependencies from the 'jar' files from $DEPENDENCY_PATH ..." \
&& find "$DEPENDENCY_PATH" -type f -name "*.jar" -exec jar -xf {} \;
echo "Delete *.RSA *.DSA *.SF signature files..." \
&& find . -type f \( -name "*.RSA" -o -name "*.DSA" -o -name "*.SF" \) -delete
echo "Merge all dependencies into a single 'jar' file..." \
&& jar -cf "$TARGET_PATH"/all-dependencies.jar . \
&& echo "JAR File with all dependencies successfully created: $TARGET_PATH/all-dependencies.jar"