Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular
09-Nov-2023: Amended commit comments only.
Description: The following input items have been added (copied from README.md update):
-
update-env-javahome: By default action updatesenv.JAVA_HOMEwith the path of java installed. In order to skip update of JAVA_HOME, set this tofalse. The creation of the env variable JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }} is NOT affected by this item. That will be created for any setup. -
update-env-path: By default action adds<java_install_dir>/bintoenv.PATH. In order to skip this, set this tofalse. -
update-toolchains-only: If set to true, thenoverwrite-settings,update-env-javahomeandupdate-env-pathare propagated tofalseif the specific one is not explicitly configured totrue. Only a toolchain entry will be added to toolchains.xml. Default isfalse.
Summary on a few code improvements (Inserted by 09-Nov-2023): By that implementation I did a few code improvements as follows:
setup-java.ts:- renamed interface installerInputsOptions -> IInstallerInputsOption and moved the definition to the top of the source file to levarage readability
- input values for
overwrite-settings- plus the ones I did add - are read now once only in a single code place (withinsetup-java.tsonly) to a constant and pass their effective values either by method parameters or by object fields to other places during the runtime lifecycle - variable naming within
toolchains.ts - minor improvements of wording on log messages regarding toolchains.xml updates.
Further particular details on the code changes can be taken from my commit comment https://github.com/actions/setup-java/commit/b0dadd279479dcb798d4d5ab673fbd3c27b7fb0b.
Related issue: #552
Check list:
- [x] Mark if documentation changes are required.
:bulb: Documentation has been updated by this PR - [ ] Mark if tests were added or updated to cover the changes.
@IvanZosimov is there anything I can do in addition to get this PR merged?
@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.
@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist