All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.gradleplugins.runnerkit.GradleUserHomeLookup Maven / Gradle / Ivy

There is a newer version: 0.0.148
Show newest version
package dev.gradleplugins.runnerkit;

import java.io.File;

final class GradleUserHomeLookup {
    public static final String DEFAULT_GRADLE_USER_HOME = System.getProperty("user.home") + "/.gradle";
    public static final String GRADLE_USER_HOME_PROPERTY_KEY = "gradle.user.home";
    public static final String GRADLE_USER_HOME_ENV_KEY = "GRADLE_USER_HOME";

    public static File gradleUserHome() {
        String gradleUserHome;
        if ((gradleUserHome = System.getProperty(GRADLE_USER_HOME_PROPERTY_KEY)) != null) {
            return new File(gradleUserHome);
        }
        if ((gradleUserHome = System.getenv(GRADLE_USER_HOME_ENV_KEY)) != null) {
            return new File(gradleUserHome);
        }
        return new File(DEFAULT_GRADLE_USER_HOME);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy