当前位置: 首页>>代码示例>>Java>>正文


Java Commandline.size方法代码示例

本文整理汇总了Java中org.apache.tools.ant.types.Commandline.size方法的典型用法代码示例。如果您正苦于以下问题:Java Commandline.size方法的具体用法?Java Commandline.size怎么用?Java Commandline.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.types.Commandline的用法示例。


在下文中一共展示了Commandline.size方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
 * Performs a compile using the Javac externally.
 * @return true if the compilation succeeded
 * @throws BuildException on error
 */
@Override
public boolean execute() throws BuildException {
    attributes.log("Using external javac compiler", Project.MSG_VERBOSE);

    Commandline cmd = new Commandline();
    cmd.setExecutable(getJavac().getJavacExecutable());
    if (!assumeJava11() && !assumeJava12()) {
        setupModernJavacCommandlineSwitches(cmd);
    } else {
        setupJavacCommandlineSwitches(cmd, true);
    }
    int firstFileName = assumeJava11() ? -1 : cmd.size();
    logAndAddFilesToCompile(cmd);
    //On VMS platform, we need to create a special java options file
    //containing the arguments and classpath for the javac command.
    //The special file is supported by the "-V" switch on the VMS JVM.
    if (Os.isFamily("openvms")) {
        return execOnVMS(cmd, firstFileName);
    }
    return
            executeExternalCompile(cmd.getCommandline(), firstFileName,
                    true)
            == 0;
}
 
开发者ID:apache,项目名称:ant,代码行数:30,代码来源:JavacExternal.java

示例2: compile

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
 * Perform the compilation.
 */
private void compile() {
  if (compileList.length > 0) {
    log("Compiling " + compileList.length + " source file"
        + (compileList.length == 1 ? "" : "s")
        + (destDir != null ? " to " + destDir : ""));

    if (listFiles) {
      for (int i = 0; i < compileList.length; i++) {
        String filename = compileList[i].getAbsolutePath();
        log(filename);
      }
    }

    // Set up the command line.
    Commandline cmd = new Commandline();
    setupKawaCommandline(cmd);
    int firstFileName = cmd.size();
    logAndAddFilesToCompile(cmd);

    // Do the compilation
    int rc = executeExternalCompile(cmd.getCommandline(),
                                    firstFileName, true);

    if (rc != 0) {            // Failure
      taskSuccess = false;
      if (errorProperty != null) {
        getProject().setNewProperty(errorProperty, "true");
      }
      if (failOnError) {
        throw new BuildException(FAIL_MSG, getLocation());
      } else {
        log(FAIL_MSG, Project.MSG_ERR);
      }
    }
  }
}
 
开发者ID:spurious,项目名称:kawa-mirror,代码行数:40,代码来源:Kawac.java

示例3: forkeExecute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
public boolean forkeExecute() throws Exception {
          Commandline cmd = new Commandline();
   F3AntTask task = (F3AntTask)getJavac();
          String executable = getJavac().getExecutable();
          if (executable != null) {
              cmd.setExecutable(executable);
              if (((F3AntTask) getJavac()).compilerClassPath != null) {
                  getJavac().log("Ignoring attribute compilerclasspath, because executable is set.", Project.MSG_WARN);
              }
          } else {
              cmd.setExecutable(JavaEnvUtils.getJdkExecutable("java"));
              if (memoryInitialSize != null) {
                  cmd.createArgument().setValue("-Xms" + memoryInitialSize);
                  memoryInitialSize = null; // don't include it in setupJavacCommandlineSwitches()
              }
              if (memoryMaximumSize != null) {
                  cmd.createArgument().setValue("-Xmx" + memoryMaximumSize);
                  memoryMaximumSize = null; // don't include it in setupJavacCommandlineSwitches()
              }
if (task.jdwpPort != 0) {
                  cmd.createArgument().setValue("-Xrunjdwp:transport=dt_socket,address=" + task.jdwpPort+",server=y,suspend=y");
}
if (task.enableAssertions) {
                  cmd.createArgument().setValue("-ea");
}
              String cp = "-Xbootclasspath/p:" +
                      ((F3AntTask) getJavac()).compilerClassPath.toString();
              cmd.createArgument().setValue(cp);
              cmd.createArgument().setValue(F3_ENTRY_POINT);
          }
          String profile = ((F3AntTask) getJavac()).profile;
          if (profile != null) {
              cmd.createArgument().setLine("-profile " + profile);
          }
          setupJavacCommandlineSwitches(cmd, true);
          int firstFileName = cmd.size();
          logAndAddFilesToCompile(cmd);
          return executeExternalCompile(cmd.getCommandline(), firstFileName, true) == 0;
      }
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:40,代码来源:F3AntTask.java

