From 51337c59d061aa1643972ec6889000753335240a Mon Sep 17 00:00:00 2001 From: david Date: Wed, 15 May 2024 06:46:06 +0200 Subject: [PATCH] Removing binutils and using correct strip depending on java version --- Dockerfile | 1 - warp4j | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3206eca..6fb222a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,5 @@ FROM debian:stable-slim RUN apt-get update && apt-get install -y \ - binutils \ curl \ file \ unzip \ diff --git a/warp4j b/warp4j index b9bd5a0..9e99ed6 100755 --- a/warp4j +++ b/warp4j @@ -682,15 +682,19 @@ function create_optimized_runtime() { local platform=$1 local machine=$2 local jmods=$JAVA_DOWNLOAD_PATH/$platform/$machine/$CONCRETE_JAVA_VERSION/$UNPACKED_SUBDIR/jmods + local strip-debug=strip-debug echo "Creating minimal runtime for $platform..." - echo "$JLINK --no-header-files --no-man-pages --strip-debug --module-path '$jmods' --add-modules $MODULES --output '$BUNDLES_PATH/$platform/$machine/$BUNDLED_DISTRO_SUBDIR'" + if [[ $JAVA_VERSION_BASE >= 13 ]]; then + $strip-debug=strip-java-debug-attributes + fi + echo "$JLINK --no-header-files --no-man-pages --$strip-debug --module-path '$jmods' --add-modules $MODULES --output '$BUNDLES_PATH/$platform/$BUNDLED_DISTRO_SUBDIR'" "$JLINK" \ --no-header-files \ --no-man-pages \ - --strip-debug \ + --$strip-debug \ --module-path "$jmods" \ --add-modules $MODULES \ - --output "$BUNDLES_PATH/$platform/$machine/$BUNDLED_DISTRO_SUBDIR" + --output "$BUNDLES_PATH/$platform/$BUNDLED_DISTRO_SUBDIR" fail_if $? "Failed to optimize runtime" }