Require a minimum Gradle version instead of a specific version

Allows the use of a more sensible range of Gradle versions.
This commit is contained in:
Raul Tambre 2019-06-30 09:22:49 +03:00 committed by Ryan Kurtz
parent 4d31ed9db4
commit c80d84350b

View File

@ -8,8 +8,11 @@ apply from: "gradle/support/eclipseLauncher.gradle"
/***************************************************************************************
* Make sure the correct version of gradle is being used
***************************************************************************************/
if (gradle.gradleVersion != "5.0") {
throw new GradleException("Requires Gradle 5.0, but was run with $gradle.gradleVersion")
import org.gradle.util.GradleVersion;
final GradleVersion minimum_version = GradleVersion.version('5.0')
if (GradleVersion.current() < minimum_version) {
throw new GradleException("Requires at least $minimum_version, but was ran with $gradle.gradleVersion")
}
/***************************************************************************************