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

Migrate plugin to use Gradle's task configuration avoidance APIs #66

Open
saguinav opened this issue Mar 2, 2019 · 3 comments
Open

Comments

@saguinav
Copy link

saguinav commented Mar 2, 2019

Gradle recommends to use the task configuration avoidance APIs whenever tasks are created in custom plugins.

In a nutshell, the API allows builds to avoid the cost of creating and configuring tasks during Gradle’s configuration phase when those tasks will never be executed. For example, when running a compile task, other unrelated tasks, like code quality, testing and publishing tasks, will not be executed, so any time spent creating and configuring those tasks is unnecessary. The configuration avoidance API avoids configuring tasks if they will not needed during the course of a build, which can have a significant impact on total configuration time.

See more info here.

Please let me know if you are interested in getting this issue resolved. I would be very happy to contribute.

Thanks in advance!

@stephanenicolas
Copy link

This part of the README.MD file should also be updated by such a PR:

tasks.withType(Test) { --> use configureEach here
  jacoco.includeNoLocationClasses = true
}

@arturdm
Copy link
Owner

arturdm commented Mar 3, 2019

I would greatly appreciate contribution to this project.

Although, I had some doubts recently when resolving similar issue https://github.com/arturdm/jacoco-android-gradle-plugin/pull/63/files - whether the plugin should still support previous APIs or not. I went with the support approach.

There's a nice section about backward compatibility in the docs you've sent.

I was also thinking of adding tests that would check if it works with a matrix of different Android plugin and Gradle versions but didn't have time unfortunately.

But according to Android gradle plugin docs the minimum required version of Gradle for the latest Android plugin is already at 4.10.1+ so maybe the plugin should just state that it requires later versions and the plugin could drop obsolete API completely.

@stephanenicolas
Copy link

@arturdm I would suggest not to bother too much about older versions. In our libs we have released a major version update that breaks compatibility and uses only gradle 4.9+ and AGP 3.3+.

trevjonez added a commit to trevjonez/jacoco-android-gradle-plugin that referenced this issue Nov 12, 2019
AGP 3.5.2
gradle task config avoidance. closes arturdm#66 *breaking changes to config DSL
use a "reports/jacoco/unitTest/variant/flavor/type" convention similar to a vanilla java project so that the outputs do not overlap with variants or other coverage reports external to this plugin.
trevjonez added a commit to trevjonez/jacoco-android-gradle-plugin that referenced this issue Nov 12, 2019
AGP 3.5.2
gradle task config avoidance. closes arturdm#66 *breaking changes to config DSL
use a "reports/jacoco/unitTest/variant/flavor/type" convention similar to a vanilla java project so that the outputs do not overlap with variants or other coverage reports external to this plugin.
makes plugin application order non critical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants