Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.Commandline


        cmd.createArgument().setValue(String.valueOf(timetorun));
        return cmd;
    }

    public void testNoTimeOut() throws Exception {
        Commandline cmd = getCommandline(TIME_OUT/2);
        ej.setJavaCommand(cmd);
        ej.execute(project);
        assertTrue("process should not have been killed", !ej.killedProcess());
    }
View Full Code Here


        assertTrue("process should not have been killed", !ej.killedProcess());
    }

    // test that the watchdog ends the process
    public void testTimeOut() throws Exception {
        Commandline cmd = getCommandline(TIME_OUT*2);
        ej.setJavaCommand(cmd);
        long now = System.currentTimeMillis();
        ej.execute(project);
        long elapsed = System.currentTimeMillis() - now;
        assertTrue("process should have been killed", ej.killedProcess());
View Full Code Here

                   elapsed < TIME_OUT*2);
    }


    public void testNoTimeOutForked() throws Exception {
        Commandline cmd = getCommandline(TIME_OUT/2);
        ej.setJavaCommand(cmd);
        ej.fork(cp);
        assertTrue("process should not have been killed", !ej.killedProcess());
    }
View Full Code Here

        //thus test fails.  No workaround?
        if (JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2)
            && Os.isFamily("dos")) {
            return;
        }
        Commandline cmd = getCommandline(TIME_OUT*2);
        ej.setJavaCommand(cmd);
        long now = System.currentTimeMillis();
        ej.fork(cp);
        long elapsed = System.currentTimeMillis() - now;
        assertTrue("process should have been killed", ej.killedProcess());
View Full Code Here

        project.setBasedir(".");
        ej.setClasspath(new Path(project, getTestClassPath()));
    }

    private Commandline getCommandline(int timetorun) throws Exception {
        Commandline cmd = new Commandline();
        cmd.setExecutable(TimeProcess.class.getName());
        cmd.createArgument().setValue(String.valueOf(timetorun));
        return cmd;
    }
View Full Code Here

        cmd.createArgument().setValue(String.valueOf(timetorun));
        return cmd;
    }

    public void testNoTimeOut() throws Exception {
        Commandline cmd = getCommandline(TIME_OUT/2);
        ej.setJavaCommand(cmd);
        ej.execute(project);
        assertTrue("process should not have been killed", !ej.killedProcess());
    }
View Full Code Here

        assertTrue("process should not have been killed", !ej.killedProcess());
    }

    // test that the watchdog ends the process
    public void testTimeOut() throws Exception {
        Commandline cmd = getCommandline(TIME_OUT*2);
        ej.setJavaCommand(cmd);
        long now = System.currentTimeMillis();
        ej.execute(project);
        long elapsed = System.currentTimeMillis() - now;
        assertTrue("process should have been killed", ej.killedProcess());
View Full Code Here

            classpath.append(compileSourcepath);
        } else {
            classpath.append(src);
        }

        Commandline cmd = new Commandline();
        cmd.setExecutable("jvc");

        if (destDir != null) {
            cmd.createArgument().setValue("/d");
            cmd.createArgument().setFile(destDir);
        }
       
        // Add the Classpath before the "internal" one.
        cmd.createArgument().setValue("/cp:p");
        cmd.createArgument().setPath(classpath);

        // Enable MS-Extensions and ...
        cmd.createArgument().setValue("/x-");
        // ... do not display a Message about this.
        cmd.createArgument().setValue("/nomessage");
        // Do not display Logo
        cmd.createArgument().setValue("/nologo");

        if (debug) {
            cmd.createArgument().setValue("/g");
        }
        if (optimize) {
            cmd.createArgument().setValue("/O");
        }
        if (verbose) {
            cmd.createArgument().setValue("/verbose");
        }

        addCurrentCompilerArgs(cmd);

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

        return
            executeExternalCompile(cmd.getCommandline(), firstFileName) == 0;
    }
View Full Code Here

     * @param options additional parameters needed by a specific
     *                implementation.
     * @return the command line
     */
    protected Commandline setupRmicCommand(String[] options) {
        Commandline cmd = new Commandline();

        if (options != null) {
            for (int i = 0; i < options.length; i++) {
                cmd.createArgument().setValue(options[i]);
            }
        }

        Path classpath = getCompileClasspath();

        cmd.createArgument().setValue("-d");
        cmd.createArgument().setFile(attributes.getBase());

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

        cmd.createArgument().setValue("-classpath");
        cmd.createArgument().setPath(classpath);
        String stubOption = addStubVersionOptions();
        if (stubOption != null) {
            //set the non-null stubOption
            cmd.createArgument().setValue(stubOption);
        }


        if (null != attributes.getSourceBase()) {
            cmd.createArgument().setValue("-keepgenerated");
        }

        if (attributes.getIiop()) {
            attributes.log("IIOP has been turned on.", Project.MSG_INFO);
            cmd.createArgument().setValue("-iiop");
            if (attributes.getIiopopts() != null) {
                attributes.log("IIOP Options: " + attributes.getIiopopts(),
                               Project.MSG_INFO);
                cmd.createArgument().setValue(attributes.getIiopopts());
            }
        }

        if (attributes.getIdl())  {
            cmd.createArgument().setValue("-idl");
            attributes.log("IDL has been turned on.", Project.MSG_INFO);
            if (attributes.getIdlopts() != null) {
                cmd.createArgument().setValue(attributes.getIdlopts());
                attributes.log("IDL Options: " + attributes.getIdlopts(),
                               Project.MSG_INFO);
            }
        }

        if (attributes.getDebug()) {
            cmd.createArgument().setValue("-g");
        }

        String[] compilerArgs = attributes.getCurrentCompilerArgs();
        compilerArgs = preprocessCompilerArgs(compilerArgs);
        cmd.addArguments(compilerArgs);

        logAndAddFilesToCompile(cmd);
        return cmd;
     }
View Full Code Here

            // re-implement legacy behaviour:
            this.setCommand(AbstractCvsTask.DEFAULT_COMMAND);
        }

        String c = this.getCommand();
        Commandline cloned = null;
        if (c != null) {
            cloned = (Commandline) cmd.clone();
            cloned.createArgument(true).setLine(c);
            this.addConfiguredCommandline(cloned, true);
        }

        try {
            for (int i = 0; i < vecCommandlines.size(); i++) {
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.types.Commandline

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.