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

Allow user to set JDK release #1225

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

quintesse
Copy link
Contributor

Fixes #1224

@quintesse quintesse requested a review from maxandersen January 30, 2022 17:51
@codecov
Copy link

codecov bot commented Jan 30, 2022

Codecov Report

Merging #1225 (38110e2) into main (d683e0a) will increase coverage by 0.02%.
The diff coverage is 71.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1225      +/-   ##
============================================
+ Coverage     58.82%   58.84%   +0.02%     
- Complexity     1057     1058       +1     
============================================
  Files            86       86              
  Lines          5661     5679      +18     
  Branches        954      956       +2     
============================================
+ Hits           3330     3342      +12     
- Misses         1839     1843       +4     
- Partials        492      494       +2     
Flag Coverage Δ
Linux 57.70% <71.42%> (+0.02%) ⬆️
Windows 57.61% <71.42%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/main/java/dev/jbang/util/Util.java 60.59% <66.66%> (+0.16%) ⬆️
src/main/java/dev/jbang/net/JdkManager.java 57.59% <83.33%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3adca1b...38110e2. Read the comment docs.

@maxandersen
Copy link
Collaborator

How is This to be used ? Couldnt find a test ?

@quintesse
Copy link
Contributor Author

Well this is the same as JBANG_JDK_VENDOR, so there is no test, because it would mean testing the download of very specific JDKs which is very time dependent (so right now you can only download a Java 18 EA, but perhaps in a months time it is in GA and trying to get the EA version would fail).

But the way you use it is like this: JBANG_JDK_RELEASE=ea jbang install jdk 18.

Btw, the JBANG_JDK_VENDOR isn't actually documented anywhere, we should probably remedy that and at least explain what they do. They are very specific options though that should only be used by people that really know what they're doing. (In this case I really wanted to install Java 18 EA).

@maxandersen
Copy link
Collaborator

It would be nice //JAVA support something like [vendor:][release]:17[.prefix] in future instead of 3 different JBANG_* env vars...but I like this as a start. Will probably mark these env vars experimental.

@maxandersen
Copy link
Collaborator

@quintesse can you rebase it ? conflicted with the cygwin fix.

@maxandersen
Copy link
Collaborator

a shame this does not work but that's a disco API issue:

JBANG_JDK_VENDOR=oracle JBANG_JDK_RELEASE=ea-loom jbang --java 18

:)

Allows the user to override the JDK release (`ga` or `ea`) when
downloading a JDK by setting `JBANG_JDK_RELEASE`.
Also add support for this variable and for `JBANG_JDK_VENDOR` to the
jbang startup scripts.

Fixes jbangdev#1224
@quintesse
Copy link
Contributor Author

It would be nice //JAVA support something like [vendor:][release]:17[.prefix]

True, but that would probably introduce a bunch of issues that I definitely didn't want to deal with right now hehe

a shame this does not work

Yeah, that would indeed be cool :-)

@quintesse
Copy link
Contributor Author

Rebase done

@maxandersen maxandersen merged commit 08d3512 into jbangdev:main Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow user to set JDK release
2 participants