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