Skip to content
Permalink
Browse files
[FIXED JENKINS-9309]
  • Loading branch information
Karsten Brandt authored and Karsten Brandt committed Jun 3, 2012
1 parent 2a42be3 commit ba86876f210ffc7e210d740fd938cef7b9cf04d3
Showing 2 changed files with 33 additions and 7 deletions.
@@ -71,13 +71,33 @@ public void doIndex(final StaplerRequest request, final StaplerResponse response
}

public final boolean hasValidResults() {

AbstractBuild<?, ?> build = getLastFinishedBuild();

if (build != null) {

SloccountBuildAction resultAction = build.getAction(SloccountBuildAction.class);
if (resultAction != null) {
return resultAction.getPreviousResult() != null;
}
int nbr_results = 0;

do{

SloccountResult result = resultAction.getResult();

if(result != null){

nbr_results++;

if(nbr_results > 1){

return true;
}
}

resultAction = resultAction.getPreviousAction();

}while(resultAction != null);
}

return false;
}

@@ -46,8 +46,11 @@ protected boolean canContinue(final Result result) {

@Override
public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListener listener){


SloccountResult result = null;

if(this.canContinue(build.getResult())){

FilePath workspace = build.getWorkspace();
PrintStream logger = listener.getLogger();
SloccountParser parser = new SloccountParser(this.getRealEncoding(), this.getRealPattern(), logger);
@@ -65,10 +68,13 @@ public boolean perform(AbstractBuild<?,?> build, Launcher launcher, BuildListene
return false;
}

SloccountResult result = new SloccountResult(report, build);
SloccountBuildAction buildAction = new SloccountBuildAction(build, result);
build.addAction(buildAction);
result = new SloccountResult(report, build);
}

SloccountBuildAction buildAction = new SloccountBuildAction(build, result);

build.addAction(buildAction);

return true;
}

0 comments on commit ba86876

Please sign in to comment.