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

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Aug 23, 2024

  1. Add inputs 'update-toolchains-only', 'update-env-javahome', 'add-to-e…

    …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}`
    mhoffrog committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    19a6381 View commit details
    Browse the repository at this point in the history
  2. Update README.md

    mhoffrog committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    a368241 View commit details
    Browse the repository at this point in the history
  3. Update from npm run format to fix prettier check

    - missed in initial commit
    - took re-built dist from GH actions
    mhoffrog committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    d299400 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8bb7cab View commit details
    Browse the repository at this point in the history