Skip to content
Draft
6 changes: 6 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,12 @@ spotless:
extends: .gradle_build
stage: tests
needs: []
variables:
# TODO: Latest version of spotless is failing with OOM on CI only.
# Setting 8G memory solving this issue, but we need to solve it eventually.
GRADLE_MEM: 8G
KUBERNETES_MEMORY_REQUEST: 18Gi
KUBERNETES_MEMORY_LIMIT: 18Gi
script:
- ./gradlew --version
- ./gradlew spotlessCheck $GRADLE_ARGS
Expand Down
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
id("datadog.dump-hanged-test")
id("datadog.ci-jobs")

id("com.diffplug.spotless") version "6.13.0"
id("com.diffplug.spotless") version "8.0.0"
id("com.github.spotbugs") version "6.4.4"
id("de.thetaphi.forbiddenapis") version "3.10"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
Expand All @@ -35,7 +35,7 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
removeUnusedImports()

// This is the last Google Java Format version that supports Java 8
googleJavaFormat("1.7")
googleJavaFormat("1.29.0")
}
groovyGradle {
greclipse()
Expand All @@ -44,13 +44,14 @@ with(extensions["spotlessPredeclare"] as SpotlessExtension) {
greclipse()
}
kotlinGradle {
ktlint("0.41.0")
ktlint("1.7.1")
}
kotlin {
ktlint("0.41.0")
ktlint("1.7.1")
}
scala {
scalafmt("2.7.5")
// TODO: For some reason Scala format is working correctly with this version only.
scalafmt("3.8.6")
}
}
apply(from = rootDir.resolve("gradle/spotless.gradle"))
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
`java-gradle-plugin`
`kotlin-dsl`
`jvm-test-suite`
id("com.diffplug.spotless") version "6.13.0"
id("com.diffplug.spotless") version "8.0.0"
}

java {
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/call-site-instrumentation-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
java
groovy
id("com.diffplug.spotless") version "6.13.0"
id("com.diffplug.spotless") version "8.0.0"
id("com.gradleup.shadow") version "8.3.6"
}

Expand All @@ -18,7 +18,7 @@ spotless {
// ignore embedded test projects
targetExclude("src/test/resources/**")
// This is the last Google Java Format version that supports Java 8
googleJavaFormat("1.7")
googleJavaFormat("1.29.0")
}
}

Expand Down
2 changes: 0 additions & 2 deletions dd-smoke-tests/armeria-grpc/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ buildscript {
plugins {
id 'application'
id 'java'
id 'com.diffplug.spotless' version '6.13.0'
id 'com.gradleup.shadow' version '8.3.6'
id 'com.google.protobuf' version '0.9.3'
}
Expand All @@ -17,7 +16,6 @@ def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
2 changes: 0 additions & 2 deletions dd-smoke-tests/kafka-3/application/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.2.2'
id 'io.spring.dependency-management' version '1.1.4'
id 'com.diffplug.spotless' version '6.13.0'
}

