From 335043e6fb3c6e751ab432fc188cba4759861cef Mon Sep 17 00:00:00 2001 From: James Baiera Date: Thu, 26 Mar 2020 16:12:59 -0400 Subject: [PATCH] Fix usage of the GlobalBuildInfoPlugin (#1453) --- .../hadoop/gradle/BaseBuildPlugin.groovy | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BaseBuildPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BaseBuildPlugin.groovy index af03ec2f0..b0f3da003 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BaseBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/hadoop/gradle/BaseBuildPlugin.groovy @@ -20,7 +20,6 @@ package org.elasticsearch.hadoop.gradle import org.elasticsearch.gradle.info.BuildParams -import org.elasticsearch.gradle.info.GenerateGlobalBuildInfoTask import org.elasticsearch.gradle.info.GlobalBuildInfoPlugin import org.elasticsearch.gradle.info.JavaHome import org.elasticsearch.hadoop.gradle.util.Resources @@ -64,6 +63,7 @@ class BaseBuildPlugin implements Plugin { if (!project.rootProject.ext.has('buildInfoConfigured')) { JavaVersion minimumRuntimeVersion = JavaVersion.toVersion(Resources.getResourceContents("/minimumRuntimeVersion")) + println "Min runtime: ${minimumRuntimeVersion}" // We snap the runtime to java 8 since Hadoop needs to see some significant // upgrades to support any runtime higher than that @@ -77,12 +77,14 @@ class BaseBuildPlugin implements Plugin { } // Set on global build info - GenerateGlobalBuildInfoTask generateTask = project.getTasks().getByName("generateGlobalBuildInfo") as GenerateGlobalBuildInfoTask - generateTask.setMinimumRuntimeVersion(minimumRuntimeVersion) - generateTask.setRuntimeJavaHome(esHadoopRuntimeJava.javaHome.getAbsoluteFile()) + BuildParams.init { params -> + params.setMinimumRuntimeVersion(minimumRuntimeVersion) + params.setRuntimeJavaVersion(minimumRuntimeVersion) + params.setRuntimeJavaHome(esHadoopRuntimeJava.javaHome.get()) + } // Set on build settings - project.rootProject.ext.runtimeJavaHome = esHadoopRuntimeJava.javaHome.getAbsoluteFile() + project.rootProject.ext.runtimeJavaHome = esHadoopRuntimeJava.javaHome.get() project.rootProject.ext.minimumRuntimeVersion = minimumRuntimeVersion project.rootProject.ext.buildInfoConfigured = true