Skip to content

Fix Scala test compile Java home usage #1481

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

Merged
merged 1 commit into from
Jun 4, 2020

Conversation

jbaiera
Copy link
Member

@jbaiera jbaiera commented May 28, 2020

Setting the java home property was only done on the regular Scala compile task. It should be set on all Scala compile tasks instead.

@jbaiera jbaiera requested a review from mark-vieira June 3, 2020 19:46
@jbaiera jbaiera merged commit 97a8690 into elastic:master Jun 4, 2020
@jbaiera jbaiera deleted the fix-test-compile-java-version branch June 4, 2020 18:21
jbaiera added a commit that referenced this pull request Jun 4, 2020
Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

One comment, otherwise, LGTM.

@@ -55,10 +55,10 @@ configurations.all { Configuration conf ->
tasks.withType(ScalaCompile) { ScalaCompile task ->
task.sourceCompatibility = project.ext.minimumRuntimeVersion
task.targetCompatibility = project.ext.minimumRuntimeVersion
task.options.forkOptions.executable = new File(project.ext.runtimeJavaHome, 'bin/java').canonicalPath
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a compelling reason to use canonicalPath here? There's a performance cost to doing so as resolving a canonical path involves file IO at configuration time.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll put up a quick fix for this then. I was following the same approach that the Gradle internals are doing, but I suppose if they're already getting the canonical file, we don't have to here.

@jbaiera
Copy link
Member Author

jbaiera commented Jul 14, 2020

Relates #1423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants