/** * Add a command-line argument. * * @return created argument. */ public Commandline.Argument createArg() { return getCommandLine().createArgument(); }
/** * add a single argument to the argument list, if the value isn't null * @param cmd the command line * @param argument The argument */ protected void addArg(CommandlineJava cmd, String argument) { if (argument != null && !argument.isEmpty()) { cmd.createArgument().setValue(argument); } }
/** * add an argument tuple to the argument list, if the value isn't null * @param cmd the command line * @param argument The argument * @param value the parameter */ protected void addArg(CommandlineJava cmd, String argument, String value) { if (value != null) { cmd.createArgument().setValue(argument); cmd.createArgument().setValue(value); } }
/** * add an argument tuple to the arg list, if the file parameter isn't null * @param cmd the command line * @param argument The argument * @param file the parameter */ protected void addArg(CommandlineJava cmd, String argument, File file) { if (file != null) { cmd.createArgument().setValue(argument); cmd.createArgument().setFile(file); } }
/** * Logs the compilation parameters, adds the files to compile and logs the * "niceSourceList" * @param jspc the compiler task for logging * @param compileList the list of files to compile * @param cmd the command line used */ protected void logAndAddFilesToCompile(JspC jspc, Vector<String> compileList, CommandlineJava cmd) { jspc.log("Compilation " + cmd.describeJavaCommand(), Project.MSG_VERBOSE); String niceSourceList = compileList.stream() .peek(arg -> cmd.createArgument().setValue(arg)) .map(arg -> String.format(" %s%n", arg)) .collect(Collectors.joining("")); jspc.log(String.format("File%s to be compiled:%n%s", compileList.size() == 1 ? "" : "s", niceSourceList), Project.MSG_VERBOSE); }
/** * Deprecated: use nested arg instead. * Set the command line arguments for the class. * * @param s arguments. * * @ant.attribute ignore="true" */ public void setArgs(String s) { log("The args attribute is deprecated. Please use nested arg elements.", Project.MSG_WARN); getCommandLine().createArgument().setLine(s); }
optionalAttrs.forEach((name, value) -> cmdl.createArgument() .setValue("-" + name + ":" + value)); throw new BuildException("Outputdir not a directory."); cmdl.createArgument().setValue("-OUTPUT_DIRECTORY:" + outputDirectory.getAbsolutePath()); return; cmdl.createArgument().setValue(targetFile.getAbsolutePath());
cmd.createArgument().setValue("@" + fileName);
optionalAttrs.forEach((name, value) -> cmdl.createArgument() .setValue("-" + name + ":" + value.toString())); cmdl.createArgument().setValue("-OUTPUT_DIRECTORY:" + getDefaultOutputDirectory()); cmdl.createArgument().setValue("-OUTPUT_DIRECTORY:" + outputDirectory.getAbsolutePath() .replace('\\', '/')); cmdl.createArgument().setValue("-" + OUTPUT_FILE + ":" + outputFile.replace('\\', '/')); cmdl.createArgument().setValue(targetFile.getAbsolutePath());
/** * Executes the given classname with the given arguments as if it * were a command line application. * * @param classname the name of the class to run. * @param args arguments for the class. * @throws BuildException in case of IOException in the execution. */ protected void run(String classname, Vector<String> args) throws BuildException { CommandlineJava cmdj = new CommandlineJava(); cmdj.setClassname(classname); args.forEach(arg -> cmdj.createArgument().setValue(arg)); run(cmdj); }
optionalAttrs.forEach((name, value) -> cmdl.createArgument() .setValue("-" + name + ":" + value.toString())); cmdl.createArgument() .setValue("-" + OUTPUT_FILE + ":" + outputFile.replace('\\', '/')); cmdl.createArgument().setValue(targetFile.getAbsolutePath());
cmd.createArgument().setValue("@" + fileName);
cmdl.setClassname(javaCommand.getExecutable()); for (String arg : javaCommand.getArguments()) { cmdl.createArgument().setValue(arg);
private void appendXmlResultPage(CommandlineJava cmd) { if (resultsXMLPage != null) { String resultsHTMLPagePath = new File(resultsDir, resultsXMLPage).getAbsolutePath(); cmd.createArgument().setValue("-xml"); cmd.createArgument().setValue(resultsHTMLPagePath); } }
private void appendSuiteFilter(CommandlineJava cmd) { if (suiteFilter != null) { cmd.createArgument().setValue("-suiteFilter"); cmd.createArgument().setValue(suiteFilter); } }
private void appendHtmlResultPage(CommandlineJava cmd) { if (resultsHTMLPage != null) { String resultsHTMLPagePath = new File(resultsDir, resultsHTMLPage).getAbsolutePath(); cmd.createArgument().setValue("-html"); cmd.createArgument().setValue(resultsHTMLPagePath); } }
private void appendSuiteFilter(CommandlineJava cmd) { if (suiteFilter != null) { cmd.createArgument().setValue("-suiteFilter"); cmd.createArgument().setValue(suiteFilter); } }
private void appendHtmlResultPage(CommandlineJava cmd) { if (resultsHTMLPage != null) { String resultsHTMLPagePath = new File(resultsDir, resultsHTMLPage).getAbsolutePath(); cmd.createArgument().setValue("-html"); cmd.createArgument().setValue(resultsHTMLPagePath); } }
private void appendXmlResultPage(CommandlineJava cmd) { if (resultsXMLPage != null) { String resultsHTMLPagePath = new File(resultsDir, resultsXMLPage).getAbsolutePath(); cmd.createArgument().setValue("-xml"); cmd.createArgument().setValue(resultsHTMLPagePath); } }
private void checkIncludeSummary(final CommandlineJava cmd) { if (summary) { String prefix = ""; if (equalsWithOutAndErr(summaryValue)) { prefix = "OutErr"; } cmd.createArgument() .setValue(Constants.FORMATTER + "org.apache.tools.ant.taskdefs.optional.junit." + prefix + "SummaryJUnitResultFormatter"); } }