Last active
August 29, 2015 14:04
-
-
Save Jween/039f4625b69d598b856d to your computer and use it in GitHub Desktop.
determine gradle version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// returns true if greater, null if equal, false otherwise | |
def gradleAfter = { | |
[ | |
gradle.gradleVersion.tokenize('.')*.toInteger(), | |
it.toString().tokenize('.')*.toInteger() | |
].transpose().inject(null){ result, item -> | |
result != null ?: | |
(item[0] > item[1] ?: item[0] == item[1] ? null : false); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when you need to use a new method in a later gradle version, try as follow: