checkstyle rule to check copyrights
Change-Id: Ia9bab40b5fe64fca539058a4316371f7acc0f387
diff --git a/tools/build/conf/BUCK b/tools/build/conf/BUCK
index 7644c70..cb80dd2 100644
--- a/tools/build/conf/BUCK
+++ b/tools/build/conf/BUCK
@@ -1,5 +1,6 @@
checkstyle_source = 'src/main/resources/onos/checkstyle.xml'
suppression_source = 'src/main/resources/onos/suppressions.xml'
+header_source = 'src/main/resources/onos/onos-java.header'
export_file (
name = 'checkstyle-xml',
@@ -14,6 +15,12 @@
)
export_file (
+ name = 'onos-java-header',
+ src = header_source,
+ visibility = [ 'PUBLIC' ],
+)
+
+export_file (
name = 'start-buck-daemon',
visibility = [ 'PUBLIC' ],
)
@@ -65,4 +72,4 @@
# ],
# labels = [ 'checkstyle' ],
# visibility = [ 'PUBLIC' ],
-# )
\ No newline at end of file
+# )
diff --git a/tools/build/conf/src/main/resources/onos/checkstyle.xml b/tools/build/conf/src/main/resources/onos/checkstyle.xml
index 5d81aa5..6387d2b 100644
--- a/tools/build/conf/src/main/resources/onos/checkstyle.xml
+++ b/tools/build/conf/src/main/resources/onos/checkstyle.xml
@@ -50,7 +50,7 @@
<!--
The default severity setting in checkstyle is 'error', so some
of the rules below are configured to change the severity to
- 'warning'. Over time, these 'warning' settings should be
+ 'warning'. Over time, these 'warning' settings should be
removed as more of the ONOS source code is modified to
follow the recommended rules.
-->
@@ -106,6 +106,11 @@
<!-- <property name="fileExtensions" value="java"/> -->
<!-- </module> -->
+ <module name="RegexpHeader">
+ <property name="headerFile" value="tools/build/conf/src/main/resources/onos/onos-java.header"/>
+ </module>
+
+
<module name="SuppressionCommentFilter">
<property name="offCommentFormat"
value="(CHECKSTYLE\:OFF|Generated by the protocol buffer compiler.)"/>
diff --git a/tools/build/conf/src/main/resources/onos/onos-java.header b/tools/build/conf/src/main/resources/onos/onos-java.header
new file mode 100644
index 0000000..7feabd2
--- /dev/null
+++ b/tools/build/conf/src/main/resources/onos/onos-java.header
@@ -0,0 +1,4 @@
+/*
+ * Copyright 201[0-9].* Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 \(the "License"\);
diff --git a/tools/build/conf/src/main/resources/onos/suppressions.xml b/tools/build/conf/src/main/resources/onos/suppressions.xml
index 3c51c95..fedccd4 100644
--- a/tools/build/conf/src/main/resources/onos/suppressions.xml
+++ b/tools/build/conf/src/main/resources/onos/suppressions.xml
@@ -32,6 +32,12 @@
<suppress files="org.onosproject.driver.pipeline.*" checks="AbbreviationAsWordInName" />
<suppress files="org.onosproject.segmentrouting.*" checks="AbbreviationAsWordInName" />
+ <!-- These files carry AT&T copyrights -->
+ <suppress files="org.onlab.packet.EAP" checks="RegexpHeader" />
+ <suppress files="org.onlab.packet.EAPOL" checks="RegexpHeader" />
+ <suppress files="org.onlab.packet.RADIUS" checks="RegexpHeader" />
+ <suppress files="org.onlab.packet.RADIUSAttribute" checks="RegexpHeader" />
+
<!-- Suppressions for unit testing code -->
<suppress checks="Javadoc.*"
files=".*/src/test/.*.java"