directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/3] directory-kerby git commit: Adding a new build-tools module for PMD + Checkstyle configuration
Date Wed, 16 Dec 2015 15:45:37 GMT
Adding a new build-tools module for PMD + Checkstyle configuration


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/16ffe559
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/16ffe559
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/16ffe559

Branch: refs/heads/master
Commit: 16ffe55909d967ffb3cc4612d738d7e378dd1b51
Parents: 5c6f6fa
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Dec 16 14:39:54 2015 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Dec 16 14:39:54 2015 +0000

----------------------------------------------------------------------
 build-tools/pom.xml                             |  24 +++
 .../src/main/resources/kerby-checkstyle.xml     | 150 +++++++++++++++++++
 .../src/main/resources/kerby-pmd-ruleset.xml    |  40 +++++
 docs/kerby-checkstyle.xml                       | 150 -------------------
 docs/kerby-pmd-ruleset.xml                      |  40 -----
 pom.xml                                         |  43 +++---
 6 files changed, 231 insertions(+), 216 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/build-tools/pom.xml
----------------------------------------------------------------------
diff --git a/build-tools/pom.xml b/build-tools/pom.xml
new file mode 100644
index 0000000..fa5c6b1
--- /dev/null
+++ b/build-tools/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License. See accompanying LICENSE file.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.kerby</groupId>
+  <artifactId>build-tools</artifactId>
+  <version>1.0.0-RC2-SNAPSHOT</version>
+  <name>Kerby Build Tools</name>
+  <packaging>jar</packaging>
+
+</project>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/build-tools/src/main/resources/kerby-checkstyle.xml
----------------------------------------------------------------------
diff --git a/build-tools/src/main/resources/kerby-checkstyle.xml b/build-tools/src/main/resources/kerby-checkstyle.xml
new file mode 100644
index 0000000..ff9f5de
--- /dev/null
+++ b/build-tools/src/main/resources/kerby-checkstyle.xml
@@ -0,0 +1,150 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+  
+  http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+
+<module name="Checker">
+
+    <!-- Checks that property files contain the same keys.         -->
+    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
+    <module name="Translation"/>
+
+    <module name="FileLength"/>
+
+    <!-- Following interprets the header file as regular expressions. -->
+    <!-- <module name="RegexpHeader"/>                                -->
+
+    <module name="FileTabCharacter">
+        <property name="eachLine" value="true"/>
+    </module>
+
+    <module name="RegexpSingleline">
+        <!-- \s matches whitespace character, $ matches end of line. -->
+        <property name="format" value="^[^\s][^\*].*\s+$"/>
+        <property name="message" value="Line has trailing spaces."/>
+    </module>
+
+    <module name="TreeWalker">
+
+        <!-- required for SuppressWarningsFilter (and other Suppress* rules not used here)
-->
+        <!-- see http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder
-->
+        <module name="SuppressWarningsHolder"/>
+
+
+        <!-- Checks for Naming Conventions.                  -->
+        <!-- See http://checkstyle.sf.net/config_naming.html -->
+        <module name="ConstantName"/>
+        <module name="LocalFinalVariableName"/>
+        <module name="LocalVariableName"/>
+        <module name="MemberName"/>
+        <module name="MethodName"/>
+        <module name="PackageName"/>
+        <module name="ParameterName"/>
+        <module name="StaticVariableName"/>
+        <module name="TypeName"/>
+
+
+        <!-- Checks for imports                              -->
+        <!-- See http://checkstyle.sf.net/config_import.html -->
+        <!-- module name="AvoidStarImport"/ -->
+        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
+        <module name="RedundantImport"/>
+        <module name="UnusedImports"/>
+
+
+        <!-- Checks for Size Violations.                    -->
+        <!-- See http://checkstyle.sf.net/config_sizes.html -->
+        <module name="LineLength">
+            <property name="max" value="120"/>
+            <property name="ignorePattern" value="^ *\* *"/>
+        </module>
+        <module name="MethodLength">
+            <property name="max" value="200"/>
+        </module>
+        <module name="ParameterNumber">
+            <property name="max" value="8"/>
+        </module>
+
+
+        <!-- Checks for whitespace                               -->
+        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
+        <module name="EmptyForIteratorPad"/>
+        <module name="MethodParamPad"/>
+        <module name="NoWhitespaceAfter"/>
+        <module name="NoWhitespaceBefore"/>
+        <module name="OperatorWrap"/>
+        <module name="ParenPad"/>
+        <module name="TypecastParenPad"/>
+        <module name="WhitespaceAfter"/>
+        <module name="WhitespaceAround"/>
+
+
+        <!-- Modifier Checks                                    -->
+        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
+        <module name="ModifierOrder"/>
+        <module name="RedundantModifier"/>
+
+
+        <!-- Checks for blocks. You know, those {}'s         -->
+        <!-- See http://checkstyle.sf.net/config_blocks.html -->
+        <module name="AvoidNestedBlocks"/>
+        <module name="EmptyBlock"/>
+        <module name="LeftCurly"/>
+        <module name="NeedBraces"/>
+        <module name="RightCurly"/>
+
+
+        <!-- Checks for common coding problems               -->
+        <!-- See http://checkstyle.sf.net/config_coding.html -->
+        <!-- module name="AvoidInlineConditionals"/ -->
+        <module name="EmptyStatement"/>
+        <module name="EqualsHashCode"/>
+        <module name="IllegalInstantiation"/>
+
+
+        <!-- Checks for class design                         -->
+        <!-- See http://checkstyle.sf.net/config_design.html -->
+        <module name="FinalClass"/>
+        <module name="InterfaceIsType"/>
+
+
+        <!-- Miscellaneous other checks.                   -->
+        <!-- See http://checkstyle.sf.net/config_misc.html -->
+        <module name="ArrayTypeStyle"/>
+        <module name="UpperEll"/>
+
+        <module name="FileContentsHolder"/>
+
+    </module>
+
+    <!-- Support @SuppressWarnings (added in Checkstyle 5.7) -->
+    <!-- see http://checkstyle.sourceforge.net/config.html#SuppressWarningsFilter -->
+    <module name="SuppressWarningsFilter"/>
+
+    <!-- Checks properties file for a duplicated properties. -->
+    <!-- See http://checkstyle.sourceforge.net/config_misc.html#UniqueProperties -->
+    <module name="UniqueProperties"/>
+
+    <module name="SuppressionCommentFilter"/>
+
+</module>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/build-tools/src/main/resources/kerby-pmd-ruleset.xml
----------------------------------------------------------------------
diff --git a/build-tools/src/main/resources/kerby-pmd-ruleset.xml b/build-tools/src/main/resources/kerby-pmd-ruleset.xml
new file mode 100644
index 0000000..fc61e41
--- /dev/null
+++ b/build-tools/src/main/resources/kerby-pmd-ruleset.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<ruleset name="kerby-pmd" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
+  <description>
+  A PMD ruleset for Apache Kerby
+  </description>
+
+  <rule ref="rulesets/java/basic.xml">
+     <exclude name="AvoidUsingHardCodedIP" />
+  </rule>
+  <rule ref="rulesets/java/unusedcode.xml"/>
+  <rule ref="rulesets/java/imports.xml"/>
+  <rule ref="rulesets/java/braces.xml"/>
+  <rule ref="rulesets/java/empty.xml"/>
+  <rule ref="rulesets/java/migrating.xml">
+     <exclude name="JUnit4TestShouldUseAfterAnnotation" />
+     <exclude name="JUnit4TestShouldUseTestAnnotation" />
+  </rule>
+  <rule ref="rulesets/java/unnecessary.xml"/>
+
+</ruleset>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/docs/kerby-checkstyle.xml
----------------------------------------------------------------------
diff --git a/docs/kerby-checkstyle.xml b/docs/kerby-checkstyle.xml
deleted file mode 100644
index ff9f5de..0000000
--- a/docs/kerby-checkstyle.xml
+++ /dev/null
@@ -1,150 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-  http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<!DOCTYPE module PUBLIC
-    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
-    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
-
-<module name="Checker">
-
-    <!-- Checks that property files contain the same keys.         -->
-    <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
-    <module name="Translation"/>
-
-    <module name="FileLength"/>
-
-    <!-- Following interprets the header file as regular expressions. -->
-    <!-- <module name="RegexpHeader"/>                                -->
-
-    <module name="FileTabCharacter">
-        <property name="eachLine" value="true"/>
-    </module>
-
-    <module name="RegexpSingleline">
-        <!-- \s matches whitespace character, $ matches end of line. -->
-        <property name="format" value="^[^\s][^\*].*\s+$"/>
-        <property name="message" value="Line has trailing spaces."/>
-    </module>
-
-    <module name="TreeWalker">
-
-        <!-- required for SuppressWarningsFilter (and other Suppress* rules not used here)
-->
-        <!-- see http://checkstyle.sourceforge.net/config_annotation.html#SuppressWarningsHolder
-->
-        <module name="SuppressWarningsHolder"/>
-
-
-        <!-- Checks for Naming Conventions.                  -->
-        <!-- See http://checkstyle.sf.net/config_naming.html -->
-        <module name="ConstantName"/>
-        <module name="LocalFinalVariableName"/>
-        <module name="LocalVariableName"/>
-        <module name="MemberName"/>
-        <module name="MethodName"/>
-        <module name="PackageName"/>
-        <module name="ParameterName"/>
-        <module name="StaticVariableName"/>
-        <module name="TypeName"/>
-
-
-        <!-- Checks for imports                              -->
-        <!-- See http://checkstyle.sf.net/config_import.html -->
-        <!-- module name="AvoidStarImport"/ -->
-        <module name="IllegalImport"/> <!-- defaults to sun.* packages -->
-        <module name="RedundantImport"/>
-        <module name="UnusedImports"/>
-
-
-        <!-- Checks for Size Violations.                    -->
-        <!-- See http://checkstyle.sf.net/config_sizes.html -->
-        <module name="LineLength">
-            <property name="max" value="120"/>
-            <property name="ignorePattern" value="^ *\* *"/>
-        </module>
-        <module name="MethodLength">
-            <property name="max" value="200"/>
-        </module>
-        <module name="ParameterNumber">
-            <property name="max" value="8"/>
-        </module>
-
-
-        <!-- Checks for whitespace                               -->
-        <!-- See http://checkstyle.sf.net/config_whitespace.html -->
-        <module name="EmptyForIteratorPad"/>
-        <module name="MethodParamPad"/>
-        <module name="NoWhitespaceAfter"/>
-        <module name="NoWhitespaceBefore"/>
-        <module name="OperatorWrap"/>
-        <module name="ParenPad"/>
-        <module name="TypecastParenPad"/>
-        <module name="WhitespaceAfter"/>
-        <module name="WhitespaceAround"/>
-
-
-        <!-- Modifier Checks                                    -->
-        <!-- See http://checkstyle.sf.net/config_modifiers.html -->
-        <module name="ModifierOrder"/>
-        <module name="RedundantModifier"/>
-
-
-        <!-- Checks for blocks. You know, those {}'s         -->
-        <!-- See http://checkstyle.sf.net/config_blocks.html -->
-        <module name="AvoidNestedBlocks"/>
-        <module name="EmptyBlock"/>
-        <module name="LeftCurly"/>
-        <module name="NeedBraces"/>
-        <module name="RightCurly"/>
-
-
-        <!-- Checks for common coding problems               -->
-        <!-- See http://checkstyle.sf.net/config_coding.html -->
-        <!-- module name="AvoidInlineConditionals"/ -->
-        <module name="EmptyStatement"/>
-        <module name="EqualsHashCode"/>
-        <module name="IllegalInstantiation"/>
-
-
-        <!-- Checks for class design                         -->
-        <!-- See http://checkstyle.sf.net/config_design.html -->
-        <module name="FinalClass"/>
-        <module name="InterfaceIsType"/>
-
-
-        <!-- Miscellaneous other checks.                   -->
-        <!-- See http://checkstyle.sf.net/config_misc.html -->
-        <module name="ArrayTypeStyle"/>
-        <module name="UpperEll"/>
-
-        <module name="FileContentsHolder"/>
-
-    </module>
-
-    <!-- Support @SuppressWarnings (added in Checkstyle 5.7) -->
-    <!-- see http://checkstyle.sourceforge.net/config.html#SuppressWarningsFilter -->
-    <module name="SuppressWarningsFilter"/>
-
-    <!-- Checks properties file for a duplicated properties. -->
-    <!-- See http://checkstyle.sourceforge.net/config_misc.html#UniqueProperties -->
-    <module name="UniqueProperties"/>
-
-    <module name="SuppressionCommentFilter"/>
-
-</module>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/docs/kerby-pmd-ruleset.xml
----------------------------------------------------------------------
diff --git a/docs/kerby-pmd-ruleset.xml b/docs/kerby-pmd-ruleset.xml
deleted file mode 100644
index fc61e41..0000000
--- a/docs/kerby-pmd-ruleset.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<ruleset name="kerby-pmd" xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
-  <description>
-  A PMD ruleset for Apache Kerby
-  </description>
-
-  <rule ref="rulesets/java/basic.xml">
-     <exclude name="AvoidUsingHardCodedIP" />
-  </rule>
-  <rule ref="rulesets/java/unusedcode.xml"/>
-  <rule ref="rulesets/java/imports.xml"/>
-  <rule ref="rulesets/java/braces.xml"/>
-  <rule ref="rulesets/java/empty.xml"/>
-  <rule ref="rulesets/java/migrating.xml">
-     <exclude name="JUnit4TestShouldUseAfterAnnotation" />
-     <exclude name="JUnit4TestShouldUseTestAnnotation" />
-  </rule>
-  <rule ref="rulesets/java/unnecessary.xml"/>
-
-</ruleset>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/16ffe559/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3b4d302..21a6d04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,7 +56,6 @@
     <slf4j.version>1.7.12</slf4j.version>
     <assertj.version>2.2.0</assertj.version>
     <findbugs.version>3.0.1</findbugs.version>
