From 3bde5e2ebbe304f14d0b37facea650b03fd31ac9 Mon Sep 17 00:00:00 2001 From: Sheng Zha Date: Mon, 3 Jun 2019 11:55:42 -0700 Subject: [PATCH] rat check make target (#15127) --- Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 4a83d8c32d58..6fc3c3aca5f6 100644 --- a/Makefile +++ b/Makefile @@ -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 *~ */*~ */*/*~ */*/*/*~