Skip to content

Commit

Permalink
[macOS] Zulu install for /usr/libexec/java_home does not work (#138)
Browse files Browse the repository at this point in the history
* Release is a file which results in the absolute_dir_path command to fail to return the expected result. Changed it to bin/..

Fixes #137

* Added test to validate the /usr/libexec/java_home working as expected

* Added information to the liberica install about it not being integrated in /usr/libexec/java_home

* Only run the update-data on the main repository
  • Loading branch information
delgurth authored Apr 6, 2021
1 parent 38ca9d0 commit 0010d1f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ jobs:
run: |
. asdf/asdf.sh
asdf plugin-test java "$GITHUB_WORKSPACE" --asdf-plugin-gitref "$GITHUB_SHA" --asdf-tool-version adoptopenjdk-8.0.252+9.1.openj9-0.20.0 java -version
- name: macOS Check java_home integration
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
export ASDF_CONFIG_FILE=${HOME}"/.asdfrc"
echo "java_macos_integration_enable = yes" > "${ASDF_CONFIG_FILE}"
. asdf/asdf.sh
asdf plugin-test java "$GITHUB_WORKSPACE" --asdf-plugin-gitref "$GITHUB_SHA" --asdf-tool-version zulu-8.52.0.23 /usr/libexec/java_home -V 2>&1 | grep "Zulu 8.52.0.23"
if: matrix.os == 'macOS-latest'
1 change: 1 addition & 0 deletions .github/workflows/update-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- cron: '30 */8 * * *'
jobs:
update:
if: github.repository == 'halcyon/asdf-java'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
Expand Down
11 changes: 8 additions & 3 deletions bin/functions
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,17 @@ function install {
mv ./* "${ASDF_INSTALL_PATH}"
if [ "$(get_asdf_config_value "java_macos_integration_enable")" = "yes" ]; then
local macOS_integration_path
macOS_integration_path="$(dirname "$(dirname "$(dirname "$(absolute_dir_path "${ASDF_INSTALL_PATH}/release")")")")"
macOS_integration_path="$(dirname "$(dirname "$(dirname "$(absolute_dir_path "${ASDF_INSTALL_PATH}/bin/..")")")")"
java_macos_integration_install "$macOS_integration_path"
fi
;;
liberica*) mv ./* "${ASDF_INSTALL_PATH}" ;;
*)
liberica*)
mv ./* "${ASDF_INSTALL_PATH}"
if [ "$(get_asdf_config_value "java_macos_integration_enable")" = "yes" ]; then
echo "The ZIP packages of liberica do not contain the required files (Info.plist and the MacOS folder) to make /usr/libexec/java_home work correctly. You need the .pkg version to get those files."
fi
;;
*)
mv Contents/Home/* "${ASDF_INSTALL_PATH}"
if [ "$(get_asdf_config_value "java_macos_integration_enable")" = "yes" ]; then
local macOS_integration_path
Expand Down

0 comments on commit 0010d1f

Please sign in to comment.