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

Auto download toolchain in test project #143

Merged
merged 1 commit into from
May 15, 2024

Conversation

Arthurm1
Copy link
Contributor

Downloads jdk 17 toolchain if it's not setup locally.

Only for toolchain test

@jdneo
Copy link
Member

jdneo commented May 14, 2024

I haven't dig deep into that issue. But I'm curious about the root cause. Do you have more information?

@Arthurm1
Copy link
Contributor Author

AFAIK Gradle will not download JDKs automatically if it can't find them. It recommends some 3rd party plugins for this: https://docs.gradle.org/current/userguide/toolchains.html#sec:provisioning

It's possible to install JDKs manually and have Gradle recognise them but I've had issues with this on Windows as I think it requires windows registry settings to point it to the JDK locations. I could be wrong on this.

The CI azure pipeline specifies jdk 17 and since Gradle is running on that it can find JDK 17. I imagine if the CI build moved to JDK 21 then this test would fail. This PR should fix that issue although the CI checks may take slightly longer to run.

@jdneo
Copy link
Member

jdneo commented May 15, 2024

I see.

Instead of adding this 3rd party plugin. What about limit the related test cases to only run on java 17 using the annotation @EnabledOnJre({JRE.JAVA_17})?

@Arthurm1
Copy link
Contributor Author

I'm easy - whichever you prefer

@jdneo
Copy link
Member

jdneo commented May 15, 2024

Hmm, thought twice. Consider the java version updates over time, the JDK used in CI pipelines will be updated as well. The benefit of using the plugin is that in the future there is no need to update the test cases any more.

I'll go with your proposal.

@jdneo jdneo added this to the 0.2.0 milestone May 15, 2024
@jdneo jdneo added the engineering Engineering tasks like refactoring, build infra, etc... label May 15, 2024
Copy link
Member

@jdneo jdneo left a comment

Choose a reason for hiding this comment

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

LGTM

@jdneo jdneo merged commit 05179c5 into microsoft:develop May 15, 2024
4 checks passed
@jdneo
Copy link
Member

jdneo commented May 15, 2024

Thank you @Arthurm1!

@Arthurm1 Arthurm1 deleted the auto_download_toolchain branch May 15, 2024 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Engineering tasks like refactoring, build infra, etc...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants