--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/f09b37f3-7495-4fb9-9541-57a521601231%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hello there,I'd like to return to the discussion of the following threads:It is told there that even maven plugin does not support these filters, and I'd like to understand what maven plugin is meant there?
Are there any plans to add support of the following filters to the Gradle too? It would be really-really great.
Thanks a lot for clarification.
Would you mind if I add the corresponding pull request to support scala filters then?
> why not https://github.com/scoverage which seems to provide Gradle plugin?
there are my few points why I'd prefer jacoco to other code coverage tools
- bytecode instrumentation at runtime (no need to double compile as well as no risk of deploying instrumented code automatically)
- the same tool for each language built on top of jvm (my team currently uses java, scala and groovy)
- the same analysis and reporting tools (i.e. no need to configure build pipelines somehow differently across different languages)
> is there reliable unambiguous way to distinguish bytecode which can be produced by Scala compiler from bytecode which can be produced by Java/Kotlin/Groovy?
- modern scala annotates top-level classes with either "scala/reflect/ScalaSignature" or "scala/reflect/ScalaLongSignature" and adds either "ScalaSig" or "Scala" class attributes to the nested classes.
- here is the doc (https://www.scala-lang.org/old/sid/10) that can be used as a reference
There are three options of adding scala support (and extension points as well) which come to my mind
- adding support of java spi to allow adding new filters as easy as just dropping a jar into the build classpath (example is available here, the drawback - it requires java 6)
- in case it's necessary to support java 5 as well, java spi sample can be easily replaced with ClassLoader.getResources(...)
and the corresponding sample that can be extended by all the scala-related filters to prevent affecting filters for other languages.
- backporting filters from sbt-scala plugin (I've already done some basic steps)
> Is there a way to extract information about generated methods from annotation?I believe not at the moment. I've already asked the corresponding question - https://github.com/scala/bug/issues/11407
> I heard multiple times that Scala code requires "better granularity at a level of expressions"Basically I believe that all these expressions will occur in the bytecode one way or another and the only issue is to distinguish them somehow.
> Have you ever tried them on real projects?I'd like to use all the power of jacoco for scala analysis on my current project (~27K SLOC of scala) and would like to improve code coverage reports for instructions and branches (with lines coverage thankfully everything is ok)> IMO filters in sbt-jacoco are extremely weak ... To me seems that one-liners are pretty common case in Scala.
Well, it seems so. Then those filters can be treated as just a starting point (having in mind these corner cases and testing them carefully).
> AFAIK Scala compiler has option to switch-off generation of line numbers.
That's true. But in that case only coverage of scala classes will be affected (imo even then coverage will be better than now and to my mind not so may people switches lines generation off on the daily basis)