antArgs += " ";
}
antArgs += "-" + ANT_ARG + Joiner.on(" -" + ANT_ARG).join(supplementalAntArgs);
conf.setAntArgs(antArgs);
}
ExecutionContextProvider executionContextProvider = null;
ExecutionContext executionContext = null;
int exitCode = 0;
try {
executionContextProvider = executionContextConfiguration
.getExecutionContextProvider();
executionContext = executionContextProvider.createExecutionContext();
LocalCommandFactory localCommandFactory = new LocalCommandFactory(LOG);
PTest ptest = new PTest(conf, executionContext, buildTag, logDir,
localCommandFactory, new SSHCommandExecutor(LOG, localCommandFactory, conf.getSshOpts()),
new RSyncCommandExecutor(LOG, 10, localCommandFactory), LOG);
exitCode = ptest.run();
} finally {
if(executionContext != null) {
executionContext.terminate();
}
if(executionContextProvider != null) {
executionContextProvider.close();
}
}
System.exit(exitCode);
}