Gradle plugin should leverage task configuration avoidance #562
Labels
enhancement
General enhancement
performance
For identifying performance problems or making improvements
plugin
For
PegasusPlugin
, invokingtasks.create
is more heavyweight than the desirabletasks.register
API. For very large projects, this new API can have a significant effect on build configuration time by lazily deferringTask
object instantiation.One caveat - the
TaskContainer#register
API is introduced with Gradle 4.9. Implementing it will effectively break projects who build with a lower version of Gradle when applying thepegasus
plugin. If necessary, backwards-compatibility could be preserved by samplingorg.gradle.util.GradleVersion#current
. But even Gradle 4.9 is quite old and it's reasonable to expect consumers of thepegasus
plugin to be building with Gradle 5 or higher. This could also be caught very early in thePegasusPlugin#apply
method, failing gracefully and warning the user about a minimum required version.Read more about task configuration avoidance here.
The text was updated successfully, but these errors were encountered: