Skip to content

Commit

Permalink
Archive the test image for after the fact testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Aug 27, 2019
1 parent 80b59e0 commit 3164246
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions configureBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ setVariablesForConfigure() {
else
local jdk_path="jdk"
local jre_path="jre"
local test_image_path="test"
case "${BUILD_CONFIG[OS_KERNEL_NAME]}" in
"darwin")
local jdk_path="jdk-bundle/jdk-*.jdk"
local jre_path="jre-bundle/jre-*.jre"
;;
esac
# Test image is JDK 11+ only
BUILD_CONFIG[TEST_IMAGE_PATH]=$test_image_path
fi

BUILD_CONFIG[JDK_PATH]=$jdk_path
Expand Down
22 changes: 21 additions & 1 deletion sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,16 @@ getJreArchivePath() {
echo "${jdkArchivePath}-jre"
}

getTestImageArchivePath() {
local jdkArchivePath=$(getJdkArchivePath)
echo "${jdkArchivePath}-test-image"
}

# Clean up
removingUnnecessaryFiles() {
local jdkTargetPath=$(getJdkArchivePath)
local jreTargetPath=$(getJreArchivePath)
local testImageTargetPath=$(getTestImageArchivePath)

echo "Removing unnecessary files now..."

Expand Down Expand Up @@ -521,6 +527,14 @@ removingUnnecessaryFiles() {
rm -rf "${dirToRemove}"/demo/jfc/Font2DTest || true
rm -rf "${dirToRemove}"/demo/jfc/SwingApplet || true
fi
# Test image is JDK 11+ only so add an additional
# check if the config is set
if [ ! -z "${BUILD_CONFIG[TEST_IMAGE_PATH]}" ] && [ -d "$(ls -d ${BUILD_CONFIG[TEST_IMAGE_PATH]})" ]
then
echo "moving $(ls -d ${BUILD_CONFIG[TEST_IMAGE_PATH]}) to ${testImageTargetPath}"
rm -rf "${testImageTargetPath}" || true
mv "$(ls -d ${BUILD_CONFIG[TEST_IMAGE_PATH]})" "${testImageTargetPath}"
fi

# Remove files we don't need
case "${BUILD_CONFIG[OS_KERNEL_NAME]}" in
Expand Down Expand Up @@ -645,6 +659,7 @@ createOpenJDKTarArchive()
{
local jdkTargetPath=$(getJdkArchivePath)
local jreTargetPath=$(getJreArchivePath)
local testImageTargetPath=$(getTestImageArchivePath)

COMPRESS=gzip

Expand All @@ -657,7 +672,12 @@ createOpenJDKTarArchive()
local jreName=$(echo "${BUILD_CONFIG[TARGET_FILE_NAME]}" | sed 's/-jdk/-jre/')
createArchive "${jreTargetPath}" "${jreName}"
fi
createArchive "${jdkTargetPath}" "${BUILD_CONFIG[TARGET_FILE_NAME]}"
if [ -d "${testImageTargetPath}" ]; then
echo "OpenJDK test image path will be ${testImageTargetPath}."
local testImageName=$(echo "${BUILD_CONFIG[TARGET_FILE_NAME]}" | sed 's/-jdk/-testimage/')
createArchive "${testImageTargetPath}" "${testImageName}"
fi
createArchive "${jdkTargetPath}" "${BUILD_CONFIG[TARGET_FILE_NAME]}"
}

# Echo success
Expand Down

0 comments on commit 3164246

Please sign in to comment.