-    <checkstyle.dir>${basedir}/docs</checkstyle.dir>
     <skipTests>false</skipTests>
   </properties>
 
@@ -65,6 +64,7 @@
   </prerequisites>
 
   <modules>
+    <module>build-tools</module>
     <module>kerby-config</module>
     <module>kerby-util</module>
     <module>kerby-asn1</module>
@@ -197,7 +197,7 @@
           <version>3.5</version>
           <configuration>
             <rulesets>
-              <ruleset>${checkstyle.dir}/kerby-pmd-ruleset.xml</ruleset>
+              <ruleset>kerby-pmd-ruleset.xml</ruleset>
             </rulesets>
             <linkXRef>false</linkXRef>
             <sourceEncoding>utf-8</sourceEncoding>
@@ -206,6 +206,13 @@
             <includeTests>true</includeTests>
             <targetJdk>1.7</targetJdk>
           </configuration>
+          <dependencies>
+            <dependency>
+              <groupId>org.apache.kerby</groupId>
+              <artifactId>build-tools</artifactId>
+              <version>${project.version}</version>
+            </dependency>
+          </dependencies>
           <executions>
             <execution>
               <id>validate</id>
@@ -222,11 +229,18 @@
           <artifactId>maven-checkstyle-plugin</artifactId>
           <version>2.15</version>
           <configuration>
