Author: cnauroth
Date: Tue Dec 15 19:16:44 2015
New Revision: 1720228

URL: http://svn.apache.org/viewvc?rev=1720228&view=rev
Log:
ZOOKEEPER-412: checkstyle target fails trunk build (Akihiro Suda via cnauroth)

Modified:
    zookeeper/branches/branch-3.5/CHANGES.txt
    zookeeper/branches/branch-3.5/build.xml
    zookeeper/branches/branch-3.5/ivy.xml
    zookeeper/branches/branch-3.5/src/java/test/checkstyle.xml

Modified: zookeeper/branches/branch-3.5/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/CHANGES.txt?rev=1720228&r1=1720227&r2=1720228&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/CHANGES.txt (original)
+++ zookeeper/branches/branch-3.5/CHANGES.txt Tue Dec 15 19:16:44 2015
@@ -95,6 +95,8 @@ BUGFIXES:
   ZOOKEEPER-1029: C client bug in zookeeper_init (if bad hostname is given)
   (fpj via cnauroth)
 
+  ZOOKEEPER-412: checkstyle target fails trunk build (Akihiro Suda via 
cnauroth)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-2270: Allow MBeanRegistry to be overridden for better unit tests

Modified: zookeeper/branches/branch-3.5/build.xml
URL: 
http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/build.xml?rev=1720228&r1=1720227&r2=1720228&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/build.xml (original)
+++ zookeeper/branches/branch-3.5/build.xml Tue Dec 15 19:16:44 2015
@@ -20,7 +20,8 @@
 <project name="ZooKeeper" default="jar" 
 xmlns:ivy="antlib:org.apache.ivy.ant"
 xmlns:artifact="antlib:org.apache.maven.artifact.ant"
-xmlns:maven="antlib:org.apache.maven.artifact.ant">
+xmlns:maven="antlib:org.apache.maven.artifact.ant"
+xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
 
     <!-- read build.properties from the basedir if any -->
     <property file="${basedir}/build.properties" />
@@ -1698,32 +1699,20 @@ xmlns:maven="antlib:org.apache.maven.art
         </cobertura-report>
     </target>
 
-    <target name="checkstyle" depends="checkstyle.check, 
set-checkstyle-classpath" if="checkstyle.home" 
-                       description="Run optional third-party tool targets">
-       <taskdef resource="checkstyletask.properties">
-               <classpath refid="checkstyle-classpath"/>
-        </taskdef>
-        <mkdir dir="${test.java.build.dir}"/>
-        <checkstyle config="${test.src.dir}/checkstyle.xml" 
failOnViolation="false">
-               <fileset dir="${src.dir}/java" includes="**/*.java" 
excludes="**/generated/**"/>
-               <formatter type="xml" 
toFile="${test.java.build.dir}/checkstyle-errors.xml"/>
-        </checkstyle>
-        <xslt style="${test.src.dir}/checkstyle-noframes-sorted.xsl" 
in="${test.java.build.dir}/checkstyle-errors.xml"
-               out="${test.java.build.dir}/checkstyle-errors.html"/>
-    </target>
-
-    <target name="checkstyle.check" unless="checkstyle.home">
-       <fail message="'checkstyle.home' is not defined. Please pass 
-Dcheckstyle.home=&lt;base of checkstyle installation&gt; 
-               to Ant on the command-line." />
+    <target name="checkstyle" depends="ivy-retrieve-test" description="Run 
Checkstyle coding standard checks">
+      <taskdef 
resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" 
uri="antlib:com.puppycrawl.tools.checkstyle.ant">
+        <classpath>
+          <fileset dir="${ivy.test.lib}" includes="*.jar" />
+        </classpath>
+      </taskdef>
+      <mkdir dir="${test.java.build.dir}"/>
+      <cs:checkstyle config="${test.src.dir}/checkstyle.xml" 
failOnViolation="false">
+        <fileset dir="${src.dir}/java" includes="**/*.java" 
excludes="**/generated/**"/>
+        <formatter type="xml" 
toFile="${test.java.build.dir}/checkstyle-errors.xml"/>
+      </cs:checkstyle>
+      <xslt style="${test.src.dir}/checkstyle-noframes-sorted.xsl" 
in="${test.java.build.dir}/checkstyle-errors.xml"
+            out="${test.java.build.dir}/checkstyle-errors.html"/>
     </target>
