-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update Gradle to 8.0 #5666
Update Gradle to 8.0 #5666
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
@reta When are you going to write a GHA and publish it on the marketplace to upgrade gradle to the latest? :) Or should dependabot do it? |
Gradle Check (Jenkins) Run Completed with:
|
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
777bf6b
to
50a1994
Compare
build.gradle
Outdated
@@ -413,6 +427,13 @@ gradle.projectsEvaluated { | |||
} | |||
|
|||
project.tasks.withType(Test) { task -> | |||
// This is so hacky: now, by default, test tasks uses JUnit framework and always includes 'junit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about how this comment relates to this code here. The comment has been added but no code has changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks @andrross , it was initially applied in 2 places, removing that
50a1994
to
ca4e44c
Compare
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
ca4e44c
to
b1d149d
Compare
Gradle Check (Jenkins) Run Completed with:
|
// jar1: /home/ubuntu/.gradle/caches/modules-2/files-2.1/junit/junit/4.13.2/8ac9e16d933b6fb43bc7f576336b8f4d7eb5ba12/junit-4.13.2.jar | ||
// jar2: /home/ubuntu/.gradle/wrapper/dists/gradle-8.0-rc-1-all/2p8rgxxewg8l61n1p3vrzr9s8/gradle-8.0-rc-1/lib/junit-4.13.2.jar | ||
// | ||
task.getTestFrameworkProperty().convention(getProviderFactory().provider(() -> new JUnitTestFramework(task, task.getFilter(), false))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the problem here (gradle includes JUnit by default resulting in a duplicate JAR on the classpath). But how does code solve it? I obviously don't know gradle very well...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But how does code solve it?
You see the last option in the JUnitTestFramework
constructor - false
- it literally says "do not include the JUnit dependencies" [1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Thanks! One of Nick's cryptic booleans :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was possible to control this behaviour with a property - but not anymore with Gradle 8
.invokeExact((BuildServiceProvider<TestClustersThrottle, ?>) throttleProvider); | ||
} | ||
} catch (Throwable ex) { | ||
throw new IllegalStateException("Unable to find suitable BuildServiceRegistryInternal::getResourceLock", ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy/paste error on "getResourceLock" in exception message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh.... thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
) { | ||
try { | ||
try { | ||
// The forService(Provider) is used by Gradle pre-8.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this code ever need to run against Gradle pre-8.0 after this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will run every time the build will be performed by pre - Gradle 8, best examples - plugins. OpenSearch plugins support is extensively using Gradle plugins, if the plugin uses fe Gradle 7.6 (which at this moment is applicable to any other plugin outside core), the build will fail right away.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, thanks!
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
b1d149d
to
5f65b63
Compare
@reta Can we backport this to 2.x? |
Gradle Check (Jenkins) Run Completed with:
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-5666-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 7914c0499048793b55aa7d4d2c1156293e7998be
# Push it to GitHub
git push --set-upstream origin backport/backport-5666-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
Signed-off-by: Andriy Redko <andriy.redko@aiven.io> (cherry picked from commit 7914c04) Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Andriy Redko andriy.redko@aiven.io
Description
The first Gradle 8.0 is out, starting the draft pull request to understand required efforts for migration.
Issues Resolved
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.