-
Notifications
You must be signed in to change notification settings - Fork 743
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
Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular #553
base: main
Are you sure you want to change the base?
Add a toolchain only - control update of settings.xml, toolchains.xml, JAVA_HOME and PATH more granular #553
Conversation
1c8123d
to
e7b1371
Compare
@IvanZosimov is there anything I can do in addition to get this PR merged? |
3f983c4
to
230bb6e
Compare
@IvanZosimov PR branch is re-based to current main and dist scripts did pass |
230bb6e
to
598ae60
Compare
@IvanZosimov PR branch is re-based to current main and dist scripts did pass Check dist action. |
b8f4969
to
993bbb6
Compare
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action |
4f3734a
to
2f3fa47
Compare
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action |
…nv-path' Changes in detail: ------------------ - action.yml: - add inputs: - update-toolchains-only - update-env-javahome - add-to-env-path - update description for input "overwrite-settings" - remove default value of input "overwrite-settings", since the default is now propagated from input 'update-toolchains-only' - base-models.ts: - extend interface JavaInstallerOptions: - add fields: - updateEnvJavaHome: boolean; - addToEnvPath: boolean; - constants.ts: - add constant INPUT_UPDATE_TOOLCHAINS_ONLY = 'update-toolchains-only' - auth.ts: - function configureAuthentication(): - add parameter: - overwriteSettings: boolean - remove the now obsolete const overwriteSettings - toolchains.ts: - function configureToolchains(...): - add parameter updateToolchains: boolean - remove the now obsolete const overwriteSettings - improve variable naming: - rename any occurrence of 'overwriteSettings' by 'updateToolchains' - add field updateToolchains: boolean to the parameter object - function writeToolchainsFileToDisk(...): - improve variable naming: - rename variable 'settingsExists' by 'toolchainsExists' - update wording of info logs to be more applicable - setup-java.ts: - interface installerInputsOptions: - rename to IInstallerInputsOption to meet common coding convention - add fields: - updateToolchainsOnly: boolean; - overwriteSettings: boolean; - updateEnvJavaHome: boolean; - addToEnvPath: boolean; - function run(): - add const: - const updateToolchainsOnly: - get as boolean from input 'update-toolchains-only', default: false - const overwriteSettings: - get as boolean from input 'overwrite-settings', default: !updateToolchainsOnly - const updateEnvJavaHome: - get as boolean input 'update-env-javahome', default: !updateToolchainsOnly - const addToEnvPath: - get as boolean input 'add-to-env-path', default: !updateToolchainsOnly - extend const installerInputsOptions to match with IInstallerInputsOption: - add field updateToolchainsOnly - add field overwriteSettings - add field updateEnvJavaHome - add field addToEnvPath - update call of auth.configureAuthentication() to auth.configureAuthentication(overwriteSettings) - function installVersion(...): - add const and init from parameter options: - updateToolchainsOnly, overwriteSettings, updateEnvJavaHome, addToEnvPath - init the additional fields of installerInputsOptions accordingly - call toolchains.configureToolchains(...): - with parameter updateToolchains= overwriteSettings || updateToolchainsOnly - base-installer.ts: - add constants to import from constants: - INPUT_UPDATE_JAVA_HOME - INPUT_ADD_TO_PATH - add fields: - protected updateEnvJavaHome: boolean; - protected addToEnvPath: boolean; - ctor: - init these fields from JavaInstallerOptions accoprdingly - function setJavaDefault(...): - if updateEnvJavaHome is false: - SKIP updating env.JAVA_HOME - log info: `Skip updating env.JAVA_HOME according to ${INPUT_UPDATE_JAVA_HOME}` - if addToEnvPath is false: - SKIP adding toolchain path to env.PATH - log info: `Skip adding to env.PATH according to ${INPUT_ADD_TO_PATH}`
- missed in initial commit - took re-built dist from GH actions
2f3fa47
to
8bb7cab
Compare
@mahabaleshwars @IvanZosimov FYI - PR branch is re-based to current main and dist scripts did pass action |
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_HOME
with 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>/bin
toenv.PATH
. In order to skip this, set this tofalse
.update-toolchains-only
: If set to true, thenoverwrite-settings
,update-env-javahome
andupdate-env-path
are propagated tofalse
if 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
:overwrite-settings
- plus the ones I did add - are read now once only in a single code place (withinsetup-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 lifecycletoolchains.ts
Further particular details on the code changes can be taken from my commit comment b0dadd2.
Related issue:
#552
Check list:
💡 Documentation has been updated by this PR