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

Reopening a gradle project resets its gradle version #1041

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented May 16, 2019

Fixes redhat-developer/vscode-java#924

Signed-off-by: Snjezana Peco [email protected]

@snjeza snjeza requested review from gorkem and fbricon May 16, 2019 03:24
@snjeza
Copy link
Contributor Author

snjeza commented May 16, 2019

test this please

@snjeza
Copy link
Contributor Author

snjeza commented May 16, 2019

The issue can be reproduced in Eclipse too. I have created a workaround.

@fbricon
Copy link
Contributor

fbricon commented May 17, 2019

So I'm a bit worried that we're setting the gradleHome attribute (as found in the environment variable) to something that doesn't match the gradle version (set by java.import.gradle.version). It doesn't seem to break anything so far but it certainly doesn't feel right

@fbricon
Copy link
Contributor

fbricon commented May 17, 2019

Checked with Eclipse/Buildship, when a project uses a specific Gradle version or the wrapper, neither gradle.user.home nor java.home are set:

arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(5.1.1))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=false
show.executions.view=false

or

arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=false
show.executions.view=false

Also, it seems the current patch is losing current buildship settings informations. E.g if auto.sync was set to true initially, it's lost. I think the fix should 1st load the buildship settings if they exist, then override their values if necessary and finally save them.

@fbricon
Copy link
Contributor

fbricon commented May 23, 2019

It doesn't seem to work with buildship 3.1. With a project created in eclipse, overriding workspace default to enable autosync, the buildship core prefs looks like:

arguments=
auto.sync=true
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=false
show.executions.view=false

When importing the project in vscode, the new content becomes:

connection.project.dir=
eclipse.preferences.version=1

@fbricon
Copy link
Contributor

fbricon commented Jun 3, 2019

I still lose the buildship settings when importing the project in a clean workspace :-/

@snjeza
Copy link
Contributor Author

snjeza commented Jun 4, 2019

@fbricon I have updated the PR.

@fbricon
Copy link
Contributor

fbricon commented Jul 17, 2019

Can you please rebase?

@snjeza
Copy link
Contributor Author

snjeza commented Jul 18, 2019

@fbricon I have rebased the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reopening a gradle project resets its gradle version
2 participants