Skip to content

Conversation

tasomaniac
Copy link

@tasomaniac tasomaniac commented Sep 15, 2020

Context

While integrating the Jacoco plugin into our repo, I realized a small build performance issue with the suggestion provided in the docs.

When test task is always finalized with jacocoTestReport, it causes jacoco report to be generated when not needed. Example: Recent versions of IntelliJ IDEA delegates to Gradle to run a single test. This is done during development workflow and supposed to be very fast. In this case, we don't need to generate jacoco report every time a single test is run.

Solution

Remove the suggestion to make tests being finalized by jacoco task. Making jacocoTestReport depend on the test task should be enough.

Also change the example usage to use Task configuration avoidance APIs.

Contributor Checklist

Gradle Core Team Checklist

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation
  • Recognize contributor in release notes

Also use apis for configuration avoidance

Signed-off-by: Taso Dane <[email protected]>
@JLLeitschuh
Copy link
Contributor

I'd rather document the performance impact over removing the suggestion. Can you instead update the documentation with a better solution?

@tasomaniac
Copy link
Author

I cannot see how it can be improved since it is just simply unnecessary. With my suggestion, it is simpler. If you want jaco report, you simply run jaco tasks and they automatically depend on tests. All works fine.

If you have any suggestions, I'm open to change it.

@JLLeitschuh
Copy link
Contributor

🤔 Perhaps suggest that they attach the jacoco tasks to check? Maybe?

@JLLeitschuh
Copy link
Contributor

@big-guy your thoughts here?

@tasomaniac
Copy link
Author

That's a good idea. I will change it.

@tasomaniac tasomaniac changed the base branch from master to am-native-client November 18, 2020 23:21
@tasomaniac tasomaniac changed the base branch from am-native-client to master November 18, 2020 23:21
@JLLeitschuh
Copy link
Contributor

Thanks @tasomaniac!

@gradle gradle deleted a comment from JLLeitschuh Nov 19, 2020
@JLLeitschuh
Copy link
Contributor

@bot-gradle test SanityCheck plz