I posted the same question in StackOverflow and did not get any response. Please help.
http://stackoverflow.com/questions/28844652/jacoco-coverage-report-of-dsl
---- here is a summary:
I am writing a customer Jacoco coverage report of my DSL (Domain Specific Language) file. Here is what I did -
0> My DSL is translated into Java code (and SMAP file, JSR-045) and then compiled into Java Classes and then I attached the SMAP file as the SourceDebugExtension.
1> get analyzing data (similar to
http://www.eclemma.org/jacoco/trunk/doc/examples/java/CoreTutorial.java)
2> generate the report (similar to
http://www.eclemma.org/jacoco/trunk/doc/examples/java/ReportGenerator.java).
I could not independently verify this step is successful - however, Eclipse debugging tool is indicating it is working (I am not seeing typical java file there) and I manually inspected SMAP file.
Now, I am expecting that after analyzing, I get a report of DSL coverage. What I found is, if I merge the data with Java file, it looks perfectly matching. But if I merge the data with DSL file, it does not match at all. It seems the "SourceDebugExtension" is not turned on.
How should I enable SourceDebugExtension?
Looking at the code, the problem seems org.jacoco.core.analysis.Analyzer class -
public void analyzeClass(final ClassReader reader) {
final ClassVisitor visitor = createAnalyzingVisitor(
CRC64.checksum(reader.b), reader.getClassName());
reader.accept(visitor, 0);
}
It seems I should change "reader.accept" line to add Attribute. I created an Attribute with type as SourceDebugExtension but that did not help at all.