Skip to content

Commit

Permalink
Add new build arg option to specify an existing folder for openjdk bu…
Browse files Browse the repository at this point in the history
…ild output

Signed-off-by: Andrew Leonard <[email protected]>
  • Loading branch information
andrew-m-leonard committed Mar 11, 2024
1 parent 1fc6523 commit 04c823d
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ checkoutAndCloneOpenJDKGitRepo() {

git clean -ffdx

# If a user supplied OpenJDK build root directory has been specified and it is not empty
# then fail with an error, we don't want to delete it in case user has specified a wrong directory
if [[ ! -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ]] && [[ "$(ls -A ${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]})" ]]; then
echo "ERROR: User supplied OpenJDK build root directory ${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]} is not empty"
exit 1
fi

updateOpenj9Sources

createSourceTagFile
Expand Down Expand Up @@ -305,6 +298,17 @@ createWorkspace() {
umask 022
mkdir -p "${BUILD_CONFIG[WORKSPACE_DIR]}" || exit
mkdir -p "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}" || exit

# If a user supplied OpenJDK build root directory has been specified and it is not empty
# then fail with an error, we don't want to delete it in case user has specified a wrong directory
# Ensure the directory is created if it doesn't exist
if [[ ! -z "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ]]; then
if [[ -d "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" ]] && [[ "$(ls -A ${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]})" ]]; then
echo "ERROR: Existing user supplied OpenJDK build root directory ${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]} is not empty"
exit 1
fi
mkdir -p "${BUILD_CONFIG[USER_OPENJDK_BUILD_ROOT_DIRECTORY]}" || exit
fi
}

# ALSA first for sound
Expand Down

0 comments on commit 04c823d

Please sign in to comment.