Skip to content

Optionally disable loading gradle from gradle wrapper#917

Merged
fbricon merged 1 commit into
redhat-developer:masterfrom
snjeza:issue-875
May 14, 2019
Merged

Optionally disable loading gradle from gradle wrapper#917
fbricon merged 1 commit into
redhat-developer:masterfrom
snjeza:issue-875

Conversation

@snjeza
Copy link
Copy Markdown
Collaborator

@snjeza snjeza commented May 8, 2019

Fixes #875
Requires eclipse-jdtls/eclipse.jdt.ls#1026

I have added two new properties: java.import.gradle.wrapper.enabled and java.import.gradle.version

Importing a gradle project works in the following way:

  • if there is gradlew and java.gradle.wrapper.enabled=true (default), the gradle wrapper distribution will be used
  • in the case that gradlew doesn't exist or java.import.gradle.wrapper.enabled=false, Java LS checks for the existence of the java.import.gradle.version property. If it exists, Java LS will use the required version
  • if there's no java.import.gradle.version property, Java LS checks for existence of the GRADLE_HOME env variable or the GRADLE_HOME system property. If it exists, Java LS will use the GRADLE_HOME local installation,
  • else Java LS will use default buildship version (5.0).

Signed-off-by: Snjezana Peco snjezana.peco@redhat.com

Comment thread package.json Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I want to keep java.import.gradle.enabled

Comment thread package.json Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

java.import.gradle.wrapper.enabled

Comment thread package.json Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

java.import.gradle.version

@fbricon
Copy link
Copy Markdown
Collaborator

fbricon commented May 9, 2019

I think it makes more sense to check

  • use wrapper if enabled and present
  • else use gradle version if it is set and valid
  • else fall back to gradle home
  • else fall back to buildship default version

@snjeza
Copy link
Copy Markdown
Collaborator Author

snjeza commented May 9, 2019

@fbricon I have updated the PR.

Comment thread package.json Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Gradle version, used if the gradle wrapper is missing or disabled.

Comment thread README.md Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Gradle version, used if the gradle wrapper is missing or disabled.

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
@snjeza
Copy link
Copy Markdown
Collaborator Author

snjeza commented May 14, 2019

@fbricon I have updated the PR.

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.

Optionally disable loading gradle from gradle wrapper (request)

2 participants