java {
Expand All @@ -16,7 +15,6 @@ def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
10 changes: 10 additions & 0 deletions dd-smoke-tests/kafka-3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,13 @@ tasks.named('compileTestGroovy') {
tasks.withType(Test).configureEach {
jvmArgs "-Ddatadog.smoketest.springboot.shadowJar.path=${appBuildDir}/libs/kafka-3-smoketest.jar"
}

spotless {
java {
target "**/*.java"
}

groovyGradle {
target '*.gradle', "**/*.gradle"
}
}
2 changes: 0 additions & 2 deletions dd-smoke-tests/quarkus-native/application/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
id 'java'
id 'io.quarkus'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
2 changes: 0 additions & 2 deletions dd-smoke-tests/quarkus/application/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
id 'java'
id 'io.quarkus'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
2 changes: 0 additions & 2 deletions dd-smoke-tests/rum/wildfly-15/rum-ear/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
id 'java'
id 'ear'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"
apply plugin: 'ear'

if (hasProperty('appBuildDir')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ plugins {
id 'java'
id 'org.springframework.boot' version '2.7.4'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ plugins {
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'org.graalvm.buildtools.native' version '0.9.28'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

ext.withProfiler = hasProperty('profiler')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.3.5'
id 'io.spring.dependency-management' version '1.0.14.RELEASE'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"

if (hasProperty('appBuildDir')) {
buildDir = property('appBuildDir')
Expand Down
2 changes: 0 additions & 2 deletions dd-smoke-tests/wildfly/spring-ear/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
plugins {
id 'java'
id 'ear'
id 'com.diffplug.spotless' version '6.13.0'
}

def sharedRootDir = "$rootDir/../../../"
def sharedConfigDirectory = "$sharedRootDir/gradle"
rootProject.ext.sharedConfigDirectory = sharedConfigDirectory

apply from: "$sharedConfigDirectory/repositories.gradle"
apply from: "$sharedConfigDirectory/spotless.gradle"
apply plugin: 'ear'

if (hasProperty('appBuildDir')) {
Expand Down
2 changes: 2 additions & 0 deletions gradle/enforcement/spotless-scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
version = 3.8.6
runner.dialect = scala213
align.preset = more
maxColumn = 100
25 changes: 15 additions & 10 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spotless {
// ignore embedded test projects and everything in build dir, e.g. generated sources
targetExclude('src/test/resources/**', buildDirectoryFiles)
// This is the last Google Java Format version that supports Java 8
googleJavaFormat('1.7')
googleJavaFormat('1.29.0')
}
}

Expand All @@ -44,9 +44,11 @@ spotless {
toggleOffOn()
// same as kotlin, but for .gradle.kts files (defaults to '*.gradle.kts')
target '*.gradle.kts'
// ktfmt('0.40').kotlinlangStyle() // needs Java 11+
// Newer versions do not work well with the older version of kotlin in this build
ktlint('0.41.0').userData(['indent_size': '2', 'continuation_indent_size': '2'])
ktlint('1.7.1').editorConfigOverride([
// Disable trailing comma rules to minimize diff.
'ktlint_standard_trailing-comma-on-call-site': 'disabled',
'ktlint_standard_trailing-comma-on-declaration-site': 'disabled'
])
}

project.pluginManager.withPlugin('groovy') {
Expand All @@ -66,32 +68,35 @@ spotless {
scala {
toggleOffOn()
targetExclude(buildDirectoryFiles)
scalafmt('2.7.5').configFile(configPath + '/enforcement/spotless-scalafmt.conf')
// TODO: For some reason Scala format is working correctly with this version only.
scalafmt('3.8.6').configFile(configPath + '/enforcement/spotless-scalafmt.conf')
}
}

format 'markdown', {
toggleOffOn()
target '*.md', '.github/**/*.md', 'src/**/*.md', 'application/**/*.md'
indentWithSpaces()
leadingTabsToSpaces()
endWithNewline()
}

format 'misc', {
toggleOffOn()
target '.gitignore', '*.sh', 'tooling/*.sh', '.gitlab/*.sh'
indentWithSpaces()
leadingTabsToSpaces()
trimTrailingWhitespace()
endWithNewline()
}

project.pluginManager.withPlugin('kotlin') {
kotlin {
toggleOffOn()
// ktfmt('0.40').kotlinlangStyle() // needs Java 11+
targetExclude(buildDirectoryFiles)
// Newer versions do not work well with the older version of kotlin in this build
ktlint('0.41.0').userData(['indent_size': '2', 'continuation_indent_size': '2'])
ktlint('1.7.1').editorConfigOverride([
// Disable trailing comma rules to minimize diff.
'ktlint_standard_trailing-comma-on-call-site': 'disabled',
'ktlint_standard_trailing-comma-on-declaration-site': 'disabled'
])
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ plugins {

java {
disableAutoTargetJvm()

toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
Comment on lines +9 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: In my opinion this can go in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep it here, as it related to spotless bump anyway...
Probably it can be part of PR where we would migrate to JDK 21.


sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
Expand Down
2 changes: 1 addition & 1 deletion test-published-dependencies/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.diffplug.spotless' version '6.13.0'
id 'com.diffplug.spotless' version '8.0.0'
}

def sharedConfigDirectory = "$rootDir/../gradle"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
toolchainVersion=21