public Result runSubBuild(Combination combination, BuildExecutionContext dynamicSubBuildExecution, BuildListener listener) throws IOException, InterruptedException {
return runBuildCombination(combination,dynamicSubBuildExecution,listener);
}
private Result runMultiConfigbuildRunner(final DynamicBuild dynamicBuild, final BuildConfiguration buildConfiguration, final BuildListener listener, Launcher launcher)throws InterruptedException, IOException {
SubBuildScheduler subBuildScheduler = new SubBuildScheduler(dynamicBuild, this, new SubBuildScheduler.SubBuildFinishListener() {
@Override
public void runFinished(DynamicSubBuild subBuild) throws IOException {
for (DotCiPluginAdapter plugin : buildConfiguration.getPlugins()) {
plugin.runFinished(subBuild, dynamicBuild, listener);
}
}
});
try {
Iterable<Combination> axisList = getAxisList(buildConfiguration).list();
Result combinedResult = subBuildScheduler.runSubBuilds(getMainRunCombinations(axisList), listener);
if (combinedResult.equals(Result.SUCCESS) && !Iterables.isEmpty(getPostBuildCombination(axisList))) {
Result runSubBuildResults = subBuildScheduler.runSubBuilds(getPostBuildCombination(axisList), listener);
combinedResult = combinedResult.combine(runSubBuildResults);
}
dynamicBuild.setResult(combinedResult);
return combinedResult;
} finally {
try {
subBuildScheduler.cancelSubBuilds(listener.getLogger());
} catch (Exception e) {
// There is nothing much we can do at this point
LOGGER.log(Level.SEVERE, "Failed to cancel subbuilds", e);
}
}