Skip to content

Conversation

wrprice
Copy link
Contributor

@wrprice wrprice commented Sep 10, 2025

Based on feedback on #8797, upgrade netbeans-gradle-tooling version of Gradle from 7.4 to 8.11.1. There are no expected functional changes.

The 8.11.1 version was chosen as the latest patch of the earliest version that includes API methods that overlap between those in Gradle 7/8 and what is available in Gradle 9.0.0. The strategy is to leverage javac compile-time validation on the code path closest to the current Gradle version (optimistically forward-compatible?), and use reflection only when necessary for compatibility with older versions.

Changes include:

  • Gradle wrapper JAR filename changed upstream, when unpacking the Gradle distribution zip
  • Inverted GradleInternalAdapter subclass relationship: was specialized for 7.6+, now specialized for versions earlier than 7.6
  • See comment in NbProjectInfoBuilder::detectConfigurationArtifacts for a fun javac bug
  • Changed sinceGradleOrDefault to take ExeptionCallable as the fallback argument instead of a simple Supplier, so that the exception handling and sneakyThrows behavior can work for the fallback (e.g. when the fallback uses reflection) instead of only for the affirmative path.

I updated the license files (hopefully correctly!). The previously checked-in Gradle notice file in the external dir was empty, but now it matches the NOTICE file extracted from the new distribution zip.

cc: @mbien @lkishalmi


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@mbien mbien added Gradle [ci] enable "build tools" tests ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Sep 10, 2025
@apache apache locked and limited conversation to collaborators Sep 10, 2025
@apache apache unlocked this conversation Sep 10, 2025
@wrprice
Copy link
Contributor Author

wrprice commented Sep 10, 2025

Hmm... CI failed on not extracting/finding the Gradle wrapper. I double checked my clean, local branch and ant clean followed by ant build WFM. :-(

@mbien
Copy link
Member

mbien commented Sep 10, 2025

ant clean is unfortunately sometimes missing a few things, esp for modules which customize their build heavily. We recently changed the readme to suggest git clean -Xdf for full resets which might help in situations like this.

@wrprice
Copy link
Contributor Author

wrprice commented Sep 10, 2025

That's probably why I didn't catch it locally. I had noticed that 8.x's ZIP contained multiple wrapper-related JARs and picked one, everything "worked" locally, and I moved on. On closer examination I picked the wrong one.

Fixed, build succeeds (even after git clean -Xdf), and force-pushed an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Gradle [ci] enable "build tools" tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants