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

re-instrument and recompile every single source file #118

Closed
jandaj opened this issue Jun 28, 2018 · 3 comments
Closed

re-instrument and recompile every single source file #118

jandaj opened this issue Jun 28, 2018 · 3 comments
Assignees
Milestone

Comments

@jandaj
Copy link

jandaj commented Jun 28, 2018

I have a very large codebase, and clover is trying to re-instrument and recompile every single source file, even though only one file has changed, which is a huge overhead with the run time. I was wondering if there is a way to configure the plugin or even the Ant task to make it so that it only re instruments and re compiles the files that have been changed.

@jandaj jandaj changed the title All tests run despite optimization being on re-instrument and recompile every single source file Jun 29, 2018
@Alex-Vol-SV
Copy link
Collaborator

I have no control over the Ant tasks. This plugin integrates OpenClover using the Ant tasks and is subordinate to the behavior of the OpenClover Ant tasks. Perhaps this is better served as a query in OpenClover project.

I will look at the behavior regarding the recompile, it might take some significant refactoring to work because of the compilation code swapping that happens in this plugin. The plugin injects actions on the test tasks that recompile the code after moving the original compiled files to a backup location. A possible approach would be to create sourceSets derived from the original defined sourceSets and construct compilation tasks for each one. Then we would inject the new classpath into the test tasks and run with the Clover instrumented code. That is quite involved and might take significant time to accomplish but it would let the default up-to-date Gradle mechanism to operate on the files. Not sure if the OpenClover Ant tasks are able to do incremental compilation as effectively as Gradle's own compilation tasks do it. This would work best if the compilation process and the code instrumentation process were truly separate steps that were invoked independently with each having correct up-to-date criteria.

@Alex-Vol-SV
Copy link
Collaborator

One possible approach that I should put some thought into is to cache the instrumented files between runs in incremental compilation. The plugin takes great care to replace the original not instrumented binaries back into the locations they were swapped out of but we do not save the instrumented binaries in a way that would make it possible to allow the Ant task to do incremental builds.
I also suspect the modification of the original binaries by moving out and back into position causes the Gradle compile tasks to consider them modified and thus not up-to-date. Both of these behaviors are probably responsible for this issue and should be looked at.

@Alex-Vol-SV Alex-Vol-SV added this to the 3.0.0 milestone Jul 31, 2020
@Alex-Vol-SV Alex-Vol-SV self-assigned this Jul 31, 2020
@Alex-Vol-SV
Copy link
Collaborator

Fixed with version 3.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants