Polish license check script (#4736)

* Polish license check script
* Remove temp files
This commit is contained in:
Huxing Zhang 2019-08-04 20:21:50 +08:00 committed by Huang YunKun
parent 2c92916d63
commit 87703adb16
1 changed files with 5 additions and 3 deletions

View File

@ -18,9 +18,9 @@ else
echo "checking whole project"
fi
echo "Running command: ./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG"
echo "Running command: mvn clean package -DskipTests=true -PlicenseCheck $APPEND_ARG"
./mvnw clean package -DskipTests=true -PlicenseCheck $APPEND_ARG
mvn clean package -DskipTests=true -PlicenseCheck $APPEND_ARG
status=$?
if [ $status -eq 0 ]; then
@ -91,7 +91,7 @@ allowLicense=(
)
#filter allow license
license_need_check=`cat $TARGET_FILE | grep -v "generated-sources/license/THIRD-PARTY.txt" | grep -v "third-party dependencies" | grep -v $LINE_FLAG`
license_need_check=`cat $TARGET_FILE | grep -v "generated-sources/license/THIRD-PARTY.txt" | grep -v "third-party dependencies" | grep -v "The project has no dependencies." | grep -v $LINE_FLAG`
for i in "${allowLicense[@]}"; do
license_need_check=`echo "$license_need_check"|grep -vi "$i"`
@ -106,3 +106,5 @@ else
echo "${red}Please check below license${reset}"
cat license-need-check
fi
rm -f license-list license-need-check