-
Notifications
You must be signed in to change notification settings - Fork 874
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
Ensure Gradle new project wizard picks up latest Gradle version #7029
Ensure Gradle new project wizard picks up latest Gradle version #7029
Conversation
@lkishalmi this should also mean the JDK 21 APIs is not an issue with or without tooling upgrade - |
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.
Just a small something, let's fix the offline mode instead of removing it.
@@ -488,7 +488,7 @@ public Set<FileObject> execute() { | |||
args.add("--gradle-version"); //NOI18N | |||
args.add(version); | |||
} | |||
pconn.newBuild().withArguments("--offline").forTasks(args.toArray(new String[0])).run(); //NOI18N | |||
pconn.newBuild().forTasks(args.toArray(new String[0])).run(); //NOI18N |
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.
Probably it would be better to honor GradleSettins.isOffline()
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.
@lkishalmi OK, I've made both the init and wrapper tasks only add --offline
if the global option is set. Please re-review.
Of course, the Tooling API isn't offline itself, and I'm not sure if it has a configuration option to fail rather than download things?
tested the dev build and it used 8.6 without warning -> great! when I cut the network it created a 8.4 project as expected, but it worked too which is good -> still compatible with German trains |
…where intended. Trigger project load after wrapper is configured. Only add --offline flag to init and wrapper tasks if global Offline option set.
57a3a31
to
362690d
Compare
Actually, that's slightly annoying! If you cut the network and configure offline in Gradle options, it should still give you 8.6 if you have that cached locally. That's actually why it was working for me before this fix. Without the |
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.
Looks good now! Thank you!
As of the offline does not pick up the latest cached Gradle version.
That's for another day,
i mean, I am glad that it is working offline at all tbh. |
Just to be clear, if you set the offline Gradle option while having no internet connection this works fine. So I don't think there's anything to worry about there at all, and if there is it's probably for the Gradle project to consider! 😄 Right, thanks both, merging this and the rest of the pending PRs. All being well, rc3 tomorrow! |
Ensure Gradle new project wizard picks up latest Gradle version for wrapper where intended.
This moves the triggering of project load until after the wrapper is configured. It also removes the
--offline
flag from wrapper initialization, which doesn't make a lot of sense, and might be why people were still seeing 8.4 rather than 8.5 or 8.6.With this change, a new application or library project should be configured (at present) to use Gradle 8.6 and not show any JDK 21 warnings when created, even while using Gradle Tooling API 8.4.
This fix or similar should go in to NB21 whether or not the Tooling API is upgraded to 8.6 #6926 Triggering a dev build so the behaviour can be verified to work correctly before Tooling API upgrade.