Skip to content
Browse files

Gradle home no longer falls back to the GRADLE_HOME env. variable. Th…

…is can be confusing and was little help while developing the plugin.
  • Loading branch information...
1 parent f04a992 commit f0bc53334aad37372964bd7003e223cbd10d7019 @kelemen committed
Showing with 4 additions and 12 deletions.
  1. +4 −12 src/org/netbeans/gradle/project/properties/GlobalGradleSettings.java
View
16 src/org/netbeans/gradle/project/properties/GlobalGradleSettings.java
@@ -32,7 +32,7 @@
private static final StringBasedProperty<Boolean> OMIT_INIT_SCRIPT;
static {
- GRADLE_HOME = new GlobalProperty<FileObject>("gradle-home", GradleHomeConverter.INSTANCE);
+ GRADLE_HOME = new GlobalProperty<FileObject>("gradle-home", FileObjectConverter.INSTANCE);
GRADLE_JVM_ARGS = new GlobalProperty<List<String>>("gradle-jvm-args", StringToStringListConverter.INSTANCE);
GRADLE_JDK = new GlobalProperty<JavaPlatform>("gradle-jdk", JavaPlaformConverter.INSTANCE);
SKIP_TESTS = new GlobalProperty<Boolean>("skip-tests", new BooleanConverter(false));
@@ -248,23 +248,15 @@ public String toString(JavaPlatform value) {
}
}
- private enum GradleHomeConverter implements ValueConverter<FileObject> {
+ private enum FileObjectConverter implements ValueConverter<FileObject> {
INSTANCE;
@Override
public FileObject toValue(String strValue) {
- String gradleHome;
- if (strValue == null || strValue.isEmpty()) {
- gradleHome = System.getenv("GRADLE_HOME");
- gradleHome = gradleHome != null ? gradleHome.trim() : "";
- }
- else {
- gradleHome = strValue;
- }
- if (gradleHome.isEmpty()) {
+ String gradleHome = strValue != null ? strValue.trim() : "";
+ if (gradleHome.isEmpty()) {
return null;
}
-
return FileUtil.toFileObject(FileUtil.normalizeFile(new File(gradleHome)));
}

0 comments on commit f0bc533

Please sign in to comment.
Something went wrong with that request. Please try again.