Skip to content

Conversation

@maxim-lobanov
Copy link
Contributor

@maxim-lobanov maxim-lobanov commented Mar 19, 2021

Description:
JDK folder on MacOS can contain additional nested folders for some providers.
Previously, we have included these folders to PATH only when download Java from remote. We should do the same when resolve Java from tool-cache. So decide to move this logic to base class to avoid duplication.

image

@maxim-lobanov maxim-lobanov changed the title Fix macos tool cache Add "Contents/Home" postfix on macOS if provider creates it Mar 19, 2021
@sormuras
Copy link

Merging this PR could render my repackage work-around I perform at https://github.com/sormuras/download-jdk action...

    - name: 'Repackage tarball on Mac OS'
      shell: bash
      run: |
        if [ "$RUNNER_OS" == "macOS" ]; then
          echo 'Repackage tarball on Mac OS'
          JDK_EXTRACTED=${HOME}/downloaded-jdk-${{ inputs.feature }}
          mkdir ${JDK_EXTRACTED}
          tar --extract --file ${JDK_FILE} -C ${JDK_EXTRACTED} --strip-components 4
          rm ${JDK_FILE}
          tar --create --file ${JDK_FILE} -C ${HOME} downloaded-jdk-${{ inputs.feature }}
        fi

...superseded.

@maxim-lobanov maxim-lobanov merged commit 502a665 into v2-preview Mar 22, 2021
@maxim-lobanov maxim-lobanov deleted the fix-macos-tool-cache branch March 25, 2021 11:56
maxim-lobanov added a commit that referenced this pull request Apr 5, 2021
* actions/setup-java@v2 - Support different distributions (#132)

* Implement support for custom vendors in setup-java

* minor improvements

* minor refactoring

* Add unit tests and e2e tests

* Update documentation for setup-java@v2 release

* minor improvements

* regenerate dist

* fix comments

* resolve comments

* resolve comments

* fix tests

* Update README.md

Co-authored-by: George Adams <[email protected]>

* Apply suggestions from code review

Co-authored-by: Konrad Pabjan <[email protected]>

* fix minor nitpicks

* handle 4th digit

* pull latest main

* Update README.md

* rename adoptium to adopt

* rename adoptium to adopt

* rename adoptium to adopt

* Update README.md

* make java-version and distribution required for action

* update readme

* fix tests

* fix e2e tests

Co-authored-by: George Adams <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>

* Add "overwrite-settings" input parameter (#136)

* add overwrite-settings parameter

* fix e2e tests

* print debug

* fix e2e tests

* add comment

* remove comment

* Add "Contents/Home" postfix on macOS if provider creates it (#139)

* Update e2e-versions.yml

* Update e2e-versions.yml

* implement fix

* Update e2e-versions.yml

* Update installer.ts

* fix filter logic

* Update e2e-versions.yml

* remove extra logic

* Update e2e-versions.yml

* Add check-latest flag (#141)

* add changes for check-latest

* run prerelease script

* resolving comments

* fixing tests

* fix spelling

* improve core.info messages

* run format

* run prerelease

* change version to fix test

* resolve comment for check-latest

* Update README.md

* added hosted tool cache section

* Apply suggestions from code review

Co-authored-by: Maxim Lobanov <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>

* Avoid "+" sign in Java path in v2-preview (#145)

* try to handle _ versions

* more logs

* more debug

* test 1

* more fixes

* fix typo

* Update e2e-versions.yml

* add unit-tests

* remove debug info from tests

* debug pre-cached versions

* change e2e tests to ubuntu-latest

* update npm licenses

Co-authored-by: George Adams <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>
Co-authored-by: Dmitry Shibanov <[email protected]>
@sormuras
Copy link

sormuras commented Apr 5, 2021

Indeed, after upgrading to setup-java@v2, I could remove the work-around via sormuras/download-jdk@3172171

Any chance to backport this feature to v1?

tdfacer pushed a commit to ifit/setup-java that referenced this pull request Oct 7, 2025
* actions/setup-java@v2 - Support different distributions (actions#132)

* Implement support for custom vendors in setup-java

* minor improvements

* minor refactoring

* Add unit tests and e2e tests

* Update documentation for setup-java@v2 release

* minor improvements

* regenerate dist

* fix comments

* resolve comments

* resolve comments

* fix tests

* Update README.md

Co-authored-by: George Adams <[email protected]>

* Apply suggestions from code review

Co-authored-by: Konrad Pabjan <[email protected]>

* fix minor nitpicks

* handle 4th digit

* pull latest main

* Update README.md

* rename adoptium to adopt

* rename adoptium to adopt

* rename adoptium to adopt

* Update README.md

* make java-version and distribution required for action

* update readme

* fix tests

* fix e2e tests

Co-authored-by: George Adams <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>

* Add "overwrite-settings" input parameter (actions#136)

* add overwrite-settings parameter

* fix e2e tests

* print debug

* fix e2e tests

* add comment

* remove comment

* Add "Contents/Home" postfix on macOS if provider creates it (actions#139)

* Update e2e-versions.yml

* Update e2e-versions.yml

* implement fix

* Update e2e-versions.yml

* Update installer.ts

* fix filter logic

* Update e2e-versions.yml

* remove extra logic

* Update e2e-versions.yml

* Add check-latest flag (actions#141)

* add changes for check-latest

* run prerelease script

* resolving comments

* fixing tests

* fix spelling

* improve core.info messages

* run format

* run prerelease

* change version to fix test

* resolve comment for check-latest

* Update README.md

* added hosted tool cache section

* Apply suggestions from code review

Co-authored-by: Maxim Lobanov <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>

* Avoid "+" sign in Java path in v2-preview (actions#145)

* try to handle _ versions

* more logs

* more debug

* test 1

* more fixes

* fix typo

* Update e2e-versions.yml

* add unit-tests

* remove debug info from tests

* debug pre-cached versions

* change e2e tests to ubuntu-latest

* update npm licenses

Co-authored-by: George Adams <[email protected]>
Co-authored-by: Konrad Pabjan <[email protected]>
Co-authored-by: Dmitry Shibanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants