Enhancing core types with extension methods

Hello everyone,

I’ve been thinking about enhancing some core types with additional methods. These enhancements come in two flavors: Groovy module extensions, and Kotlin method extensions.

Currently the code is packaged as a plugin and explicitly applied in a build file, however extensions do not take hold. It appears to me this use case is too late in the game for Gradle to load the new behavior.

It probably would work if placed under buildSrc or make them part of the init (however this requires changing the Gradle distro, bad if you rely on the Gradle wrapper and consume a standard distro instead of a custom one).

What would be the recommended way to package, distribute, and apply such extensions?