-            <configLocation>${checkstyle.dir}/kerby-checkstyle.xml</configLocation>
+            <configLocation>kerby-checkstyle.xml</configLocation>
             <includeTestSourceDirectory>true</includeTestSourceDirectory>
             <encoding>UTF-8</encoding>
             <failOnViolation>true</failOnViolation>
           </configuration>
+          <dependencies>
+            <dependency>
+              <groupId>org.apache.kerby</groupId>
+              <artifactId>build-tools</artifactId>
+              <version>${project.version}</version>
+            </dependency>
+          </dependencies>
           <executions>
             <execution>
               <id>validate</id>
@@ -339,29 +353,6 @@
       </properties>
     </profile>
     <profile>
-      <id>activate-checkstyle-in-module</id>
-      <activation>
-        <file>
-          <exists>${basedir}/../docs/kerby-checkstyle.xml</exists>
-        </file>
-      </activation>
-      <properties>
-        <checkstyle.dir>${basedir}/../docs</checkstyle.dir>
-      </properties>
-    </profile>
-    <profile>
-      <id>activate-checkstyle-in-submodule</id>
-      <activation>
-        <file>
-          <exists>${basedir}/../../docs/kerby-checkstyle.xml</exists>
-        </file>
-      </activation>
-      <properties>
-        <checkstyle.dir>${basedir}/../../docs</checkstyle.dir>
-      </properties>
-    </profile>
-
-    <profile>
       <id>activate-checkstyle-supression</id>
       <activation>
         <file>


Mime
View raw message