setup-java icon indicating copy to clipboard operation
setup-java copied to clipboard

Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular

Open mhoffrog opened this issue 2 years ago • 8 comments

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 updates env.JAVA_HOME with the path of java installed. In order to skip update of JAVA_HOME, set this to false. 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>/bin to env.PATH. In order to skip this, set this to false.

  • update-toolchains-only: If set to true, then overwrite-settings, update-env-javahome and update-env-path are propagated to false if the specific one is not explicitly configured to true. Only a toolchain entry will be added to toolchains.xml. Default is false.

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 (within setup-java.ts only) 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.

mhoffrog avatar Nov 07 '23 14:11 mhoffrog

@IvanZosimov is there anything I can do in addition to get this PR merged?

mhoffrog avatar Dec 28 '23 13:12 mhoffrog

@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.

mhoffrog avatar Jan 31 '24 18:01 mhoffrog

@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action.

mhoffrog avatar Feb 29 '24 20:02 mhoffrog

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

mhoffrog avatar Apr 07 '24 18:04 mhoffrog

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

mhoffrog avatar Jul 19 '24 13:07 mhoffrog

@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action Check dist

mhoffrog avatar Aug 23 '24 22:08 mhoffrog