22 lines
587 B
Bash
Executable file
22 lines
587 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
read-and-count-issues() {
|
|
issues="$(grep -e "^\\[WARNING\\] .*.java:\\[\\d\+,\\d\+\\]" | \
|
|
sed -E 's/^\[WARNING\] .*.java:\[[0-9,]+\] \[//g;s/\].*$//' | \
|
|
sort)"
|
|
echo "$issues" | uniq -c
|
|
printf "%4d [TOTAL]\n" "$(echo "$issues" | wc -l)"
|
|
}
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
|
echo "Before refactoring:"
|
|
cat "$SCRIPT_DIR/before-refactor.txt" | read-and-count-issues
|
|
echo ""
|
|
|
|
cd "$SCRIPT_DIR/sources"
|
|
mvn clean 2>&1 >/dev/null
|
|
echo "After refactoring:"
|
|
mvn compile 2>&1 | read-and-count-issues
|