-
Notifications
You must be signed in to change notification settings - Fork 1k
Adapt to upstream for type safe build globals #1388
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
Adapt to upstream for type safe build globals #1388
Conversation
This commit adapts the elasticsearch-hadoop build to an upstream change to make some build globals type safe. In particular, we adapt the usage of Java versions.
jbaiera
left a comment
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.
LGTM
jakelandis
left a comment
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.
LGTM
mark-vieira
left a comment
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.
@jasontedor thanks for doing this. There's some room for further refactoring to use BuildParams over extra properties. If this PR is just enough to get things to work I'm good with than and would be glad to tackle the more substantial cleanup myself.
| project.ext.revHash = project.rootProject.ext.revHash | ||
| project.ext.javaVersions = project.rootProject.ext.javaVersions | ||
| project.ext.javaVersions = BuildParams.javaVersions | ||
| project.ext.isRuntimeJavaHomeSet = project.rootProject.ext.isRuntimeJavaHomeSet |
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.
isRuntimeJavaHomeSet has been replaced by a property on BuildParams a well
| project.ext.gitHead = project.rootProject.ext.gitHead | ||
| project.ext.revHash = project.rootProject.ext.revHash | ||
| project.ext.javaVersions = project.rootProject.ext.javaVersions | ||
| project.ext.javaVersions = BuildParams.javaVersions |
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.
Is setting these extra properties strictly necessary? We should be better off replacing their usages with direct usage of BuildParams.
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.
Looks like we are overriding these up further in this plugin as well. If hadoop is using it's own logic to set runtime java home we should use BuildParams.init() to set those values instead of continuing the practice of using extra properties.
| /** Return the java home used by this node. */ | ||
| String getJavaHome() { | ||
| return javaVersion == null ? project.runtimeJavaHome : project.javaVersions.find { it.version == javaVersion }.javaHome.absolutePath | ||
| return javaVersion == null ? project.runtimeJavaHome : BuildParams.javaVersions.find { it.version == javaVersion }.javaHome.absolutePath |
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.
Assuming we refactor out usages of extra properties completely, we can replace project.runtimeJavaHome with the BuildParams variant.
|
@mark-vieira Yes, this is enough to make the build successful. I would be happy if you could pick up the follow-ups. |
This commit adapts the elasticsearch-hadoop build to an upstream change to make some build globals type safe. In particular, we adapt the usage of Java versions.
This commit adapts the elasticsearch-hadoop build to an upstream change to make some build globals type safe. In particular, we adapt the usage of Java versions.
Relates elastic/elasticsearch#48778