This is an automated email from the ASF dual-hosted git repository. ijuma pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/trunk by this push: new 4441a01bb0d MINOR: Enable spotless for streams-scala when Java 11+ is used (#13311) 4441a01bb0d is described below commit 4441a01bb0d7cd2f4c5affd13ab65c79f7e342f4 Author: Ismael Juma <ism...@juma.me.uk> AuthorDate: Mon Feb 27 00:28:19 2023 -0800 MINOR: Enable spotless for streams-scala when Java 11+ is used (#13311) Also re-enable it in CI. We do this by adjusting the `Jenkinsfile` to use a more general task (`./gradlew check -x test`). Reviewers: Chia-Ping Tsai <chia7...@gmail.com>, Dejan Stojadinović <dejan2...@users.noreply.github.com> --- Jenkinsfile | 4 ++-- build.gradle | 24 ++++++++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f296060b50..fbd3fce4b5f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,9 +18,9 @@ */ def doValidation() { + // Run all the tasks associated with `check` except for `test` - the latter is executed via `doTest` sh """ - ./retry_zinc ./gradlew -PscalaVersion=$SCALA_VERSION clean compileJava compileScala compileTestJava compileTestScala \ - checkstyleMain checkstyleTest spotbugsMain rat \ + ./retry_zinc ./gradlew -PscalaVersion=$SCALA_VERSION clean check -x test \ --profile --continue -PxmlSpotBugsReport=true -PkeepAliveMode="session" """ } diff --git a/build.gradle b/build.gradle index 7ee6aea850c..ea62fbfc242 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,7 @@ // limitations under the License. import org.ajoberstar.grgit.Grgit +import org.gradle.api.JavaVersion import java.nio.charset.StandardCharsets @@ -30,26 +31,18 @@ buildscript { } plugins { - id 'com.diffplug.spotless' version '6.13.0' // newer versions require Java 11, so we can't use them until Kafka 4.0 id 'com.github.ben-manes.versions' version '0.44.0' id 'idea' id 'java-library' id 'org.owasp.dependencycheck' version '8.0.2' id 'org.nosphere.apache.rat' version "0.8.0" + id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.0" id "com.github.spotbugs" version '5.0.13' apply false id 'org.gradle.test-retry' version '1.5.1' apply false id 'org.scoverage' version '7.0.1' apply false id 'com.github.johnrengelman.shadow' version '7.1.2' apply false - id "io.swagger.core.v3.swagger-gradle-plugin" version "2.2.0" -} - -spotless { - scala { - target 'streams/**/*.scala' - scalafmt("$versions.scalafmt").configFile('checkstyle/.scalafmt.conf').scalaMajorVersion(versions.baseScala) - licenseHeaderFile 'checkstyle/java.header', 'package' - } + id 'com.diffplug.spotless' version '6.14.0' apply false // 6.14.1 and newer require Java 11 at compile time, so we can't upgrade until AK 4.0 } ext { @@ -2116,6 +2109,17 @@ project(':streams:streams-scala') { dependsOn 'copyDependantLibs' } + // spotless 6.14 requires Java 11 at runtime + if (JavaVersion.current().isJava11Compatible()) { + apply plugin: 'com.diffplug.spotless' + spotless { + scala { + target '**/*.scala' + scalafmt("$versions.scalafmt").configFile('../../checkstyle/.scalafmt.conf').scalaMajorVersion(versions.baseScala) + licenseHeaderFile '../../checkstyle/java.header', 'package' + } + } + } } project(':streams:test-utils') {