/** * @return Returns whether reload is enabled for the environment */ public boolean isReloadEnabled() { final boolean reloadOverride = Boolean.getBoolean(RELOAD_ENABLED); getReloadLocation(); final boolean reloadLocationSpecified = hasLocation(reloadLocation); return this == DEVELOPMENT && reloadLocationSpecified || reloadOverride && reloadLocationSpecified; }
/** * @return Whether a reload location is specified */ public boolean hasReloadLocation() { getReloadLocation(); return hasLocation(reloadLocation); }
/** * @return Obtains the location to reload resources from */ public String getReloadLocation() { if(this.reloadLocation != null) { return this.reloadLocation; } String location = getReloadLocationInternal(); if (hasLocation(location)) { reloadLocation = location; return location; } return "."; // default to the current directory }
private String getReloadLocationInternal() { String location = System.getProperty(RELOAD_LOCATION); if(!hasLocation(location)) { location = System.getProperty(BuildSettings.APP_BASE_DIR); } if(!hasLocation(location)) { File current = new File(".", "grails-app"); if(current.exists()) { location = current.getParentFile().getAbsolutePath(); } else { current = new File(".", "settings.gradle"); if(current.exists()) { // multi-project build location = IOUtils.findApplicationDirectory(); } } } return location; }