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

Rework how disabling of toolchain detection works #184

Merged
merged 4 commits into from
Dec 20, 2021
Merged

Conversation

melix
Copy link
Collaborator

@melix melix commented Dec 20, 2021

Disabling the toolchain detection by tasks wasn't sufficient,
because Gradle would use the nested BaseImageOptions as an input,
and even if the particular JavaLauchner input wasn't used if that
flag was disabled, it would still be used internally by Gradle to
snapshot inputs.

As a consequence, the fix only worked if Gradle actually detected
a GraalVM installation somewhere, even if it didn't use it!

To fix this, this commit introduces a top-level DSL method called
disableToolchainDetection() which effectively sets the toolchain
to null by convention. By making the toolchain optional and null
now Gradle wouldn't complain anymore.

Fixes #183

Disabling the toolchain detection by tasks wasn't sufficient,
because Gradle would use the nested `BaseImageOptions` as an input,
and even if the particular `JavaLauchner` input wasn't used if that
flag was disabled, it would still be used internally by Gradle to
snapshot inputs.

As a consequence, the fix only worked if Gradle actually detected
a GraalVM installation somewhere, even if it didn't use it!

To fix this, this commit introduces a top-level DSL method called
`disableToolchainDetection()` which effectively sets the toolchain
to `null` by convention. By making the toolchain optional and null
now Gradle wouldn't complain anymore.

Fixes #183
@melix melix added bug Something isn't working gradle-plugin Related to Gradle plugin labels Dec 20, 2021
@melix melix added this to the 0.9.9 milestone Dec 20, 2021
@melix melix requested a review from sdeleuze December 20, 2021 10:00
@melix melix self-assigned this Dec 20, 2021
Copy link
Collaborator

@sdeleuze sdeleuze left a comment

Choose a reason for hiding this comment

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

Works as expected with 88219c4, thanks!

@melix melix merged commit 5185131 into master Dec 20, 2021
@melix melix deleted the cc/issue-183 branch December 20, 2021 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gradle-plugin Related to Gradle plugin oracle-emp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce disableToolchainDetection DSL property and fix toolchain handling in BaseNativeImageOptions
3 participants