Skip to content

Commit

Permalink
move to --wsl option
Browse files Browse the repository at this point in the history
  • Loading branch information
Scanteianu committed Jan 30, 2025
1 parent 77e592d commit f7c453d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 0 additions & 4 deletions configureBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ setVariablesForConfigure() {
BUILD_CONFIG[TEST_IMAGE_PATH]=$openjdk_test_image_path
BUILD_CONFIG[DEBUG_IMAGE_PATH]=$openjdk_debug_image_path
BUILD_CONFIG[STATIC_LIBS_IMAGE_PATH]=$static_libs_path
if ! [[ -z ${WSL+x} ]]; then
echo "building in wsl mode"
BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu"
fi
}

# Set the repository to build from, defaults to adoptium if not set by the user
Expand Down
15 changes: 9 additions & 6 deletions sbin/common/config_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ function parseConfigurationArguments() {

"--docker" )
BUILD_CONFIG[CONTAINER_COMMAND]="docker";
if setCustomImage "${1-}"; then shift ; fi
if setCustomImage "${1-}"; then shift ; fi
;;

"--podman" )
BUILD_CONFIG[CONTAINER_COMMAND]="podman";
if setCustomImage "${1-}"; then shift ; fi
if setCustomImage "${1-}"; then shift ; fi
;;

"--debug-docker" )
Expand Down Expand Up @@ -407,6 +407,9 @@ function parseConfigurationArguments() {
"--jvm-variant" | "-V" )
BUILD_CONFIG[JVM_VARIANT]="$1"; shift;;

"--wsl" )
BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]+="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu ";;

*) echo >&2 "Invalid build.sh option: ${opt}"; exit 1;;
esac
done
Expand Down Expand Up @@ -434,22 +437,22 @@ function setCustomImage() {
local imageCandidate="${1}"
# is next param empty?
if [[ -z ${imageCandidate} ]] ; then
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
return 1
fi
# is the next parameter a switch?
if [[ ${imageCandidate} == -* ]] ; then
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
return 1
fi
# is the next param a main arg?
if checkOpenJdkVersion "${imageCandidate}" ; then
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
return 1
fi
# not empty, not switch, not main arg - therefore it must be an image, use it
BUILD_CONFIG[CONTAINER_IMAGE]="${imageCandidate}"
echo "base image will be set to: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
echo "base image will be set to: ${BUILD_CONFIG[CONTAINER_IMAGE]}"
return 0
}

Expand Down

0 comments on commit f7c453d

Please sign in to comment.