Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump spotless-plugin-gradle from 6.12.1 to 6.13.0 #7591

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = false
insert_final_newline = true
Copy link
Member

Choose a reason for hiding this comment

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

@mateuszrzeszutek I pushed this change and ran spotlessApply

max_line_length = 100
tab_width = 2
ij_continuation_indent_size = 4
Expand Down
20 changes: 17 additions & 3 deletions conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,26 @@ plugins {
spotless {
java {
googleJavaFormat()
licenseHeaderFile(rootProject.file("../buildscripts/spotless.license.java"), "(package|import|public)")
licenseHeaderFile(
rootProject.file("../buildscripts/spotless.license.java"),
"(package|import|public)"
)
target("src/**/*.java")
}
kotlinGradle {
// not sure why it's not using the indent settings from .editorconfig
ktlint().editorConfigOverride(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports"))
ktlint().editorConfigOverride(mapOf(
"indent_size" to "2",
"continuation_indent_size" to "2",
"max_line_length" to "160",
"ktlint_standard_no-wildcard-imports" to "disabled",
// ktlint does not break up long lines, it just fails on them
"ktlint_standard_max-line-length" to "disabled",
// ktlint makes it *very* hard to locate where this actually happened
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
// also very hard to find out where this happens
"ktlint_standard_wrapping" to "disabled"
Comment on lines +22 to +28
Copy link
Member

Choose a reason for hiding this comment

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

❤️

))
target("**/*.gradle.kts")
}
}
Expand All @@ -38,7 +52,7 @@ dependencies {
implementation("org.apache.maven:maven-aether-provider:3.3.9")

// When updating, update above in plugins too
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.12.1")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.13.0")
implementation("com.google.guava:guava:31.1-jre")
implementation("gradle.plugin.com.google.protobuf:protobuf-gradle-plugin:0.8.18")
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ extra["testLatestDeps"] = testLatestDeps
abstract class TestLatestDepsRule : ComponentMetadataRule {
override fun execute(context: ComponentMetadataContext) {
val version = context.details.id.version
if (version.contains("-alpha", true)
|| version.contains("-beta", true)
|| version.contains("-rc", true)
|| version.contains("-m", true) // e.g. spring milestones are published to grails repo
|| version.contains(".alpha", true) // e.g. netty
|| version.contains(".beta", true) // e.g. hibernate
|| version.contains(".cr", true) // e.g. hibernate
if (version.contains("-alpha", true) ||
version.contains("-beta", true) ||
version.contains("-rc", true) ||
version.contains("-m", true) || // e.g. spring milestones are published to grails repo
version.contains(".alpha", true) || // e.g. netty
version.contains(".beta", true) || // e.g. hibernate
version.contains(".cr", true) // e.g. hibernate
) {
context.details.status = "milestone"
}
Expand Down
13 changes: 9 additions & 4 deletions conventions/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17

java {
toolchain {
languageVersion.set(otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) })
languageVersion.set(
otelJava.minJavaVersionSupported.map { JavaLanguageVersion.of(Math.max(it.majorVersion.toInt(), DEFAULT_JAVA_VERSION.majorVersion.toInt())) }
)
}

// See https://docs.gradle.org/current/userguide/upgrading_version_5.html, Automatic target JVM version
Expand Down Expand Up @@ -150,7 +152,6 @@ testing {
runtimeOnly("org.junit.vintage:junit-vintage-engine")
implementation("org.junit-pioneer:junit-pioneer")


implementation("org.assertj:assertj-core")
implementation("org.awaitility:awaitility")
implementation("org.mockito:mockito-core")
Expand Down Expand Up @@ -268,7 +269,9 @@ gradle.sharedServices.registerIfAbsent("testcontainersBuildService", Testcontain
maxParallelUsages.convention(2)
}

val resourceClassesCsv = listOf("Host", "Os", "Process", "ProcessRuntime").map { "io.opentelemetry.sdk.extension.resources.${it}ResourceProvider" }.joinToString(",")
val resourceNames = listOf("Host", "Os", "Process", "ProcessRuntime")
val resourceClassesCsv = resourceNames.joinToString(",") { "io.opentelemetry.sdk.extension.resources.${it}ResourceProvider" }

tasks.withType<Test>().configureEach {
useJUnitPlatform()

Expand Down Expand Up @@ -400,7 +403,9 @@ configurations.configureEach {
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api")).using(project(":instrumentation-api"))
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-semconv")).using(project(":instrumentation-api-semconv"))
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations")).using(project(":instrumentation-annotations"))
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations-support")).using(project(":instrumentation-annotations-support"))
substitute(module("io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations-support")).using(
project(":instrumentation-annotations-support")
)
substitute(module("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")).using(project(":javaagent-bootstrap"))
substitute(module("io.opentelemetry.javaagent:opentelemetry-javaagent-extension-api")).using(project(":javaagent-extension-api"))
substitute(module("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")).using(project(":javaagent-tooling"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ publishing {
}
artifactId = artifactPrefix(project, base.archivesName.get()) + base.archivesName.get()

if (groupId != "io.opentelemetry.instrumentation"
&& groupId != "io.opentelemetry.javaagent"
&& groupId != "io.opentelemetry.javaagent.instrumentation") {
if (groupId != "io.opentelemetry.instrumentation" &&
groupId != "io.opentelemetry.javaagent" &&
groupId != "io.opentelemetry.javaagent.instrumentation") {
throw GradleException("Unexpected groupId for this project or its parent ${project.parent}: $groupId")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,72 @@ plugins {
spotless {
java {
googleJavaFormat()
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|public|// Includes work from:)")
licenseHeaderFile(
rootProject.file("buildscripts/spotless.license.java"),
"(package|import|public|// Includes work from:)"
)
toggleOffOn()
target("src/**/*.java")
}
plugins.withId("groovy") {
groovy {
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class)")
licenseHeaderFile(
rootProject.file("buildscripts/spotless.license.java"),
"(package|import|class)"
)
endWithNewline()
}
}
plugins.withId("scala") {
scala {
scalafmt()
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|public)")
licenseHeaderFile(
rootProject.file("buildscripts/spotless.license.java"),
"(package|import|public)"
)
target("src/**/*.scala")
}
}
plugins.withId("org.jetbrains.kotlin.jvm") {
kotlin {
// not sure why it's not using the indent settings from .editorconfig
ktlint().editorConfigOverride(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports,package-name"))
licenseHeaderFile(rootProject.file("buildscripts/spotless.license.java"), "(package|import|class|// Includes work from:)")
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "2",
"continuation_indent_size" to "2",
"max_line_length" to "160",
"ktlint_standard_no-wildcard-imports" to "disabled",
"ktlint_standard_package-name" to "disabled",
// ktlint does not break up long lines, it just fails on them
"ktlint_standard_max-line-length" to "disabled",
// ktlint makes it *very* hard to locate where this actually happened
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
// also very hard to find out where this happens
"ktlint_standard_wrapping" to "disabled"
)
)
licenseHeaderFile(
rootProject.file("buildscripts/spotless.license.java"),
"(package|import|class|// Includes work from:)"
)
}
}
kotlinGradle {
// not sure why it's not using the indent settings from .editorconfig
ktlint().editorConfigOverride(mapOf("indent_size" to "2", "continuation_indent_size" to "2", "disabled_rules" to "no-wildcard-imports"))
ktlint().editorConfigOverride(
mapOf(
"indent_size" to "2",
"continuation_indent_size" to "2",
"max_line_length" to "160",
"ktlint_standard_no-wildcard-imports" to "disabled",
// ktlint does not break up long lines, it just fails on them
"ktlint_standard_max-line-length" to "disabled",
// ktlint makes it *very* hard to locate where this actually happened
"ktlint_standard_trailing-comma-on-call-site" to "disabled",
// also very hard to find out where this happens
"ktlint_standard_wrapping" to "disabled"
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ muzzle {
sourceSets {
main {
val shadedDep = project(":instrumentation:azure-core:azure-core-1.14:library-instrumentation-shaded")
output.dir(shadedDep.file("build/extracted/shadow"), "builtBy" to ":instrumentation:azure-core:azure-core-1.14:library-instrumentation-shaded:extractShadowJar")
output.dir(
shadedDep.file("build/extracted/shadow"),
"builtBy" to ":instrumentation:azure-core:azure-core-1.14:library-instrumentation-shaded:extractShadowJar"
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ muzzle {
sourceSets {
main {
val shadedDep = project(":instrumentation:azure-core:azure-core-1.19:library-instrumentation-shaded")
output.dir(shadedDep.file("build/extracted/shadow"), "builtBy" to ":instrumentation:azure-core:azure-core-1.19:library-instrumentation-shaded:extractShadowJar")
output.dir(
shadedDep.file("build/extracted/shadow"),
"builtBy" to ":instrumentation:azure-core:azure-core-1.19:library-instrumentation-shaded:extractShadowJar"
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_1_6.shaded.com.couchbase.client.tracing.opentelemetry")
relocate(
"com.couchbase.client.tracing.opentelemetry",
"io.opentelemetry.javaagent.instrumentation.couchbase.v3_1_6.shaded.com.couchbase.client.tracing.opentelemetry"
)
}

val extractShadowJar by registering(Copy::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_1.shaded.com.couchbase.client.tracing.opentelemetry")
relocate(
"com.couchbase.client.tracing.opentelemetry",
"io.opentelemetry.javaagent.instrumentation.couchbase.v3_1.shaded.com.couchbase.client.tracing.opentelemetry"
)
}

val extractShadowJar by registering(Copy::class) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ tasks {
// including only tracing-opentelemetry excludes its transitive dependencies
include(dependency("com.couchbase.client:tracing-opentelemetry"))
}
relocate("com.couchbase.client.tracing.opentelemetry", "io.opentelemetry.javaagent.instrumentation.couchbase.v3_2.shaded.com.couchbase.client.tracing.opentelemetry")
relocate(
"com.couchbase.client.tracing.opentelemetry",
"io.opentelemetry.javaagent.instrumentation.couchbase.v3_2.shaded.com.couchbase.client.tracing.opentelemetry"
)
}

val extractShadowJar by registering(Copy::class) {
Expand Down
4 changes: 3 additions & 1 deletion instrumentation/executors/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ testing {

tasks {
withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.executors.include=io.opentelemetry.javaagent.instrumentation.executors.ExecutorInstrumentationTest\$CustomThreadPoolExecutor")
jvmArgs(
"-Dotel.instrumentation.executors.include=io.opentelemetry.javaagent.instrumentation.executors.ExecutorInstrumentationTest\$CustomThreadPoolExecutor"
)
jvmArgs("-Djava.awt.headless=true")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class KtorServerTracing private constructor(

internal val additionalExtractors = mutableListOf<AttributesExtractor<in ApplicationRequest, in ApplicationResponse>>()

internal val httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(KtorHttpServerAttributesGetter.INSTANCE, KtorNetServerAttributesGetter())
internal val httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(
KtorHttpServerAttributesGetter.INSTANCE,
KtorNetServerAttributesGetter()
)

internal var statusExtractor:
(SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse> = { a -> a }
Expand All @@ -43,7 +46,9 @@ class KtorServerTracing private constructor(
this.openTelemetry = openTelemetry
}

fun setStatusExtractor(extractor: (SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>) {
fun setStatusExtractor(
extractor: (SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>
) {
this.statusExtractor = extractor
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ class KtorServerTracing private constructor(

internal val additionalExtractors = mutableListOf<AttributesExtractor<in ApplicationRequest, in ApplicationResponse>>()

internal val httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(KtorHttpServerAttributesGetter.INSTANCE, KtorNetServerAttributesGetter())
internal val httpAttributesExtractorBuilder = HttpServerAttributesExtractor.builder(
KtorHttpServerAttributesGetter.INSTANCE,
KtorNetServerAttributesGetter()
)

internal var statusExtractor:
(SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse> = { a -> a }
Expand All @@ -43,7 +46,9 @@ class KtorServerTracing private constructor(
this.openTelemetry = openTelemetry
}

fun setStatusExtractor(extractor: (SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>) {
fun setStatusExtractor(
extractor: (SpanStatusExtractor<ApplicationRequest, ApplicationResponse>) -> SpanStatusExtractor<in ApplicationRequest, in ApplicationResponse>
) {
this.statusExtractor = extractor
}

Expand Down
4 changes: 3 additions & 1 deletion instrumentation/methods/javaagent/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ dependencies {
}

tasks.withType<Test>().configureEach {
jvmArgs("-Dotel.instrumentation.methods.include=io.opentelemetry.javaagent.instrumentation.methods.MethodTest\$ConfigTracedCallable[call];io.opentelemetry.javaagent.instrumentation.methods.MethodTest\$ConfigTracedCompletableFuture[getResult]")
jvmArgs(
"-Dotel.instrumentation.methods.include=io.opentelemetry.javaagent.instrumentation.methods.MethodTest\$ConfigTracedCallable[call];io.opentelemetry.javaagent.instrumentation.methods.MethodTest\$ConfigTracedCompletableFuture[getResult]"
)
}
21 changes: 19 additions & 2 deletions smoke-tests/images/servlet/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ plugins {
id("com.bmuschko.docker-remote-api")
}

data class ImageTarget(val version: List<String>, val vm: List<String>, val jdk: List<String>, val args: Map<String, String> = emptyMap(), val war: String = "servlet-3.0", val windows: Boolean = true)
data class ImageTarget(
val version: List<String>,
val vm: List<String>,
val jdk: List<String>,
val args: Map<String, String> = emptyMap(),
val war: String = "servlet-3.0",
val windows: Boolean = true
)

val extraTag = findProperty("extraTag")
?: java.time.format.DateTimeFormatter.ofPattern("yyyyMMdd.HHmmSS").format(java.time.LocalDateTime.now())
Expand Down Expand Up @@ -112,7 +119,17 @@ tasks {
}
}

fun configureImage(parentTask: TaskProvider<out Task>, server: String, dockerfile: String, version: String, vm: String, jdk: String, warProject: String, args: Map<String, String>, isWindows: Boolean): String {
fun configureImage(
parentTask: TaskProvider<out Task>,
server: String,
dockerfile: String,
version: String,
vm: String,
jdk: String,
warProject: String,
args: Map<String, String>,
isWindows: Boolean
): String {
// Using separate build directory for different image
val dockerWorkingDir = file("$buildDir/docker-$server-$version-jdk$jdk-$vm-$warProject")
val dockerFileName = "$dockerfile.${if (isWindows) "windows." else ""}dockerfile"
Expand Down