Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the build to Gradle 9.3.1 and updates key build plugins, adapting build logic to Gradle 9/Shadow 9 APIs.
Changes:
- Upgraded Gradle wrapper and buildSrc plugin dependencies (Spotless, Shadow, OTel Gradle plugins, BuildConfig).
- Updated ShadowJar configuration to use Property API + explicit service file duplicate handling.
- Adjusted conventions (Spotless formatting, Java compiler args) for Gradle 9 compatibility.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| testing/agent-for-testing/build.gradle.kts | Updates ShadowJar/service-file handling and Gradle 9 property API usage in test agent build. |
| solarwinds-otel-sdk/build.gradle.kts | Adjusts ShadowJar classifier configuration for Gradle 9 Property API. |
| gradle/wrapper/gradle-wrapper.properties | Upgrades Gradle wrapper to 9.3.1. |
| buildSrc/src/main/kotlin/solarwinds.spotless-conventions.gradle.kts | Updates Spotless “misc” formatting configuration for newer Spotless API. |
| buildSrc/src/main/kotlin/solarwinds.shadow-conventions.gradle.kts | Adds global service-file merging + duplicate handling for ShadowJar tasks. |
| buildSrc/src/main/kotlin/solarwinds.java-conventions.gradle.kts | Removes deprecated configuration visibility flag; adds global AutoService verify disable flag. |
| buildSrc/build.gradle.kts | Bumps buildSrc plugin dependency versions for Gradle 9 compatibility. |
| build.sh | Splits formatting and build into separate Gradle invocations. |
| agent/build.gradle.kts | Updates ShadowJar service merging/duplicates + Gradle 9 property API; adds exclusions. |
| agent-lambda/build.gradle.kts | Updates ShadowJar service merging/duplicates + Gradle 9 property API; adds exclusions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the build system from Gradle 8.10 to Gradle 9.3.1 and updates all related build plugins to their latest compatible versions.
Key Changes
Gradle Version Upgrade
Upgrades from Gradle 8.10 to 9.3.1, bringing performance improvements, better dependency resolution, and support for newer JVM features during build time.
Plugin Updates
API Compatibility Fixes
Shadow Plugin Changes:
archiveClassifier = nullreplaced witharchiveClassifier.set("")— Gradle 9 deprecates direct property assignment in favor of the Property APImergeServiceFiles { include(...) }replaced withmergeServiceFiles("inst/META-INF/services")— aligns with new Shadow plugin APIfilesMatching("META-INF/services/**") { duplicatesStrategy = DuplicatesStrategy.INCLUDE }blocks sincemergeServiceFiles()now requires explicit duplicate handlingManifest Attributes:
attributes["key"] = valuetoattributes(mapOf(...))syntax for consistency with Gradle 9 conventionsConfiguration API:
isVisible = falsefrom dependency management configuration — this property is deprecated in Gradle 9Spotless Plugin:
indentWithSpaces()toleadingTabsToSpaces()to match the new plugin APIFunction Return Types:
: CopySpecreturn type annotations toisolateClasses()functions for type inference compatibilityDependency Exclusion Updates
Added exclusions for new transitive dependencies that must not appear in the
inst/directory:io.opentelemetry.semconv:opentelemetry-semconv-incubatingio.opentelemetry:opentelemetry-api-incubatorThese are bootstrap-level dependencies that need special classloader handling and cannot be bundled with isolated agent classes.
AutoService Annotation Processor Fix
Added
-Averify=falsecompiler argument globally insolarwinds.java-conventions.gradle.ktsto disable AutoService verification checks. This resolves a Gradle 9 compatibility issue where@SuppressWarnings("rawtypes")annotations on classes implementing generic service provider interfaces (e.g.,ConfigParser<T, R>) are not recognized by the AutoService annotation processor during certain compilation contexts, causing build failures with-Werror.Affected classes: All
ConfigParserimplementations inlibs/sharedthat use@AutoService(ConfigParser.class).Technical Rationale
Gradle 9 introduces stricter type safety and deprecates legacy Groovy-style property assignments. The changes ensure forward compatibility while maintaining identical build output behavior. The Shadow plugin 9.x requires explicit duplicate strategies when using
mergeServiceFiles(), preventing silent file overwrites during JAR assembly.The AutoService
-Averify=falseworkaround is necessary because the annotation processor'selement.getAnnotation(SuppressWarnings.class)call fails to find the@SuppressWarnings("rawtypes")annotation in Gradle 9 compilation contexts, despite the annotation being present in source code. This is tracked with a FIXME comment for future refactoring of the generic service provider interface pattern.Test services data