/** * Return a String that describes the arguments suitable for * verbose output before a call to <code>Runtime.exec(String[])</code>. * @param args the command line to describe as an array of strings. * @return a string that describes the arguments. * @since Ant 1.5 */ public static String describeArguments(String[] args) { return describeArguments(args, 0); }
/** * Return a String that describes the arguments suitable for * verbose output before a call to <code>Runtime.exec(String[])</code>. * @return a string that describes the arguments. * @since Ant 1.5 */ public String describeArguments() { return describeArguments(this); }
/** * Return a String that describes the arguments suitable for * verbose output before a call to <code>Runtime.exec(String[])</code>. * @param line the Commandline whose arguments to describe. * @return a string that describes the arguments. * @since Ant 1.5 */ public static String describeArguments(Commandline line) { return describeArguments(line.getArguments()); }
/** * Return a String that describes the command and arguments suitable for * verbose output before a call to <code>Runtime.exec(String[])</code>. * * <p>This method assumes that the first entry in the array is the * executable to run.</p> * @param args the command line to describe as an array of strings * @return a string that describes the command and arguments. * @since Ant 1.5 */ public static String describeCommand(String[] args) { if (args == null || args.length == 0) { return ""; } StringBuilder buf = new StringBuilder("Executing \'").append(args[0]).append("\'"); if (args.length > 1) { buf.append(" with "); buf.append(describeArguments(args, 1)); } else { buf.append(DISCLAIMER); } return buf.toString(); }
/** * Logs the compilation parameters, adds the files to compile and logs the * "niceSourceList" * @param cmd the command line */ protected void logAndAddFilesToCompile(final Commandline cmd) { attributes.log("Compilation " + cmd.describeArguments(), Project.MSG_VERBOSE); attributes.log(String.format("%s to be compiled:", compileList.length == 1 ? "File" : "Files"), Project.MSG_VERBOSE); attributes.log(Stream.of(compileList).map(File::getAbsolutePath) .peek(arg -> cmd.createArgument().setValue(arg)) .map(arg -> String.format(" %s%n", arg)) .collect(Collectors.joining("")), Project.MSG_VERBOSE); }
/** * Logs the compilation parameters, adds the files to compile and logs the * "niceSourceList" * @param cmd the command line to add parameters to. */ protected void logAndAddFilesToCompile(Commandline cmd) { log("Compilation " + cmd.describeArguments(), Project.MSG_VERBOSE); String[] c = getClasses(); StringBuilder message = new StringBuilder("Class"); if (c.length > 1) { message.append("es"); } message.append(String.format(" to be compiled:%n")); for (String element : c) { cmd.createArgument().setValue(element); message.append(String.format(" %s%n", element)); } log(message.toString(), Project.MSG_VERBOSE); }
/** * Logs the compilation parameters, adds the files to compile and logs the * "niceSourceList" * @param cmd the commandline args */ protected void logAndAddFilesToCompile(Commandline cmd) { Vector<String> compileList = attributes.getCompileList(); attributes.log("Compilation " + cmd.describeArguments(), Project.MSG_VERBOSE); String niceSourceList = (compileList.size() == 1 ? "File" : "Files") + " to be compiled:" + compileList.stream().peek(arg -> cmd.createArgument().setValue(arg)) .collect(Collectors.joining(" ")); attributes.log(niceSourceList, Project.MSG_VERBOSE); }
protected void logAndAddFilesToCompile(Commandline cmd) { attributes.log("Compilation " + cmd.describeArguments(), Project.MSG_VERBOSE); StringBuilder niceSourceList = new StringBuilder("File"); if (compileList.length != 1) { niceSourceList.append("s"); } niceSourceList.append(" to be compiled:"); niceSourceList.append(lSep); StringBuilder tempbuilder = new StringBuilder(); for (File aCompileList : compileList) { String arg = aCompileList.getAbsolutePath(); // cmd.createArgument().setValue(arg); --> we don't need compile list withing cmd arguments tempbuilder.append(" ").append(arg).append(lSep); niceSourceList.append(tempbuilder); tempbuilder.setLength(0); } attributes.log(niceSourceList.toString(), Project.MSG_VERBOSE); } }
protected void logAndAddFilesToCompile(Commandline cmd) { attributes.log("Compilation " + cmd.describeArguments(), Project.MSG_VERBOSE); StringBuilder niceSourceList = new StringBuilder("File"); if (compileList.length != 1) { niceSourceList.append("s"); } niceSourceList.append(" to be compiled:"); niceSourceList.append(lSep); StringBuilder tempbuilder = new StringBuilder(); for (File aCompileList : compileList) { String arg = aCompileList.getAbsolutePath(); // cmd.createArgument().setValue(arg); --> we don't need compile list withing cmd arguments tempbuilder.append(" ").append(arg).append(lSep); niceSourceList.append(tempbuilder); tempbuilder.setLength(0); } attributes.log(niceSourceList.toString(), Project.MSG_VERBOSE); } }
this.attributes.log("Compilation " + cmd.describeArguments(), //$NON-NLS-1$ Project.MSG_VERBOSE);
this.attributes.log("Compilation " + cmd.describeArguments(), //$NON-NLS-1$ Project.MSG_VERBOSE);
this.attributes.log("Compilation " + cmd.describeArguments(), //$NON-NLS-1$ Project.MSG_VERBOSE);
this.attributes.log("Compilation " + cmd.describeArguments(), //$NON-NLS-1$ Project.MSG_VERBOSE);