org.apache.tools.ant.taskdefs.Execute.getCommandline()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(114)

本文整理了Java中org.apache.tools.ant.taskdefs.Execute.getCommandline()方法的一些代码示例,展示了Execute.getCommandline()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execute.getCommandline()方法的具体详情如下:
包路径:org.apache.tools.ant.taskdefs.Execute
类名称:Execute
方法名:getCommandline

Execute.getCommandline介绍

[英]Returns the commandline used to create a subprocess.
[中]返回用于创建子流程的命令行。

代码示例

代码示例来源:origin: org.apache.ant/ant

private String executeToString(Execute execute) {
  String cmdLine = Commandline.describeCommand(execute
      .getCommandline());
  StringBuilder buf = removeCvsPassword(cmdLine);
  String[] variableArray = execute.getEnvironment();
  if (variableArray != null) {
    buf.append(Arrays.stream(variableArray).map(variable -> String.format("%n\t%s", variable))
        .collect(Collectors.joining("", String.format("%n%nenvironment:%n"), "")));
  }
  return buf.toString();
}

代码示例来源:origin: org.apache.ant/ant

throw new BuildException("%s doesn't exist.", workingDirectory);
final Process process = launch(project, getCommandline(),
                getEnvironment(), workingDirectory,
                useVMLauncher);

代码示例来源:origin: org.apache.ant/ant

throw new BuildException("%s doesn't exist.", workingDirectory);
final Process process = launch(project, getCommandline(),
                getEnvironment(), workingDirectory,
                useVMLauncher);

代码示例来源:origin: org.jvnet.hudson.plugins/cvs

private String executeToString(Execute execute) {
  StringBuffer stringBuffer =
    new StringBuffer(Commandline.describeCommand(execute
      .getCommandline()));
  String newLine = StringUtils.LINE_SEP;
  String[] variableArray = execute.getEnvironment();
  if (variableArray != null) {
    stringBuffer.append(newLine);
    stringBuffer.append(newLine);
    stringBuffer.append("environment:");
    stringBuffer.append(newLine);
    for (int z = 0; z < variableArray.length; z++) {
      stringBuffer.append(newLine);
      stringBuffer.append("\t");
      stringBuffer.append(variableArray[z]);
    }
  }
  return stringBuffer.toString();
}

代码示例来源:origin: org.hudsonci.plugins/cvs

private String executeToString(Execute execute) {
  StringBuffer stringBuffer =
    new StringBuffer(Commandline.describeCommand(execute
      .getCommandline()));
  String newLine = StringUtils.LINE_SEP;
  String[] variableArray = execute.getEnvironment();
  if (variableArray != null) {
    stringBuffer.append(newLine);
    stringBuffer.append(newLine);
    stringBuffer.append("environment:");
    stringBuffer.append(newLine);
    for (int z = 0; z < variableArray.length; z++) {
      stringBuffer.append(newLine);
      stringBuffer.append("\t");
      stringBuffer.append(variableArray[z]);
    }
  }
  return stringBuffer.toString();
}

相关文章