From 9f32700b72afa62da0d3d6a7326134ca3353b9e9 Mon Sep 17 00:00:00 2001 From: Austin Date: Tue, 25 Aug 2020 11:20:32 +0100 Subject: [PATCH] Added build number to release file Added heap size to release file Added IMPLEMENTOR to release file Fixes: https://github.com/AdoptOpenJDK/openjdk-build/issues/889 Signed-off-by: Austin Bailey --- sbin/build.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/sbin/build.sh b/sbin/build.sh index 33cd6f22f5..6f220c31b1 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -826,6 +826,41 @@ fixJavaHomeUnderDocker() { fi } +addInfoToReleaseFile(){ + # Extra information is added to the release file here + cd ${BUILD_CONFIG[JDK_PATH]} + addBuildNumber + addImplementor + # OpenJ9 specific options + if [ "${BUILD_CONFIG[BUILD_VARIANT]}" == "${BUILD_VARIANT_OPENJ9}" ]; then + addHeapSize + fi +} + +addBuildNumber(){ + # If variable is populated add it to the release file + if [[ ${BUILD_CONFIG[OPENJDK_BUILD_NUMBER]} ]]; then + echo -e -n "\nBUILD_NUMBER=\"${BUILD_CONFIG[OPENJDK_BUILD_NUMBER]}\"" >> release + fi +} + +addHeapSize(){ + local jdkPath=${BUILD_CONFIG[JDK_PATH]} + if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then + if [ -d $jdkPath/jre/lib/amd64/compressedrefs ] || [ -d $jdkPath/lib/compressedrefs ]; then + echo -e -n "\HEAP_SIZE=\"Standard\"" >> release + else # Large heap has the folder /jre/lib/amd64/default or /lib/default + echo -e -n "\HEAP_SIZE=\"Large\"" >> release + fi + fi +} + +addImplementor(){ + if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then + echo -e -n "\nIMPLEMENTOR=\"AdoptOpenJDK\"" >> release + fi +} + ################################################################################ loadConfigFromFile @@ -847,6 +882,7 @@ buildTemplatedFile executeTemplatedFile printJavaVersionString +addInfoToReleaseFile removingUnnecessaryFiles copyFreeFontForMacOS