-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add CLI tools for offline instrumentation and report generation #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The initial tools are "instrument" and "report" which are an offline instrumentation tool and a report generation tool supporting CSV, HTML and XML output. Signed-off-by: John Keeping <john@metanate.com>
Although the agent runtime isn't designed to be loaded as a bundle, it can still be useful to have a symbolic name and version so that the JAR can be retrieved from a bundle repository in the same way as the other components of JaCoCo. Signed-off-by: John Keeping <john@metanate.com>
This tool is missing merge functionality. It will be critically missed:( |
I hope this includes in place instrumentation of JAR files :) |
In place instrumentation was abandoned long ago IIRC. |
Is the Merge coming soon? I keep looking for a cli package in the snapshots and don't see it. Maybe I'm not looking correctly. Thanks. Much appreciated. This can really help what I'm working on. |
I'm not sure:( Although I like my original code bit more (O:) I'm looking forward to this.. |
Since this PR is still waiting for a merge, and I needed a CLI tool for the report https://github.com/quelltextlich/jacoco-toolbox . The jar (available from central, so no compilation necessary) allows
directly from the command line. Maybe it's useful for other people that find this PR in the future. |
This would be helpful for me too. Android would like to be able to have code coverage metrics via jacoco, but the classes later get processed further and executed in a vm that isn't a jvm (hence wanting the offline instrumentation), and the build system is a custom (though the portion that would interact with Jacoco is essentially Make) build system (hence wanting a command-line tool that both starts a couple seconds faster than Ant or Maven, and that is slightly simpler than including Ant or Maven in the build process). @marchof you indicated in #520 that some of the main blockers for getting this merged were tests and documentation. Could you elaborate on what kinds of documentation and tests are expected? For documentation, are you thinking we'd just add some html under the file path /org.jacoco.doc/docroot in the same commit (as opposed to also separately updating some external wiki)? For tests, are you thinking full integration tests that build the .jar, execute it with command-line arguments, and check the resultant output files, or do you think it would be fine to just test the parser itself in memory? I'd be happy to write some tests and/or documentation if that would get this to be merged Thanks |
@mathjeff Thanks for following this up here! Regarding missing parts: DocumentationAll official documentation goes to module TestTesting the built cli.jar as a separate process would probably the integration test. I think we already do the same for our Maven goals. |
@marchof Thanks so much; that looks like it should give me a good understanding of what you're looking for. I'm starting some updates at https://github.com/mathjeff/jacoco/commits/updating-cli-of-johnkeeping but I haven't yet implemented the test and documentation changes that you're talking about; once I do that then I'll turn it into a proper pull request. Thanks so much! |
@mathjeff I also started working on the documentation and test part. I hope I can push something by next week so we can see what is left for your use cases. |
We follow-up the command line interface implementation in a new pull request: #525 |
These tools help people who are using a build system other than Ant/Maven, as discussed in issue #50.
To that end, I also include a commit adding some OSGi metadata to the runtime agent JAR. This allows that JAR to be stored in a bundle repository and downloaded from there during the build.