gradle-guide CURRENTLY IN PROGRESS A guide for writing good Gradle plugins and a plugin to check for bad Gradle code. Table of Contents Introduction What is this guide? In the lair of the complexity demon Background: What is a Gradle file? .gradle files Gradle script Groovy <-> Java transliteration settings.gradle file build.gradle files Anatomy of a Gradle Plugin A simple motivating example Plugins Extensions Tasks Next steps Managed Types and Properties Managed types Tasks Lifecycle of a Gradle Build Starting the build Settings evaluation Configuration phase Task dependency graph calculation Task execution Build finish Avoiding Unnecessary Configuration Lazy task registration Using TaskProviders Accessing tasks lazily Lazy Configuration registration Other types Testing and running your plugins Testing locally Running your plugin in other repos locally Debugging your Gradle plugin running on a different repo Running your plugin in other repos on CI Adopting the Configuration Cache How does Configuration Caching work? Finding Configuration Cache problems Solving Configuration Cache problems Two strategies to write Configuration Cache friendly Gradle Diagnosing Build Performance Expectations of performance Finding a build scan Tasks: How to diagnose performance issues Configuration: How to diagnose performance issues Common perf issues