This is an automated email from the ASF dual-hosted git repository.

brandonwilliams pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e98258a132 Upgrade checkstyle to 10.8.1 for j11 and 8.45.1 for j8
e98258a132 is described below

commit e98258a132d6d27c8431e6971693a224953fdd89
Author: Maxim Muzafarov <[email protected]>
AuthorDate: Wed Mar 29 13:30:53 2023 +0200

    Upgrade checkstyle to 10.8.1 for j11 and 8.45.1 for j8
    
    Patch by Maxim Muzafarov; reviewed by brandonwilliams and smiklosovic
    for CASSANDRA-18262
---
 .build/build-resolver.xml                |  6 ++++++
 .build/cassandra-build-deps-template.xml |  4 ----
 .build/parent-pom-template.xml           |  6 ------
 CHANGES.txt                              |  1 +
 build.xml                                | 13 +++++++------
 5 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/.build/build-resolver.xml b/.build/build-resolver.xml
index 60122b854f..e78bbf05e6 100644
--- a/.build/build-resolver.xml
+++ b/.build/build-resolver.xml
@@ -126,6 +126,12 @@
             </dependencies>
             <path refid="jflex.classpath" classpath="runtime"/>
         </resolve>
+        <resolve>
+            <dependencies>
+                <dependency groupId="com.puppycrawl.tools" 
artifactId="checkstyle" version="${checkstyle.version}" />
+            </dependencies>
+            <path refid="checkstyle.classpath" classpath="runtime"/>
+        </resolve>
 
         <macrodef name="install">
             <attribute name="pomFile"/>
diff --git a/.build/cassandra-build-deps-template.xml 
b/.build/cassandra-build-deps-template.xml
index 93387996ef..cbf2f8c59d 100644
--- a/.build/cassandra-build-deps-template.xml
+++ b/.build/cassandra-build-deps-template.xml
@@ -62,10 +62,6 @@
       <groupId>com.google.jimfs</groupId>
       <artifactId>jimfs</artifactId>
     </dependency>
-    <dependency>
-      <groupId>com.puppycrawl.tools</groupId>
-      <artifactId>checkstyle</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.quicktheories</groupId>
       <artifactId>quicktheories</artifactId>
diff --git a/.build/parent-pom-template.xml b/.build/parent-pom-template.xml
index 70f85d033e..35ed4047fb 100644
--- a/.build/parent-pom-template.xml
+++ b/.build/parent-pom-template.xml
@@ -497,12 +497,6 @@
         <version>0.0.13</version>
         <scope>test</scope>
       </dependency>
-      <dependency>
-        <groupId>com.puppycrawl.tools</groupId>
-        <artifactId>checkstyle</artifactId>
-        <version>8.40</version>
-        <scope>test</scope>
-      </dependency>
       <dependency>
         <groupId>net.java.dev.jna</groupId>
         <artifactId>jna</artifactId>
diff --git a/CHANGES.txt b/CHANGES.txt
index a2102acc56..e541b5c7b1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 5.0
+ * Use jdk-dependent checkstyle version to check the source code 
(CASSANDRA-18262)
  * Provide summary of failed SessionInfo's in StreamResultFuture 
(CASSANDRA-17199)
  * CEP-20: Dynamic Data Masking (CASSANDRA-17940)
  * Add system_views.snapshots virtual table (CASSANDRA-18102)
diff --git a/build.xml b/build.xml
index 197f720472..f75314e044 100644
--- a/build.xml
+++ b/build.xml
@@ -311,6 +311,9 @@
             <equals arg1="${ant.java.version}" arg2="1.8"/>
         </not>
     </condition>
+    <condition property="checkstyle.version" value="8.45.1" else="10.8.1">
+        <equals arg1="${ant.java.version}" arg2="1.8"/>
+    </condition>
 
     <!--
          Add all the dependencies.
@@ -1939,16 +1942,14 @@
   </target>
 
   <target name="init-checkstyle" 
depends="resolver-retrieve-build,build-project" unless="no-checkstyle">
-      <path id="checkstyle.lib.path">
-          <fileset dir="${test.lib}/jars" includes="*.jar"/>
-      </path>
+      <echo message="checkstyle.version=${checkstyle.version}"/>
       <!-- Sevntu custom checks are retrieved by Ivy into lib folder
          and will be accessible to checkstyle-->
       <taskdef 
resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties"
-               classpathref="checkstyle.lib.path"/>
+               classpathref="checkstyle.classpath"/>
   </target>
 
-  <target name="checkstyle" depends="init-checkstyle,build-project" 
description="Run custom checkstyle code analysis" if="java.version.8" 
unless="no-checkstyle">
+  <target name="checkstyle" depends="init-checkstyle,build-project" 
description="Run custom checkstyle code analysis" unless="no-checkstyle">
       <property name="checkstyle.log.dir" value="${build.dir}/checkstyle" />
       <property name="checkstyle.report.file" 
value="${checkstyle.log.dir}/checkstyle_report.xml"/>
       <mkdir  dir="${checkstyle.log.dir}" />
@@ -1964,7 +1965,7 @@
       </checkstyle>
   </target>
 
-  <target name="checkstyle-test" 
depends="init-checkstyle,resolver-retrieve-build,build-project" 
description="Run custom checkstyle code analysis on tests" if="java.version.8" 
unless="no-checkstyle">
+  <target name="checkstyle-test" 
depends="init-checkstyle,resolver-retrieve-build,build-project" 
description="Run custom checkstyle code analysis on tests" 
unless="no-checkstyle">
       <property name="checkstyle.log.dir" value="${build.dir}/checkstyle" />
       <property name="checkstyle_test.report.file" 
value="${checkstyle.log.dir}/checkstyle_report_test.xml"/>
       <mkdir  dir="${checkstyle.log.dir}" />


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to