/** * Did this execute return in a failure. * * @see #isFailure(int) * @return true if and only if the exit code is interpreted as a failure * @since Ant1.7 */ public boolean isFailure() { return isFailure(getExitValue()); }
private static void executeCommand(File workingDir, String... command) throws IOException { Execute exec = new Execute(); if (workingDir == null) { String homeDir = System.getProperty("user.home"); if (homeDir != null) { workingDir = new File(homeDir); } } if (workingDir != null) { exec.setWorkingDirectory(workingDir); } exec.setCommandline(command); exec.execute(); if (exec.isFailure()) { throw new RuntimeException("Process returned bad exit value: " + exec.getExitValue()); } }
exe.setCommandline(commandArray); exe.execute(); return exe.getExitValue(); } catch (final IOException e) { throw new BuildException("Error running " + args[0]
watchdog.checkException(); return getExitValue(); } catch (ThreadDeath t) {
private void runForked(String[] commandLine) { final Execute executor = new Execute(); executor.setAntRun(getProject()); executor.setWorkingDirectory(getProject().getBaseDir()); executor.setCommandline(commandLine); try { executor.execute(); } catch (final IOException ioe) { throw new BuildException("Error running forked groovyc.", ioe); } final int returnCode = executor.getExitValue(); if (returnCode != 0) { taskSuccess = false; if (errorProperty != null) { getProject().setNewProperty(errorProperty, "true"); } if (failOnError) { throw new BuildException("Forked groovyc returned error code: " + returnCode); } else { log.error("Forked groovyc returned error code: " + returnCode); } } }
throw new BuildException("Error running forked groovyc.", ioe); final int returnCode = executor.getExitValue(); if (returnCode != 0) {
try { executor.execute ( ) ; } catch ( final IOException ioe ) { throw new BuildException ( "Error running forked groovyc." , ioe ) ; } final int returnCode = executor.getExitValue ( ) ; if ( returnCode != 0 ) { throw new BuildException ( "Forked groovyc returned error code: " + returnCode ) ; }
log("Forked JVM J" + slave.id + " finished with exit code: " + execute.getExitValue(), Project.MSG_DEBUG); final int exitStatus = execute.getExitValue(); switch (exitStatus) { case SlaveMain.ERR_NO_JUNIT:
throw new BuildException("Error running forked groovyc.", ioe); final int returnCode = executor.getExitValue(); if (returnCode != 0) {
throw new BuildException("Error running forked groovyc.", ioe); final int returnCode = executor.getExitValue(); if (returnCode != 0) {
private void runForked(String[] commandLine) { final Execute executor = new Execute(); executor.setAntRun(getProject()); executor.setWorkingDirectory(getProject().getBaseDir()); executor.setCommandline(commandLine); try { executor.execute(); } catch (final IOException ioe) { throw new BuildException("Error running forked groovyc.", ioe); } final int returnCode = executor.getExitValue(); if (returnCode != 0) { taskSuccess = false; if (errorProperty != null) { getProject().setNewProperty(errorProperty, "true"); } if (failOnError) { throw new BuildException("Forked groovyc returned error code: " + returnCode); } else { log.error("Forked groovyc returned error code: " + returnCode); } } }
log("Forked JVM J" + slave.id + " finished with exit code: " + execute.getExitValue(), Project.MSG_DEBUG); final int exitStatus = execute.getExitValue(); switch (exitStatus) { case SlaveMain.ERR_NO_JUNIT: