Repository: incubator-singa
Updated Branches:
  refs/heads/master 2f665370b -> aad22fcd5


SINGA-77 Integrate with Apache RAT

Updated rat-excludes to check all source files in the `examples` directories. 
Also remove tinydir.h and cpplint.py
from the exclusion list (they're being checked regardless of whether they're in 
the exclusion list or not)

(Thanks Zhongle for the help with the Makefile.am)

Apache RAT enables automatic checking of license headers in source files. SINGA 
supports RAT by adding
a target into the Makefile, and providing a `rat-excludes` file at the 
top-level directory.
Specifically, the `make rat` target does the following:
+ Check for java and Apache RAT .jar file in the $RAT_PATH variable.
+ Invoke `make clean`
+ Invoke RAT and write the output to `rat_check` file.

Notice the side-effect of `make rat` that removes all built files. Thus, it is 
recommended to use before
building the source.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/207e05fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/207e05fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/207e05fc

Branch: refs/heads/master
Commit: 207e05fcd3987d503edec97de858d66a0f6d6846
Parents: 2f66537
Author: Anh Dinh <[email protected]>
Authored: Thu Jun 25 08:30:46 2015 -0700
Committer: Anh Dinh <[email protected]>
Committed: Thu Oct 1 07:06:20 2015 +0000

----------------------------------------------------------------------
 Makefile.am  | 15 ++++++++++++++-
 rat-excludes | 13 +++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/207e05fc/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 00aacdd..0e0f948 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -163,7 +163,20 @@ endif
 clean-local:
        rm -rf $(PROTO_SRCS) $(PROTO_HDRS)
        rm -rf $(PROTO_PYS)
-
+       rm -rf rat_check
+       rm -rf tool/pb2
+
+rat:
+       @if test ! -z '$(shell command -v java 2>/dev/null)'; then \
+               if test ! -z '$(shell echo $$RAT_PATH)'; then \
+                       make clean;\
+                       java -jar $(RAT_PATH) -E rat-excludes -d . > rat_check; 
\
+               else \
+                       echo "RAT_PATH is not set to correct jar file"; \
+               fi \
+       else \
+               echo "java is not found"; \
+       fi
 
 $(PROTO_HDRS) $(PROTO_SRCS): $(PROTOS)
        protoc --proto_path=$(top_srcdir)/src/proto 
--cpp_out=$(top_srcdir)/src/proto $(PROTOS)

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/207e05fc/rat-excludes
----------------------------------------------------------------------
diff --git a/rat-excludes b/rat-excludes
new file mode 100644
index 0000000..bfe9217
--- /dev/null
+++ b/rat-excludes
@@ -0,0 +1,13 @@
+rat-excludes
+Makefile.*
+configure
+.gitignore
+conf/*
+config/*
+\.dirstamp
+autom4te.cache/*
+config.*
+libtool
+stamp-h1
+.*\.conf
+.*\.md

Reply via email to