-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Determine the minimum gradle version based on the wrapper #32226
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,8 +25,13 @@ plugins { | |
|
||
group = 'org.elasticsearch.gradle' | ||
|
||
if (GradleVersion.current() < GradleVersion.version('4.9')) { | ||
throw new GradleException('Gradle 4.9+ is required to build elasticsearch') | ||
Properties wrapper = new Properties() | ||
File wrapperProperties = project == rootProject ? | ||
project.file('../gradle/wrapper/gradle-wrapper.properties') : | ||
rootProject.file('gradle/wrapper/gradle-wrapper.properties') | ||
wrapperProperties.withInputStream { wrapper.load(it) } | ||
if (GradleVersion.current() < GradleVersion.version(wrapper.get('gradleVersion'))) { | ||
throw new GradleException("Gradle ${wrapper.get('gradleVersion')}+ is required to build elasticsearch") | ||
} | ||
|
||
if (JavaVersion.current() < JavaVersion.VERSION_1_8) { | ||
|
@@ -78,6 +83,7 @@ task writeVersionProperties { | |
processResources { | ||
dependsOn writeVersionProperties | ||
from tempPropertiesFile | ||
from wrapperProperties | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should rename this file so it is more obvious what we are using it for. Or maybe not write the entire file, just the version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I initially added the file as is thinking about parsing it from the URL, but then realized that the wrapper know about the version it's going to use. In retrospect I'm not sure why I choose to add it to the properties files, I think the initial idea rooted, it makes much more sense to add a |
||
} | ||
|
||
/***************************************************************************** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip | |
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionSha256Sum=39e2d5803bbd5eaf6c8efe07067b0e5a00235e8c71318642b2ed262920b27721 | ||
gradleVersion=4.9 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This won't be in the file if you regenerate it, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this println isn't accurate any more, right?