Open
Description
When scala code references java code and scoverage is used with gradle, I get compilation errors in scala where the java classes are referenced.
this is because in ScoveragePlugin.groovy, we dont copy over java files from the sourceset when creating instrumentedSourceSet
(Might be better to copy whole sourceset if possible:
def instrumentedSourceSet = project.sourceSets.create('scoverage') {
resources.source(originalSourceSet.resources)
scala.source(originalSourceSet.scala)
compileClasspath += originalSourceSet.compileClasspath + project.configurations.scoverage
runtimeClasspath = it.output + project.configurations.scoverage + originalSourceSet.runtimeClasspath
}
workaround for now is to add following to build.gradle:
allprojects {
afterEvaluate { project ->
def originalSourceSet = project.sourceSets.getByName(
SourceSet.MAIN_SOURCE_SET_NAME)
def scoverageSourceSet = project.sourceSets.getByName('scoverage')
scoverageSourceSet.java.source(originalSourceSet.java)
}
}
Metadata
Metadata
Assignees
Labels
No labels