chore: fix deprecated Gradle APIs, move to com.gradleup.shadow, bump build deps - #17
Conversation
…w plugin Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Devin, should we be using the newer version of this that has been renamed |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Good call — switched to I stayed on the 8.3.x line rather than 9.x: shadow 9.x calls Verified locally with a real SDK key: |
Co-Authored-By: jbailey@launchdarkly.com <accounts@sidewaysgravity.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
@cursor review |
Summary
Removes all Gradle deprecation warnings from this example ("Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0") and moves off the unmaintained
com.github.johnrengelman.shadowplugin.Why each piece is required rather than cosmetic:
mainClassName→mainClass:JavaApplication.setMainClassName/JavaExec.mainwere deprecated and removed in Gradle 8.project.mainClassNameconvention, so switching tomainClassalone makes./gradlew assemblefail withproperty 'mainClassName' doesn't have a configured value. The plugin was renamed tocom.gradleup.shadow, which requires Gradle 8.x — hence the wrapper bump.group 'x',version 'x',maven { url "…" }) is deprecated as of Gradle 8.14 and scheduled for removal in Gradle 10.Staying on shadow 8.3.x rather than 9.x: shadow 9 calls
AdhocComponentWithVariants.addVariantsFromConfiguration(Provider, Action), which only exists in Gradle 9, and Gradle 9 requires Java 17+ to run — that would contradict the README's documented "Java 11 or higher".No LaunchDarkly SDK version change: all dependency constraints are open ranges within the current major with no committed lockfile, so they already resolve to the latest compatible releases —
launchdarkly-openfeature-serverprovider→ 1.1.3,launchdarkly-java-server-sdk→ 7.15.0,dev.openfeature:sdk→ 1.22.0. No deprecated LaunchDarkly/OpenFeature APIs inMain.java(javac -Xlint:deprecationis clean).Verification
Run locally against a real server-side SDK key, on Java 17:
./gradlew clean assemble run --warning-mode all— zero deprecation warnings; printsSDK successfully initialized!/The sample-feature feature flag evaluates to false.java -jar build/libs/hello-openfeature-java-server-1.0-SNAPSHOT-all.jar(the exact command CI runs) — same successful output, exit 0. The shadow jar filename is unchanged.Link to Devin session: https://app.devin.ai/sessions/163c5cf635184c5ebdbc345afa517958
Requested by: @jsonbailey
Note
Overview
Modernizes the example’s Gradle build so it runs cleanly on Gradle 8 without deprecation warnings and stays compatible with the maintained Shadow fat-jar plugin.
The wrapper moves from Gradle 7.5.1 to 8.14.5, and the Shadow plugin switches from
com.github.johnrengelman.shadow6.0.0 tocom.gradleup.shadow8.3.11 (required for Gradle 8 andmainClassinstead of the removedmainClassName).build.gradlealso adopts Gradle 8+ syntax forgroup,version, and the SonatypemavenURL, and setsapplication.mainClassinstead ofmainClassName. Test dependencies bump JUnit Jupiter from 5.8.1 to 5.14.4. Application/SDK dependency ranges and CI’sassemble/-all.jarflow are unchanged.Reviewed by Cursor Bugbot for commit 945cd04. Bugbot is set up for automated code reviews on this repo. Configure here.