Skip to content
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

Add CLI for offline instrumentation #322

Closed
shanshin opened this issue Mar 17, 2023 · 3 comments · Fixed by #340
Closed

Add CLI for offline instrumentation #322

shanshin opened this issue Mar 17, 2023 · 3 comments · Fixed by #340
Assignees
Labels
Feature Feature request issue type Kover Coverage Tool S: ready for release Status: merged in the main branch

Comments

@shanshin
Copy link
Collaborator

shanshin commented Mar 17, 2023

In the case of using third-party build systems (other than Gradle) for offline instrumentation of class-files, there is a need for a CLI wrapper over the Kover tool.

Offline instrumentation is necessary to collect coverage on another device, and then transfer the raw report to the machine where the instrumentation was performed to generate an HTMl or XML report.

As part of this task, it is necessary:

  • introduce Kover artifacts for CLI capabilities
  • create sh/bat scripts for invoking offline instrumentation and generating reports (optional)
  • add documentation describing how to perform offline instrumentation
@shanshin shanshin added Feature Feature request issue type S: in progress Status: implementing or design in process labels Mar 17, 2023
@shanshin shanshin self-assigned this Mar 17, 2023
@shanshin shanshin mentioned this issue Mar 17, 2023
@shanshin
Copy link
Collaborator Author

Related PR: JetBrains/intellij-coverage#55

@shanshin shanshin reopened this Apr 12, 2023
@shanshin shanshin added S: ready for release Status: merged in the main branch and removed S: in progress Status: implementing or design in process labels Apr 12, 2023
@shanshin
Copy link
Collaborator Author

Implemented in 0.7.0-Beta

@shanshin
Copy link
Collaborator Author

shanshin commented Apr 24, 2023

To collect coverage and generate a report, follow these steps:

  1. download Kover CLI
  2. instrument compiled classes by command like java -jar kover-cli-0.7.0-Beta.jar instrument path/to/classes --dest path/to/instrumented. See the details in the readme file
  3. download Kover offline runtime with dependencies for the instrumented code
  4. add kover-offline-runtime-0.7.0-Beta.jar archive to the application classpath
  5. launch the application by passing the kover.offline.report.path system property, for example, through command-line startup arguments -Dkover.offline.report.path=path/to/binary/report. A binary coverage report will be written to the specified file.
  6. generate a report by command like java -jar kover-cli-0.7.0-Beta.jar path/to/binary/report --classfiles path/to/classes --src /path/to/sources --html /path/to/html/report. See the details in the readme file

An example of using the CLI in Gradle is given in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feature request issue type Kover Coverage Tool S: ready for release Status: merged in the main branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant