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
feat: CORDOVA_JAVA_HOME env variable #1229
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1229 +/- ##
==========================================
+ Coverage 71.95% 72.02% +0.06%
==========================================
Files 21 21
Lines 1694 1698 +4
==========================================
+ Hits 1219 1223 +4
Misses 475 475
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a comment, but it is nitpicking, so feel free to look at it, and address it, ignore it, or give your opinion about my comment.
Minor, and discussable off course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff!
Thanks for the review @PieterVanPoyer Just going to push a new commit to fix the test faliure that occurs windows (stupid path separator differences....) |
916f69a
to
21d91fc
Compare
* feat: CORDOVA_JAVA_HOME env variable * refactor: Improve CORDOVA_JAVA_HOME env test * fix(test) path separator issue
* feat: CORDOVA_JAVA_HOME env variable * refactor: Improve CORDOVA_JAVA_HOME env test * fix(test) path separator issue
This is not documented in older v10 https://cordova.apache.org/docs/en/10.x/guide/platforms/android/index.html but only in v10 release notes |
As of cordova 11.1 CORDOVA_JAVA_HOME is silently being used over JAVA_HOME
i.e. for my setup jdk11 is used for cordova instead of jdk17 default in JAVA_HOME and on PATH |
Thanks for pointing this out, I created an issue as a self reminder in our docs repo: apache/cordova-docs#1292 |
Platforms affected
Android
Motivation and Context
It's been a requested feature (not formally, but in variety of bug tickets of people trying to use java >8) because often times, we are stuck on using older Java versions
due to the Android SDK. This will make it easier for users to have multiple java versions installed.
Description
If
CORDOVA_JAVA_HOME
is present, it will overrideJAVA_HOME
environment variable for the execution context of Cordova.Testing
Unit test added. All existing tests passes. Manual testing.
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)