-    
-    <target name="set-checkstyle-classpath">
-       <path id="checkstyle-classpath">
-               <fileset dir="${checkstyle.home}">
-                       <include name="**/*.jar"/>
-               </fileset>
-       </path>
-    </target>  
 
     <!-- ================================================================== -->
     <!-- Perform audit activities for the release                           -->

Modified: zookeeper/branches/branch-3.5/ivy.xml
URL: 
http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/ivy.xml?rev=1720228&r1=1720227&r2=1720228&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/ivy.xml (original)
+++ zookeeper/branches/branch-3.5/ivy.xml Tue Dec 15 19:16:44 2015
@@ -60,7 +60,7 @@
     <dependency org="junit" name="junit" rev="4.12" conf="test->default"/>
        <dependency org="org.mockito" name="mockito-all" rev="1.8.2"
                conf="test->default"/>
-    <dependency org="checkstyle" name="checkstyle" rev="5.0"
+    <dependency org="com.puppycrawl.tools" name="checkstyle" rev="6.13"
                 conf="test->default"/>
 
     <dependency org="jdiff" name="jdiff" rev="1.0.9"

Modified: zookeeper/branches/branch-3.5/src/java/test/checkstyle.xml
URL: 
http://svn.apache.org/viewvc/zookeeper/branches/branch-3.5/src/java/test/checkstyle.xml?rev=1720228&r1=1720227&r2=1720228&view=diff
==============================================================================
--- zookeeper/branches/branch-3.5/src/java/test/checkstyle.xml (original)
+++ zookeeper/branches/branch-3.5/src/java/test/checkstyle.xml Tue Dec 15 
19:16:44 2015
@@ -4,6 +4,23 @@
     "http://www.puppycrawl.com/dtds/configuration_1_2.dtd";>
 
 <!--
+   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.
+-->
+<!--
+  [Forked from Hadoop@2d7363b27360e36fdd62546c0f9d0b1d78133f29]
 
   Checkstyle configuration for Zookeeper that is based on the sun_checks.xml 
file
   that is bundled with Checkstyle and includes checks for:
@@ -35,7 +52,7 @@
 
     <!-- Checks that a package.html file exists for each package.     -->
     <!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
-    <module name="PackageHtml"/>
+    <module name="JavadocPackage"/>
 
     <!-- Checks whether files end with a new line.                        -->
     <!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
@@ -45,6 +62,8 @@
     <!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
     <module name="Translation"/>
 
+    <module name="FileLength"/>
+    <module name="FileTabCharacter"/>
 
     <module name="TreeWalker">
 
@@ -96,8 +115,9 @@
 
         <!-- Checks for Size Violations.                    -->
         <!-- See http://checkstyle.sf.net/config_sizes.html -->
-        <module name="FileLength"/>
-        <module name="LineLength"/>
+        <module name="LineLength">
+          <property name="ignorePattern" value="^import"/>
+        </module>
         <module name="MethodLength"/>
         <module name="ParameterNumber"/>
 
@@ -110,7 +130,6 @@
         <module name="NoWhitespaceBefore"/>
         <module name="ParenPad"/>
         <module name="TypecastParenPad"/>
-        <module name="TabCharacter"/>
         <module name="WhitespaceAfter">
                <property name="tokens" value="COMMA, SEMI"/>
                </module>
@@ -134,7 +153,6 @@
         <!-- Checks for common coding problems               -->
         <!-- See http://checkstyle.sf.net/config_coding.html -->
         <!-- module name="AvoidInlineConditionals"/-->
-        <module name="DoubleCheckedLocking"/>
         <module name="EmptyStatement"/>
         <module name="EqualsHashCode"/>
         <module name="HiddenField">
@@ -143,7 +161,6 @@
         <module name="IllegalInstantiation"/>
         <module name="InnerAssignment"/>
         <module name="MissingSwitchDefault"/>
-        <module name="RedundantThrows"/>
         <module name="SimplifyBooleanExpression"/>
         <module name="SimplifyBooleanReturn"/>
 


Reply via email to