From 4a955c78f4413a714f32e19972e04fb298b418ba Mon Sep 17 00:00:00 2001 From: Serge Guzik Date: Tue, 12 Feb 2019 21:57:33 +0200 Subject: [PATCH] fix: JDK missing if this platform is not targeted --- warp4j | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/warp4j b/warp4j index d6cc337..ee19668 100755 --- a/warp4j +++ b/warp4j @@ -242,6 +242,14 @@ function choose_distro_type() { # actually choose distro type JAVA_DISTRO_TYPE=$(choose_distro_type) +# even if this platform is not targeted, we still need +# a JDK for this platform to optimize JDKs for other platforms +TARGETS_TO_CACHE=${TARGETS[@]} +if [[ $JAVA_DISTRO_TYPE == $DISTRO_TYPE_JDK ]] && # if usind JDK (not JRE) + [[ ${TARGETS[@]} != *"$THIS_PLATFORM"* ]]; then # and this platform is not targeted + TARGETS_TO_CACHE+=($THIS_PLATFORM) +fi + # choose cache path for this platform case $THIS_PLATFORM in $MAC) CACHE_PATH="$HOME/Library/Application Support/warp4j" ;; @@ -453,7 +461,7 @@ function ensure_distro_cached() { } # actually ensure required distro is in cache -for target in ${TARGETS[@]}; do +for target in ${TARGETS_TO_CACHE[@]}; do ensure_distro_cached $target done