Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.ExecTask


    }

    /** Executes reg.exe to query the registry */
    private static String runRegQuery(String key) {
        Project p = new Project();
        ExecTask exec = new ExecTask();
        exec.setProject(p);
        exec.setTaskType("reg");
        exec.setExecutable(findReg());
        exec.setFailonerror(false);
        exec.setResultProperty("result");
        exec.setOutputproperty("output");
        exec.createArg().setValue("query");
        if (isRegExeVersion1()) {
          exec.createArg().setValue(key);
        } else {
          RegKeyValue r = new RegKeyValue(key);
            exec.createArg().setValue(r.key);
            exec.createArg().setValue("/v");
            exec.createArg().setValue(r.value);
        }
        exec.setOutputproperty("regout");
        exec.execute();
        String output = p.getProperty("regout");
        return output;
    }
View Full Code Here


   * @param lineNum Line number of error. 
   */
  protected void fireFileErrorNotification(
    Project project, File file, int lineNum) {
    // Launch our command using the built in exec support.
    ExecTask exec = (ExecTask) project.createTask("exec");
    // Construct the command to communicate with emacs.
    // Command has the form:
    //     emacsclient [-n] [--no-wait] [+LINENUMBER] FILENAME
    exec.setExecutable(EMACS);
    exec.createArg().setValue("-n");
    exec.createArg().setValue("--no-wait");
    exec.createArg().setValue("+" + lineNum);
    exec.createArg().setValue(file.toString());
    exec.setFailonerror(false);
    exec.execute();
  }
View Full Code Here

   * @param lineNum Line number of error. 
   */
  protected void fireFileErrorNotification(
    Project project, File file, int lineNum) {
    // Launch our command using the built in exec support.
    ExecTask exec = (ExecTask) project.createTask("exec");
    // Construct the command to communicate with emacs.
    // Command has the form:
    //     emacsclient [-n] [--no-wait] [+LINENUMBER] FILENAME
    exec.setExecutable(EMACS);
    exec.createArg().setValue("-n");
    exec.createArg().setValue("--no-wait");
    exec.createArg().setValue("+" + lineNum);
    exec.createArg().setValue(file.toString());
    exec.setFailonerror(false);
    exec.execute();
  }
View Full Code Here

     * it appears in the logs to be the same task as this one.
     * @return the delegate.
     * @throws BuildException on error.
     */
    protected ExecTask createExec() throws BuildException {
        ExecTask exec = new ExecTask(this);
        return exec;
    }
View Full Code Here

                throw new BuildException(msg, getLocation());
            }
        } else {
            try {
                File listFile = createListFile(files);
                ExecTask exec = createExec();
                File outFile = null;

                // die if cabarc fails
                exec.setFailonerror(true);
                exec.setDir(baseDir);

                if (!doVerbose) {
                    outFile = FILE_UTILS.createTempFile("ant", "", null, true, true);
                    exec.setOutput(outFile);
                }

                exec.setExecutable("cabarc");
                exec.createArg().setValue("-r");
                exec.createArg().setValue("-p");

                if (!doCompress) {
                    exec.createArg().setValue("-m");
                    exec.createArg().setValue("none");
                }

                if (cmdOptions != null) {
                    exec.createArg().setLine(cmdOptions);
                }

                exec.createArg().setValue("n");
                exec.createArg().setFile(cabFile);
                exec.createArg().setValue("@" + listFile.getAbsolutePath());

                exec.execute();

                if (outFile != null) {
                    outFile.delete();
                }
View Full Code Here

    initNsis();
    execNsis();
  }

  void execNsis() throws BuildException {
    ExecTask exec = (ExecTask) task.createSubtask(ExecTask.class);
    exec.setDir(baseDir);
    exec.setExecutable(nsisExe);
    exec.setFailonerror(true);

    exec.createArg().setLine(nsiScript.getAbsolutePath());

    exec.execute();
  }
View Full Code Here

     *
     * @throws Exception Indicates an error executing the target {@link ExecTask}.
     */
    private void startOpenOfficeServer() throws Exception
    {
        ExecTask execTask = (ExecTask) this.project.createTask("exec");
        Commandline commandLine =
            new Commandline(OPENOFFICE_EXECUTABLE
                + " -headless -accept=\"socket,host=127.0.0.1,port=8100;urp;\" -nofirststartwizard");
        execTask.setCommand(commandLine);
        execTask.execute();
    }
View Full Code Here

     * it appears in the logs to be the same task as this one.
     * @return the delegate.
     * @throws BuildException on error.
     */
    protected ExecTask createExec() throws BuildException {
        ExecTask exec = new ExecTask(this);
        return exec;
    }
View Full Code Here

                throw new BuildException(msg, getLocation());
            }
        } else {
            try {
                File listFile = createListFile(files);
                ExecTask exec = createExec();
                File outFile = null;

                // die if cabarc fails
                exec.setFailonerror(true);
                exec.setDir(baseDir);

                if (!doVerbose) {
                    outFile = FILE_UTILS.createTempFile("ant", "", null, true, true);
                    exec.setOutput(outFile);
                }

                exec.setExecutable("cabarc");
                exec.createArg().setValue("-r");
                exec.createArg().setValue("-p");

                if (!doCompress) {
                    exec.createArg().setValue("-m");
                    exec.createArg().setValue("none");
                }

                if (cmdOptions != null) {
                    exec.createArg().setLine(cmdOptions);
                }

                exec.createArg().setValue("n");
                exec.createArg().setFile(cabFile);
                exec.createArg().setValue("@" + listFile.getAbsolutePath());

                exec.execute();

                if (outFile != null) {
                    outFile.delete();
                }
View Full Code Here

    protected  void executeForkV4() throws BuildException {
        try {

            log("mode : fork " + BorlandDeploymentTool.BAS, Project.MSG_DEBUG);

            ExecTask execTask = new ExecTask(this);

            execTask.setDir(new File("."));
            execTask.setExecutable("iastool");
            execTask.createArg().setValue("generateclient");
            if (debug) {
                execTask.createArg().setValue("-trace");
            }

            execTask.createArg().setValue("-short");
            execTask.createArg().setValue("-jarfile");
            // ejb jar file
            execTask.createArg().setValue(ejbjarfile.getAbsolutePath());
            //client jar file
            execTask.createArg().setValue("-single");
            execTask.createArg().setValue("-clientjarfile");
            execTask.createArg().setValue(clientjarfile.getAbsolutePath());

            log("Calling iastool", Project.MSG_VERBOSE);
            execTask.execute();
        } catch (Exception e) {
            // Have to catch this because of the semantics of calling main()
            String msg = "Exception while calling generateclient Details: "
                + e.toString();
            throw new BuildException(msg, e);
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.ExecTask

Copyright © 2018 www.massapicom. 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.