本文整理了Java中org.apache.tools.ant.taskdefs.Execute.getExitValue()
方法的一些代码示例,展示了Execute.getExitValue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execute.getExitValue()
方法的具体详情如下:
包路径:org.apache.tools.ant.taskdefs.Execute
类名称:Execute
方法名:getExitValue
[英]Query the exit value of the process.
[中]查询进程的退出值。
代码示例来源:origin: org.apache.ant/ant
/**
* 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());
}
代码示例来源:origin: kaaproject/kaa
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());
}
}
代码示例来源:origin: org.apache.ant/ant
exe.setCommandline(commandArray);
exe.execute();
return exe.getExitValue();
} catch (final IOException e) {
throw new BuildException("Error running " + args[0]
代码示例来源:origin: org.apache.ant/ant
watchdog.checkException();
return getExitValue();
} catch (ThreadDeath t) {
代码示例来源:origin: apache/groovy
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);
}
}
}
代码示例来源:origin: org.kohsuke.droovy/groovy
throw new BuildException("Error running forked groovyc.", ioe);
final int returnCode = executor.getExitValue();
if (returnCode != 0) {
代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal
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 ) ; }
代码示例来源:origin: randomizedtesting/randomizedtesting
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:
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
throw new BuildException("Error running forked groovyc.", ioe);
final int returnCode = executor.getExitValue();
if (returnCode != 0) {
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
throw new BuildException("Error running forked groovyc.", ioe);
final int returnCode = executor.getExitValue();
if (returnCode != 0) {
代码示例来源:origin: org.codehaus.groovy/groovy-ant
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);
}
}
}
代码示例来源:origin: com.carrotsearch.randomizedtesting/junit4-ant
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:
内容来源于网络,如有侵权,请联系作者删除!