Skip to content
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

Add configuration option to use CACHED_ONLY strategy for downloading published Gradle versions #998

Closed
wants to merge 3 commits into from

Conversation

donat
Copy link
Contributor

@donat donat commented Jun 11, 2020

No description provided.

…tegy specified

Also, the current version is returned if the cache file is not present
@donat donat changed the title Donat/cached gradle versions Add configuration option to use CACHE_ONLY strategy for downloading published Gradle versions Jun 11, 2020
Comment on lines +69 to +70
publishedVersions.versions.size() == 1
publishedVersions.versions[0].version == GradleVersion.current().getVersion()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -70,6 +71,16 @@ protected void canceling() {
Thread.currentThread().interrupt();
}

private LookupStrategy getLookupStrategy() {
String strategyName = InstanceScope.INSTANCE.getNode(CorePlugin.PLUGIN_ID).get("publishedgradleversions.lookupstrategy", LookupStrategy.REMOTE_IF_NOT_CACHED.name());
Copy link

@DPUkyle DPUkyle Jun 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So to avoid remote interaction, I'll need to set publishedgradleversions.lookupstrategy=CACHED_ONLY somewhere, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the idea, yes. Right now there's no UI, but you can use tools like oomph to configure IDE preferences. Without that, you'll need to figure out in which folder does Eclipse (and VSCode Java for that matter) puts the workspace. you need to add the org.eclipse.buildship.core.publishedgradleversions.lookupstrategy=CACHED_ONLY entry to the ${workspace_loc}/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.buildship.core.prefs file.

@donat donat changed the title Add configuration option to use CACHE_ONLY strategy for downloading published Gradle versions Add configuration option to use CACHED_ONLY strategy for downloading published Gradle versions Jun 11, 2020
@donat
Copy link
Contributor Author

donat commented Jul 16, 2020

@DPUkyle Have tried out these changes. Is this useful in any way or should we look for an alternative?

@DPUkyle
Copy link

DPUkyle commented Jul 17, 2020

Hi Donat. I'm trying to work with my Microsoft colleague @testforstephen who works on VS Code. I'm hoping he knows how to make an eclipse build with this change in buildship (I'm an IJ guy, don't kill me :) ).

@testforstephen
Copy link

@DPUkyle @donat i will find some time in this week to have a play, will update it later.

@donat
Copy link
Contributor Author

donat commented Feb 4, 2021

Closing due to inactivity. Let me know if we should reopen this issue.

@donat donat closed this Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants