/** * The application configuration * @return The application configuration instance. Guaranteed to be present. */ static public Config config() { return ContextHolder.get().config(); }
/** * The application configuration * @return The application configuration instance. Guaranteed to be present. */ static public Config config() { return ContextHolder.get().config(); }
static public Path find(Context context, List<Path> paths, Path command) throws BlazeException { // first, check if the command is already an absolute file if (isExecutableFile(command)) { return command; } // second, check each path to see if the command exists for (Path path : paths) { List<String> commandExtensions = ConfigHelper.commandExtensions(context.config()); for (String ext : commandExtensions) { // cmd -> cmd.exe String commandWithExt = command.toString() + ext; //File commandFile = new File(path.toFile(), commandWithExt); Path exeFile = path.resolve(commandWithExt); log.trace("Trying file: {}", exeFile); if (Files.exists(exeFile)) { if (Files.isRegularFile(exeFile) && Files.isExecutable(exeFile)) { return exeFile; } else { log.warn("Command '" + exeFile + "' found but it isn't executable! (continuing search...)"); } } } } return null; }
static public Path find(Context context, List<Path> paths, Path command) throws BlazeException { // first, check if the command is already an absolute file if (isExecutableFile(command)) { return command; } // second, check each path to see if the command exists for (Path path : paths) { List<String> commandExtensions = ConfigHelper.commandExtensions(context.config()); for (String ext : commandExtensions) { // cmd -> cmd.exe String commandWithExt = command.toString() + ext; //File commandFile = new File(path.toFile(), commandWithExt); Path exeFile = path.resolve(commandWithExt); log.trace("Trying file: {}", exeFile); if (Files.exists(exeFile)) { if (Files.isRegularFile(exeFile) && Files.isExecutable(exeFile)) { return exeFile; } else { log.warn("Command '" + exeFile + "' found but it isn't executable! (continuing search...)"); } } } } return null; }
public void execute(String task) throws Exception { if (task == null || task.equals("")) { task = context.config().value(Config.KEY_DEFAULT_TASK).getOr(Config.DEFAULT_TASK); } String scriptName = (context.scriptFile() != null ? context.scriptFile().toString() : ""); log.info("Executing {}:{}...", scriptName, task); Timer executeTimer = new Timer(); this.script.execute(task); log.info("Executed {}:{} in {} ms", scriptName, task, executeTimer.stop().millis()); }
public void execute(String task) throws Exception { if (task == null || task.equals("")) { task = context.config().value(Config.KEY_DEFAULT_TASK).getOr(Config.DEFAULT_TASK); } String scriptName = (context.scriptFile() != null ? context.scriptFile().toString() : ""); log.info("Executing {}:{}...", scriptName, task); Timer executeTimer = new Timer(); this.script.execute(task); log.info("Executed {}:{} in {} ms", scriptName, task, executeTimer.stop().millis()); }
if (context.config().value(Config.KEY_DEPENDENCY_CLEAN, Boolean.class).getOr(Config.DEFAULT_DEPENDENCY_CLEAN)) { log.info("Cleaning dependency cache..."); ivy.getResolutionCacheManager().clean();