/** {@inheritDoc} */ @Override protected boolean run(Commandline cmd, ProjectComponent log) throws BuildException { ExecuteJava ej = new ExecuteJava(); Class<?> c = getN2aClass(); if (c == null) { throw new BuildException( "Couldn't load Kaffe's Native2Ascii class"); } cmd.setExecutable(c.getName()); ej.setJavaCommand(cmd); ej.execute(log.getProject()); // otherwise ExecuteJava has thrown an exception return true; }
/** {@inheritDoc} */ @Override public boolean execute() throws BuildException { getRmic().log("Using Kaffe rmic", Project.MSG_VERBOSE); Commandline cmd = setupRmicCommand(); Class<?> c = getRmicClass(); if (c == null) { StringBuilder buf = new StringBuilder( "Cannot use Kaffe rmic, as it is not available. None of "); for (String className : RMIC_CLASSNAMES) { if (buf.length() > 0) { buf.append(", "); } buf.append(className); } buf.append( " have been found. A common solution is to set the environment variable JAVA_HOME or CLASSPATH."); throw new BuildException(buf.toString(), getRmic().getLocation()); } cmd.setExecutable(c.getName()); if (!c.getName().equals(RMIC_CLASSNAMES[RMIC_CLASSNAMES.length - 1])) { //NOSONAR // only supported since Kaffe 1.1.2 cmd.createArgument().setValue("-verbose"); getRmic().log(Commandline.describeCommand(cmd)); } ExecuteJava ej = new ExecuteJava(); ej.setJavaCommand(cmd); return ej.fork(getRmic()) == 0; }
ej.setJavaCommand(cmd); File f = Locator.getClassSource(c); if (f != null) {
/** * Run the compilation. * @return true if the compilation succeeded * @exception BuildException if the compilation has problems. */ @Override public boolean execute() throws BuildException { attributes.log("Using kjc compiler", Project.MSG_VERBOSE); Commandline cmd = setupKjcCommand(); cmd.setExecutable("at.dms.kjc.Main"); ExecuteJava ej = new ExecuteJava(); ej.setJavaCommand(cmd); return ej.fork(getJavac()) == 0; }
/** * Executes the given classname with the given arguments as it * were a command line application. * @param command CommandlineJava. */ private void run(CommandlineJava command) throws BuildException { try { ExecuteJava exe = new ExecuteJava(); exe.setJavaCommand(command.getJavaCommand()); exe.setClasspath(command.getClasspath()); exe.setSystemProperties(command.getSystemProperties()); exe.setPermissions(perm); exe.setTimeout(timeout); redirector.createStreams(); exe.execute(getProject()); redirector.complete(); if (exe.killedProcess()) { throw new BuildException(TIMEOUT_MESSAGE); } } catch (IOException e) { throw new BuildException(e); } }
execute.setJavaCommand(command.getJavaCommand()); if (execute.fork(this) != 0) throw new BuildException("Could not invoke WSProvideTask", getLocation());
execute.setJavaCommand(command.getJavaCommand()); if (execute.fork(this) != 0) throw new BuildException("Could not invoke WSConsumeTask", getLocation());