Skip to content

Instantly share code, notes, and snippets.

@deeTEEcee
Last active February 19, 2020 01:54
Show Gist options
  • Save deeTEEcee/92c2c3a85b0d8ea8b2286ac662649d4d to your computer and use it in GitHub Desktop.
Save deeTEEcee/92c2c3a85b0d8ea8b2286ac662649d4d to your computer and use it in GitHub Desktop.
Gradle + Kotlin Helpers

Dependency management

With any new projects using gradle, this is a key point to start. Try using the 'com.palantir.consistent-versions' plugin.

Gradle helper methods

I ran into an issue where a gradle plugin had stated they had a method called 'getVersion' but I couldn't use it. This was the solution to retrieve that method that the plugin had supported:

val packageGetVersion : groovy.lang.Closure<String> = project.ext["getVersion"] as groovy.lang.Closure<String>
doLast {
  packageGetVersion(arg1, arg2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment