Skip to content

Commit

Permalink
[FIXED JENKINS-13889] Not able to find source code from subdirectories
Browse files Browse the repository at this point in the history
Code style fixes

Fix line endings
  • Loading branch information
dzudek committed Oct 9, 2015
1 parent c27a7e5 commit 2ea94ad
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 2ea94ad

Please sign in to comment.