-
Notifications
You must be signed in to change notification settings - Fork 409
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
Optionally disable loading gradle from gradle wrapper #1026
Conversation
@fbricon I have updated the PR. |
if (gradleHomeFile != null) { | ||
distribution = GradleDistribution.forLocalInstallation(gradleHomeFile); | ||
if (JavaLanguageServerPlugin.getPreferencesManager() != null && JavaLanguageServerPlugin.getPreferencesManager().getPreferences().isGradleWrapperEnabled() && Files.exists(rootFolder.resolve("gradlew"))) { | ||
return DEFAULT_DISTRIBUTION; |
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.
that should be GradleDistribution.fromBuild()
@@ -185,7 +201,7 @@ private static boolean checkGradlePersistence(boolean shouldSynchronize, IProjec | |||
|
|||
@Override | |||
public boolean accept(File dir, String name) { | |||
if (name != null && name.endsWith(GradleBuildSupport.GRADLE_SUFFIX)) { | |||
if (name != null && (name.endsWith(GradleBuildSupport.GRADLE_SUFFIX) || name.equals(".settings"))) { |
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.
why?
*/ | ||
public static final String GRADLE_WRAPPER_ENABLED = "java.import.gradle.wrapper.enabled"; | ||
/** | ||
* Preference key for gradle version. |
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.
Preference key for gradle version to use when the gradle wrapper is not used.
@@ -540,6 +557,11 @@ public Preferences setJavaHome(String javaHome) { | |||
return this; | |||
} | |||
|
|||
public Preferences setGradleVersion(String gradleVersion) { | |||
this.gradleVersion = gradleVersion; |
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.
if null or blank, then assign null
Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
@fbricon I have updated the PR. |
test this please |
Two new properties are added: Importing a gradle project works in the following way:
|
Fixes redhat-developer/vscode-java#875
Requires redhat-developer/vscode-java#917
Signed-off-by: Snjezana Peco snjezana.peco@redhat.com