How to write Gradle plugins (in Kotlin)
summary
Explains how to implement a real Gradle plugin in Kotlin: creates an extension with enabled and dirs properties, registers a task class with @TaskAction and @OutputFile/@InputFiles annotations, uses Gradle TestKit for functional tests, and wires an always-running helper task to generate a stable input file so up-to-date checks and the build cache work. Example plugin reads and counts lines from given file paths, produces an output file, and demonstrates caching against a local build cache.
AI-written summary · about
chapters (14)
- 0:00Start
- 1:44Agenda
- 4:50Example Project
- 5:40Gradle Kotlin Dsl
- 8:44Hierarchy
- 10:16Java Gradle Plugin
- 10:49The Gradle Api Dependency
- 13:39The Java Gradle Plug-In Development Plug-In
- 14:41Implementation Class
- 16:18Testing
- 17:11Class Pass Method
- 19:38Extensions to Gradle
- 22:15Recap
- 33:36Recap Everything
related talks
33mUnderstanding Gradle and writing your own Gradle Plugin
43mWriting Your First Kotlin Compiler Plugin
51mGradle Plugin, Take Control of the Build!
38mGradle Without The Guesswork: A Guide for Kotlin Developers
22mIntegrating Kotlin Code into the Gradle Build Process
36mWriting a Kotlin Compiler Plugin
21mMake Gradle work for you, create your own tasks and plugins
50mThe Kotlin DSL experience in Gradle