示例4: execute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
 * Performs a compile using the sj compiler from Symantec.
 * @return true if the compilation succeeded
 * @throws BuildException on error
 */
@Override
public boolean execute() throws BuildException {
    attributes.log("Using symantec java compiler", Project.MSG_VERBOSE);

    Commandline cmd = setupJavacCommand();
    String exec = getJavac().getExecutable();
    cmd.setExecutable(exec == null ? "sj" : exec);

    int firstFileName = cmd.size() - compileList.length;

    return
        executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
}
 
开发者ID:apache,项目名称:ant,代码行数:19,代码来源:Sj.java

示例5: execute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
/**
 * Performs a compile using the gcj compiler.
 * @return true if the compilation succeeded
 * @throws BuildException on error
 */
@Override
public boolean execute() throws BuildException {
    attributes.log("Using gcj compiler", Project.MSG_VERBOSE);
    Commandline cmd = setupGCJCommand();

    int firstFileName = cmd.size();
    logAndAddFilesToCompile(cmd);

    return
        executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
}
 
开发者ID:apache,项目名称:ant,代码行数:17,代码来源:Gcj.java

示例6: execute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
public boolean execute() throws BuildException {
  attributes.log("Using DominoJ compiler", Project.MSG_INFO);
  Commandline cmd = setupJavacCommand();
  String exec = getJavac().getExecutable();
  cmd.setExecutable(exec == null ? "dominojc" : exec);
  int firstFileName = cmd.size() - compileList.length;

  return executeExternalCompile(cmd.getCommandline(), firstFileName)==0;
}
 
开发者ID:csg-tokyo,项目名称:dominoj,代码行数:10,代码来源:DominoJAdapter.java

示例7: execute

import org.apache.tools.ant.types.Commandline; //导入方法依赖的package包/类
@Override
public boolean execute() throws BuildException {
  if (getJavac().isForkedJavac()) {
    attributes.log("Using external Error Prone compiler", Project.MSG_VERBOSE);
    Commandline cmd = new Commandline();
    cmd.setExecutable(JavaEnvUtils.getJdkExecutable("java"));
    if (memoryStackSize != null) {
      cmd.createArgument().setValue("-Xss" + memoryStackSize);
    }
    String memoryParameterPrefix = "-X";
    if (memoryInitialSize != null) {
      cmd.createArgument().setValue(memoryParameterPrefix + "ms" + this.memoryInitialSize);
      // Prevent setupModernJavacCommandlineSwitches() from doing it also
      memoryInitialSize = null;
    }
    if (memoryMaximumSize != null) {
      cmd.createArgument().setValue(memoryParameterPrefix + "mx" + this.memoryMaximumSize);
      // Prevent setupModernJavacCommandlineSwitches() from doing it also
      memoryMaximumSize = null;
    }
    for (Argument arg : jvmArgs) {
      for (String part : arg.getParts()) {
        cmd.createArgument().setValue(part);
      }
    }

    Path bootclasspath = new Path(getProject());
    addResourceSource(
        bootclasspath, "com/google/errorprone/ErrorProneExternalCompilerAdapter.class");
    cmd.createArgument().setValue("-Xbootclasspath/p:" + bootclasspath);

    if (classpath != null) {
      cmd.createArgument().setValue("-classpath");
      cmd.createArgument().setPath(classpath);
    }

    cmd.createArgument().setValue(ErrorProneCompiler.class.getName());
    // This is the first argument that may be spilled to a file.
    // The ant API describes it as the first argument which is a
    // file, but in fact only uses it for spilling.  Putting the
    // break here allows long classpath arguments to be handled.
    int firstSpillableArgument = cmd.size();
    setupModernJavacCommandlineSwitches(cmd);
    logAndAddFilesToCompile(cmd);
    return executeExternalCompile(cmd.getCommandline(), firstSpillableArgument, true) == 0;
  } else {
    attributes.log(
        "You must set fork=\"yes\" to use the external Error Prone compiler", Project.MSG_ERR);
    return false;
  }
}
 
开发者ID:google,项目名称:error-prone,代码行数:52,代码来源:ErrorProneExternalCompilerAdapter.java


注:本文中的org.apache.tools.ant.types.Commandline.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。