Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move gradle version check to global build info plugin #57255

Merged
merged 1 commit into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ plugins {

group = 'org.elasticsearch.gradle'

String minimumGradleVersion = file('src/main/resources/minimumGradleVersion').text.trim()
if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {
throw new GradleException("Gradle ${minimumGradleVersion}+ is required to build elasticsearch")
}

if (project == rootProject) {
// change the build dir used during build init, so that doing a clean
// won't wipe out the buildscript jar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ class BuildPlugin implements Plugin<Project> {
+ 'elasticsearch.standalone-rest-test, and elasticsearch.build '
+ 'are mutually exclusive')
}
String minimumGradleVersion = null
InputStream is = getClass().getResourceAsStream("/minimumGradleVersion")
try {
minimumGradleVersion = IOUtils.toString(is, StandardCharsets.UTF_8.toString())
} finally {
is.close()
}
if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion.trim())) {
throw new GradleException(
"Gradle ${minimumGradleVersion}+ is required to use elasticsearch.build plugin"
)
}
project.pluginManager.apply('elasticsearch.java')
configureLicenseAndNotice(project)
project.pluginManager.apply('elasticsearch.publish')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public void apply(Project project) {
if (project != project.getRootProject()) {
throw new IllegalStateException(this.getClass().getName() + " can only be applied to the root project.");
}
GradleVersion minimumGradleVersion = GradleVersion.version(Util.getResourceContents("/minimumGradleVersion"));
if (GradleVersion.current().compareTo(minimumGradleVersion) < 0) {
throw new GradleException("Gradle " + minimumGradleVersion.getVersion() + "+ is required");
}

JavaVersion minimumCompilerVersion = JavaVersion.toVersion(Util.getResourceContents("/minimumCompilerVersion"));
JavaVersion minimumRuntimeVersion = JavaVersion.toVersion(Util.getResourceContents("/minimumRuntimeVersion"));
Expand Down