Skip to content

Commit

Permalink
rat check make target (apache#15127)
Browse files Browse the repository at this point in the history
  • Loading branch information
szha authored and haohuw committed Jun 23, 2019
1 parent 470a856 commit 3bde5e2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,26 @@ rclean:
$(RM) -r R-package/src/image_recordio.h R-package/NAMESPACE R-package/man R-package/R/mxnet_generated.R \
R-package/inst R-package/src/*.o R-package/src/*.so mxnet_*.tar.gz

build/rat/apache-rat/target/apache-rat-0.13-SNAPSHOT.jar:
mkdir -p build
svn co http://svn.apache.org/repos/asf/creadur/rat/branches/0.12-release/ build/rat; \
cd build/rat; \
mvn -Dmaven.test.skip=true install;

ratcheck: build/rat/apache-rat/target/apache-rat-0.13-SNAPSHOT.jar
exec 5>&1; \
RAT_JAR=build/rat/apache-rat/target/apache-rat-0.13-SNAPSHOT.jar; \
OUTPUT=$(java -jar $(RAT_JAR) -E tests/nightly/apache_rat_license_check/rat-excludes -d .|tee >(cat - >&5)); \
ERROR_MESSAGE="Printing headers for text files without a valid license header"; \
echo "-------Process The Output-------"; \
if [[ $OUTPUT =~ $ERROR_MESSAGE ]]; then \
echo "ERROR: RAT Check detected files with unknown licenses. Please fix and run test again!"; \
exit 1; \
else \
echo "SUCCESS: There are no files with an Unknown License."; \
fi


ifneq ($(EXTRA_OPERATORS),)
clean: rclean cyclean $(EXTRA_PACKAGES_CLEAN)
$(RM) -r build lib bin deps *~ */*~ */*/*~ */*/*/*~
Expand Down

0 comments on commit 3bde5e2

Please sign in to comment.