Skip to content

Instantly share code, notes, and snippets.

@fuzzyweapon
Created October 13, 2018 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuzzyweapon/0cacb9ef8142e74f30c77e141a6815f2 to your computer and use it in GitHub Desktop.
Save fuzzyweapon/0cacb9ef8142e74f30c77e141a6815f2 to your computer and use it in GitHub Desktop.
Helper function for making registering callsites pretty.
// --- Utility functions -----------------------------------------------
inline fun <reified T : Task> task(noinline configuration: T.() -> Unit) =
tasks.registering(T::class, configuration)
// Usage
val customInstallation by task<Copy> {
description = "Copies latest gradle-kotlin-dsl snapshot over the custom installation."
dependsOn(copyCurrentDistro)
from(distribution)
into("$customInstallationDir/lib")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment