[macOS] Zulu install for /usr/libexec/java_home does not work (#138)

* Release is a file which results in the absolute_dir_path command to fail to return the expected result. Changed it to bin/..

Fixes https://github.com/halcyon/asdf-java/issues/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
This commit is contained in:
Wessel van Norel 2021-04-06 17:54:36 +02:00 committed by GitHub
parent 38ca9d0bcc
commit 0010d1f98d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 3 deletions

View File

@ -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'

View File

@ -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

View File

@ -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