Details
-
Improvement
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
Platform: All, OS: All
Description
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.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | mindless [ mindless ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Status | Resolved [ 5 ] | Closed [ 6 ] |
Workflow | JNJira [ 132558 ] | JNJira + In-Review [ 201501 ] |
enhancement