Examples of CommandLineBuilder


Examples of net.sourceforge.cobertura.util.CommandLineBuilder

    public void setFileExcludes(String fileExcludes) {
        this.fileExcludes = fileExcludes;
    }

    CommandLineBuilder makeCommandLineBuilder() throws IOException {
        return new CommandLineBuilder();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

                "Do not use includes/excludes here; use fileIncludes/fileExcludes"
                        + " with Java regexs, not ant patterns");
    }
   
    public void execute() throws BuildException {
        CommandLineBuilder builder = null;
        try {
            builder = makeCommandLineBuilder();
            builder.addArg( "--source", dir );
            builder.addArg( "--dest", targetDir );
            if ( isNotBlank( selectorClass ) ) {
                builder.addArg( "--selectorClass", selectorClass );
            }
            if ( isNotBlank( logFile ) ) {
                builder.addArg( "--logFile", logFile );
            }
            if ( isNotBlank( fileIncludes ) ) {
                builder.addArg( "--includes", fileIncludes );
            }
            if ( isNotBlank( fileExcludes ) ) {
                builder.addArg( "--excludes", fileExcludes );
            }
            builder.saveArgs();
        } catch (IOException ioe) {
            getProject().log("Error creating commands file.", Project.MSG_ERR);
            throw new BuildException("Unable to create the commands file.", ioe);
        }
        getJava().createArg().setValue("--commandsfile");
        getJava().createArg().setValue(builder.getCommandLineFile());
        getJava().setOutput(new File("purrPackageInstrumenter.out"));
        getJava().setError(new File("purrPackageInstrumenter.err"));
        if (getJava().executeJava() != 0) {
            throw new BuildException(
                    "Error instrumenting tests. See messages above.");
        }
        builder.dispose();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

    public ReportTask() {
        super(Main.class.getName());
    }

    CommandLineBuilder makeCommandLineBuilder() throws IOException {
        return new CommandLineBuilder();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

    CommandLineBuilder makeCommandLineBuilder() throws IOException {
        return new CommandLineBuilder();
    }

    public void execute() throws BuildException {
        CommandLineBuilder builder = null;
        try {
            builder = makeCommandLineBuilder();
            if (dataFile != null)
                builder.addArg("--datafile", dataFile);
            if (destDir != null)
                builder.addArg("--destination", destDir.getAbsolutePath());
            if (format != null)
                builder.addArg("--format", format);
            if (encoding != null)
                builder.addArg("--encoding", encoding);
            if (srcDir != null) {
                String[] dirNames = srcDir.split(",");
                for (String x : dirNames) {
                    builder.addArg(x);
                }
            }
            createArgumentsForFilesets(builder);

            builder.saveArgs();
        } catch (IOException ioe) {
            getProject().log("Error creating commands file.", Project.MSG_ERR);
            throw new BuildException("Unable to create the commands file.", ioe);
        }

        // Execute GPL licensed code in separate virtual machine
        getJava().createArg().setValue("--commandsfile");
        getJava().createArg().setValue(builder.getCommandLineFile());
        getJava().setOutput(new File("purrPackageReporter.out"));
        getJava().setError(new File("purrPackageReporter.err"));
        transferCoberturaDataFileProperty(getJava());
        if (getJava().executeJava() != 0) {
            throw new BuildException(
                    "Error running reports. See messages above.");
        }

        builder.dispose();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

    public WriteBrowserReportTask() {
        super(Main.class.getName());
    }

    CommandLineBuilder makeCommandLineBuilder() throws IOException {
        return new CommandLineBuilder();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

    CommandLineBuilder makeCommandLineBuilder() throws IOException {
        return new CommandLineBuilder();
    }

    public void execute() throws BuildException {
        CommandLineBuilder builder = null;
        try {
            builder = makeCommandLineBuilder();
            if (destDir != null) {
                builder.addArg("--destination", destDir.getAbsolutePath());
            }
            builder.saveArgs();
        } catch (IOException ioe) {
            getProject().log("Error creating commands file.", Project.MSG_ERR);
            throw new BuildException("Unable to create the commands file.", ioe);
        }

        // Execute GPL licensed code in separate virtual machine
        getJava().createArg().setValue("--commandsfile");
        getJava().createArg().setValue(builder.getCommandLineFile());
        getJava().setOutput(new File("purrPackageReporter.out"));
        getJava().setError(new File("purrPackageReporter.err"));
        if (getJava().executeJava() != 0) {
            throw new BuildException(
                    "Error running reports. See messages above.");
        }

        builder.dispose();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

     * @throws IOException
     */
    public String getCommandsFile()
        throws IOException
    {
        CommandLineBuilder builder = new CommandLineBuilder();
        Iterator it = this.args.iterator();
        while ( it.hasNext() )
        {
            builder.addArg( it.next().toString() );
        }
        builder.saveArgs();
        return builder.getCommandLineFile();
    }
View Full Code Here

Examples of net.sourceforge.cobertura.util.CommandLineBuilder

  public CoberturaReportTask() {
    super("net.sourceforge.cobertura.reporting.Main");
  }
 
  public void execute() throws BuildException {
    CommandLineBuilder builder = null;
    try {
      builder = new CommandLineBuilder();
      if (dataFile != null)
        builder.addArg("--datafile", dataFile);
      if (destDir != null)
        builder.addArg("--destination", destDir.getAbsolutePath());
      if (format != null)
        builder.addArg("--format", format);
         if (encoding != null)
            builder.addArg("--encoding", encoding);
      if (srcDir != null)
        builder.addArg(srcDir);
      createArgumentsForResourceCollections(builder);

      builder.saveArgs();
    } catch (IOException ioe) {
      getProject().log("Error creating commands file.", Project.MSG_ERR);
      throw new MoxieException("Unable to create the commands file.", ioe);
    }

    // Execute GPL licensed code in separate virtual machine
    getJava().createArg().setValue("--commandsfile");
    getJava().createArg().setValue(builder.getCommandLineFile());
    AntUtil.transferCoberturaDataFileProperty(getJava());
    if (getJava().executeJava() != 0) {
      throw new MoxieException(
          "Error running reports. See messages above.");
    }

    builder.dispose();
  }
View Full Code Here

Examples of org.apache.slider.core.launch.CommandLineBuilder

          LocalResourceType.FILE);
      launcher.addLocalResource(AgentKeys.AGENT_VERSION_FILE, agentVerRes);
    }

    String label = getContainerLabel(container, role);
    CommandLineBuilder operation = new CommandLineBuilder();

    operation.add(AgentKeys.PYTHON_EXE);

    operation.add(scriptPath);
    operation.add(ARG_LABEL, label);
    operation.add(ARG_HOST);
    operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_HOSTNAME));
    operation.add(ARG_PORT);
    operation.add(getClusterInfoPropertyValue(StatusKeys.INFO_AM_WEB_PORT));

    launcher.addCommand(operation.build());

    // initialize the component instance state
    componentStatuses.put(label,
                          new ComponentInstanceState(
                              role,
View Full Code Here

Examples of org.apache.slider.core.launch.CommandLineBuilder

    //now add the image if it was set
    String imageURI = instanceDefinition.getInternalOperations()
                  .get(OptionKeys.INTERNAL_APPLICATION_IMAGE_PATH);
    coreFS.maybeAddImagePath(launcher.getLocalResources(), imageURI);

    CommandLineBuilder cli = new CommandLineBuilder();

    String heap = appComponent.getOption(RoleKeys.JVM_HEAP, DEFAULT_JVM_HEAP);
    if (SliderUtils.isSet(heap)) {
      String adjustedHeap = SliderUtils.translateTrailingHeapUnit(heap);
      launcher.setEnv(HBASE_HEAPSIZE, adjustedHeap);
    }
   
    String gcOpts = appComponent.getOption(RoleKeys.GC_OPTS, DEFAULT_GC_OPTS);
    if (SliderUtils.isSet(gcOpts)) {
      launcher.setEnv(HBASE_GC_OPTS, gcOpts);
    }
   
    //this must stay relative if it is an image
    cli.add(providerUtils.buildPathToScript(
        instanceDefinition,
        "bin",
        HBASE_SCRIPT));
    //config dir is relative to the generated file
    cli.add(ARG_CONFIG);
    cli.add("$PROPAGATED_CONFDIR");

    String roleCommand;
    String logfile;
    //now look at the role
    switch (role) {
      case ROLE_WORKER:
        //role is region server
        roleCommand = REGION_SERVER;
        logfile = "/region-server.txt";
        break;
      case ROLE_MASTER:
        roleCommand = MASTER;

        logfile = "/master.txt";
        break;
      default:
        throw new SliderInternalStateException("Cannot start role %s", role);
    }

    cli.add(roleCommand);
    cli.add(ACTION_START);
    //log details
    cli.addOutAndErrFiles(logfile, null);
    launcher.addCommand(cli.build());

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.