Description
Problem:
I have an sbt project that collects code coverage for source code in another project that it picks up using a symbolic link of the form
ln -s {external_root}/{project}/src/main {root}/{project}/src/main
Everything works fine until I run "sbt coverageReport", but that fails with an error of the form:
No source root found for '{root}/{project}/src/main/.../{source.scala}' (source roots: '{external_root}/{project}/src/main/scala/', ...')
Diagnosis:
The failure occurs because BaseReportWriter applies _.getCanonicalPath to sourceDirectories (when initializing formattedSourcePaths) but not to the source file in relativeSource().
Fix:
I think this can be fixed in relativeSource() by applying getCanonicalPath to the source file name before searching sourcePaths.