Skip to content

Commit

Permalink
Merge pull request #43 from dzudek/master
Browse files Browse the repository at this point in the history
[FIXED JENKINS-13889] Not able to find source code from subdirectories
  • Loading branch information
arcivanov committed Oct 26, 2015
2 parents c27a7e5 + 2ea94ad commit a94a23f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/hudson/plugins/cobertura/CoberturaPublisher.java
Expand Up @@ -397,6 +397,17 @@ public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListen
result.setOwner(build);
final FilePath paintedSourcesPath = new FilePath(new File(build.getProject().getRootDir(), "cobertura"));
paintedSourcesPath.mkdirs();

if (sourcePaths.contains(".")) {
sourcePaths.remove(".");
for (FilePath f : reports) {
FilePath p = f.getParent();
if (p != null && p.isDirectory()) {
sourcePaths.add(p.getRemote());
}
}
}

SourceCodePainter painter = new SourceCodePainter(paintedSourcesPath, sourcePaths,
result.getPaintedSources(), listener, getSourceEncoding());

Expand Down

0 comments on commit a94a23f

Please sign in to comment.