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 c1d42cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions configureBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ setVariablesForConfigure() {
if [ "$openjdk_core_version" == "${JDK8_CORE_VERSION}" ]; then
local jdk_path="j2sdk-image"
local jre_path="j2re-image"
# Set this to a directory which doesn't exist as it's JDK 11+
# only. See sbin/build.sh where this config setting is being
# used.
local test_image_path="jdk8-do-not-exist-testimage"
case "${BUILD_CONFIG[OS_KERNEL_NAME]}" in
"darwin")
local jdk_path="j2sdk-bundle/jdk*.jdk"
Expand All @@ -130,6 +134,7 @@ 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"
Expand All @@ -140,6 +145,7 @@ setVariablesForConfigure() {

BUILD_CONFIG[JDK_PATH]=$jdk_path
BUILD_CONFIG[JRE_PATH]=$jre_path
BUILD_CONFIG[TEST_IMAGE_PATH]=$test_image_path
}


Expand Down
20 changes: 19 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,12 @@ removingUnnecessaryFiles() {
rm -rf "${dirToRemove}"/demo/jfc/Font2DTest || true
rm -rf "${dirToRemove}"/demo/jfc/SwingApplet || true
fi
if [ -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 +657,7 @@ createOpenJDKTarArchive()
{
local jdkTargetPath=$(getJdkArchivePath)
local jreTargetPath=$(getJreArchivePath)
local testImageTargetPath=$(getTestImageArchivePath)

COMPRESS=gzip

Expand All @@ -657,7 +670,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 c1d42cd

Please sign in to comment.