forked from tronprotocol/java-tron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkStyle.sh
26 lines (24 loc) · 1.04 KB
/
checkStyle.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
./gradlew clean build -x test > build.log 2>&1
if [ $? != 0 ];then
echo "run ./gradlew build fail, Please check you code, Or just retry this test"
exit 1
fi
echo "------------------------------ checkStyle check ------------------------------"
#echo $BUILDKITE_PULL_REQUEST_BASE_BRANCH
#if [[ x"$BUILDKITE_PULL_REQUEST_BASE_BRANCH" != x'develop' && x"$BUILDKITE_PULL_REQUEST_BASE_BRANCH" != x'master' ]];then
# echo "BUILDKITE_PULL_REQUEST_BASE_BRANCH isnot develop or master, SKIPED"
# exit 0
#fi
grep -v ":checkstyleMain\|:checkstyleTest\|:lint" build.log |grep "ant:checkstyle" > checkStyle.log 2>&1
checkNum=`cat checkStyle.log | wc -l`
if [ ${checkNum} -gt 0 ];then
echo "please fix checkStyle problem,"
echo "run [ ./gradlew clean build -x test ], and you can find checkStyle report in framework/build/reports/checkstyle/"
echo "!!!!! checkStyle Num ${checkNum} !!!!!"
cat checkStyle.log
echo "checkStyle Failed, please fix checkStyle problem"
touch checkFailTag
else
echo "checkStyle problem zero"
fi
exit 0