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

Update minimum gradle version and remove assumption around target compatibility #18595

Merged
merged 2 commits into from
May 27, 2016

Conversation

javanna
Copy link
Member

@javanna javanna commented May 26, 2016

Up until now we assumed that we always compile with java 8 or java 9 and never with targetCompatibility lower than 1.8. This will be necessary with the upcoming java http client as it will be 1.7 compatible. We should then apply specific options only when using 1.8 or 1.9.

Also by upgrading the minimum required gradle version to 2.13 we better support subprojects that need to compile against different target versions as there were previously issues with the intellij integration around that.

@javanna javanna added review :Delivery/Build Build or test infrastructure v5.0.0-alpha3 labels May 26, 2016
@javanna
Copy link
Member Author

javanna commented May 26, 2016

@rjernst can you have a look please? This is working in my branch but I may have missed something :)

@javanna javanna changed the title Update minimum gradle version and remove assumption Update minimum gradle version and remove assumption around target compatibility May 26, 2016
options.forkOptions.memoryMaximumSize = "1g"
if (targetCompatibility == '1.8' || targetCompatibility == '1.9') {
options.fork = true
options.forkOptions.executable = new File(project.javaHome, 'bin/javac')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume we will be using java 8 to compile java 7? In that case, i don't see why we need to conditionalize any of the fork options. It seems like it should only be the compact profile arg that is conditionalized below?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, I pushed a new commit to fix that

@@ -372,18 +372,20 @@ class BuildPlugin implements Plugin<Project> {
options.fork = true
options.forkOptions.executable = new File(project.javaHome, 'bin/javac')
options.forkOptions.memoryMaximumSize = "1g"
if (targetCompatibility == '1.8' || targetCompatibility == '1.9') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually set targetCompatibility to a value from gradle's JavaVersion enum. So this comparison can be something like:

if (targetCompatibility >= JavaVersion.VERSION_1_8) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, I was not sure about that, thanks for bringing that up

@rjernst
Copy link
Member

rjernst commented May 27, 2016

LGTM, I left one more minor request.

@javanna javanna force-pushed the enhancement/gradle_2.13 branch 2 times, most recently from f07b98a to 28663b3 Compare May 27, 2016 09:35
It came out with improvements around idea integration and language levels. This will make it possible to have the upcoming java client as a new project compiled against java 7 and have idea working on the right language level.
This change makes it possible to compile a separate project with e.g. targetCompatibility 1.7. Adds specific options (compact profile) only when compiling for >= 1.8.
@javanna javanna merged commit 5794108 into elastic:master May 27, 2016
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team v5.0.0-alpha3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants