Fix minor and major version computation
@@ -54,16 +54,14 @@ if (project.hasProperty('jdkVersion')) {
}
}
-
-
// Hadoop validation
if (! hadoopVersion.startsWith('2.')) {
throw new GradleScriptException("Only Hadoop 2.x is supported: " + hadoopVersion);
}
-def gradleVersionDotIdx = project.gradle.gradleVersion.indexOf(".")
-ext.gradleVersionMajor = Integer.parseInt(project.gradle.gradleVersion.substring(0, gradleVersionDotIdx))
-ext.gradleVersionMinor = Integer.parseInt(project.gradle.gradleVersion.substring(gradleVersionDotIdx + 1))
+def gradleVersions = project.gradle.gradleVersion.tokenize(".")
+ext.gradleVersionMajor = Integer.parseInt(gradleVersions[0])
+ext.gradleVersionMinor = Integer.parseInt(gradleVersions[1])
println "Detected Gradle version major=" + gradleVersionMajor + " minor=" + gradleVersionMinor
ext.dropwizardMetricsVersion = '3.1.0'
