Hello Everyone, I, a newbie, trying to learn about...
# community-support
s
Hello Everyone, I, a newbie, trying to learn about how jacoco works. I am trying to understand how jacoco gradle task actually facilitates jacoco's byte manipulation and instrumentation steps. I am trying to find the implementation of jacoco plugin to read more about it but unable to locate the entry point. Could you please point me to the right direction? Thanks in advance for your help!
s
Thankyou Thomas. I see that we often use jacocoTestReport task in our gradle config files. I am hoping somehow jacocoTestReport triggers the code in JacocoPlugin.java?
s
Thankyou so much. I have been doing string search with the name. No wonder I never found it.
v
As a rough sum-up, the jacoco plugin configures the test tasks so they use the JaCoCo agent. The JaCoCo agent is the one doing ad-hoc instrumentation to collect the values and write them to the exec files. The JaCoCo report task then calls JaCoCo and gives it those exec files and everything else it needs to generate the HTML report from it.
And as a general rule, tasks, never trigger anything in plugins. Plugins are the configuration-time thing that sets things up, tasks are the execution-time thing that do the actual work (which can be further delegated to workers and so on of course).
👍 1
🙌 1
s
thankyou Björn for the detailed explanation.
👌 1