Skip to content

Commit

Permalink
Polish license check script (apache#4736)
Browse files Browse the repository at this point in the history
* Polish license check script
* Remove temp files
  • Loading branch information
ralf0131 authored and htynkn committed Aug 4, 2019
1 parent 2c92916 commit 87703ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions licenseCheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand All @@ -106,3 +106,5 @@ else
echo "${red}Please check below license${reset}"
cat license-need-check
fi

rm -f license-list license-need-check

0 comments on commit 87703ad

Please sign in to comment.