-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
Platform: All, OS: All
I created a BuildWrapper and implemented a tearDown method.
When I try to get the build.getResult() from within this tearDown method the
result is always null.
Reason see code in Build class
protected class RunnerImpl extends AbstractRunner {
protected Result doRun(BuildListener listener) throws Exception {
if(!preBuild(listener,project.getBuilders()))
return Result.FAILURE;
if(!preBuild(listener,project.getPublishers()))
return Result.FAILURE;
buildEnvironments = new ArrayList<Environment>();
try {
List<BuildWrapper> wrappers = new ArrayList<BuildWrapper>
(project.getBuildWrappers().values());
ParametersAction parameters = getAction(ParametersAction.class);
if (parameters != null)
parameters.createBuildWrappers(Build.this,wrappers);
for( BuildWrapper w : wrappers )
{ Environment e = w.setUp((AbstractBuild)Build.this, launcher, listener); if(e==null) return Result.FAILURE; buildEnvironments.add(e); } if(!build(listener,project.getBuilders()))
return Result.FAILURE;
} finally
return null;
}
The BuildWrapper.tearDown method is called from within the finally block and
the result is not set yet.