|
| 1 | +#!/bin/bash -x |
| 2 | + |
| 3 | +# The following parameters must be specified: |
| 4 | +# build_number - specifies the number of JetBrainsRuntime build |
| 5 | +# bundle_type - specifies bundle to be built;possible values: |
| 6 | +# <empty> or nomod - the release bundles without any additional modules (jcef) |
| 7 | +# jcef - the release bundles with jcef |
| 8 | +# fd - the fastdebug bundles which also include the jcef module |
| 9 | +# |
| 10 | +# This script makes test-image along with JDK images when bundle_type is set to "jcef". |
| 11 | +# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images. |
| 12 | +# |
| 13 | +# Environment variables: |
| 14 | +# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument |
| 15 | +# to configure |
| 16 | +# By default JDK_BUILD_NUMBER is set zero |
| 17 | +# JCEF_PATH - specifies the path to the directory with JCEF binaries. |
| 18 | +# By default JCEF binaries should be located in ./jcef_win_aarch64 |
| 19 | + |
| 20 | +source jb/project/tools/common/scripts/common.sh |
| 21 | + |
| 22 | +WORK_DIR=$(pwd) |
| 23 | +JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64} |
| 24 | + |
| 25 | +function do_configure { |
| 26 | + sh ./configure \ |
| 27 | + --openjdk-target=aarch64-unknown-cygwin \ |
| 28 | + $WITH_DEBUG_LEVEL \ |
| 29 | + --with-vendor-name="$VENDOR_NAME" \ |
| 30 | + --with-vendor-version-string="$VENDOR_VERSION_STRING" \ |
| 31 | + --with-jvm-features=shenandoahgc \ |
| 32 | + --with-version-pre= \ |
| 33 | + --with-version-build=$JDK_BUILD_NUMBER \ |
| 34 | + --with-version-opt=b${build_number} \ |
| 35 | + --with-toolchain-version=$TOOLCHAIN_VERSION \ |
| 36 | + --with-boot-jdk=$BOOT_JDK \ |
| 37 | + --with-build-jdk=$BOOT_JDK \ |
| 38 | + --disable-ccache \ |
| 39 | + $STATIC_CONF_ARGS \ |
| 40 | + --enable-cds=yes || do_exit $? |
| 41 | +} |
| 42 | + |
| 43 | +function create_image_bundle { |
| 44 | + __bundle_name=$1 |
| 45 | + __arch_name=$2 |
| 46 | + __modules_path=$3 |
| 47 | + __modules=$4 |
| 48 | + |
| 49 | + [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-" |
| 50 | + |
| 51 | + echo Running jlink ... |
| 52 | + ${BOOT_JDK}/bin/jlink \ |
| 53 | + --module-path $__modules_path --no-man-pages --compress=2 \ |
| 54 | + --add-modules $__modules --output $__arch_name || do_exit $? |
| 55 | + |
| 56 | + grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__arch_name/release |
| 57 | + if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then |
| 58 | + sed 's/JBR/JBRSDK/g' $__arch_name/release > release |
| 59 | + mv release $__arch_name/release |
| 60 | + cp $IMAGES_DIR/jdk/lib/src.zip $__arch_name/lib |
| 61 | + copy_jmods "$__modules" "$__modules_path" "$__arch_name"/jmods |
| 62 | + fi |
| 63 | +} |
| 64 | + |
| 65 | +WITH_DEBUG_LEVEL="--with-debug-level=release" |
| 66 | +RELEASE_NAME=windows-aarch64-server-release |
| 67 | + |
| 68 | +case "$bundle_type" in |
| 69 | + "jcef") |
| 70 | + do_reset_changes=0 |
| 71 | + do_maketest=1 |
| 72 | + ;; |
| 73 | + "dcevm") |
| 74 | + HEAD_REVISION=$(git rev-parse HEAD) |
| 75 | + git am jb/project/tools/patches/dcevm/*.patch || do_exit $? |
| 76 | + do_reset_dcevm=0 |
| 77 | + do_reset_changes=0 |
| 78 | + ;; |
| 79 | + "nomod" | "") |
| 80 | + bundle_type="" |
| 81 | + ;; |
| 82 | + "fd") |
| 83 | + do_reset_changes=0 |
| 84 | + WITH_DEBUG_LEVEL="--with-debug-level=fastdebug" |
| 85 | + RELEASE_NAME=windows-aarch64-server-fastdebug |
| 86 | + ;; |
| 87 | +esac |
| 88 | + |
| 89 | +if [ -z "$INC_BUILD" ]; then |
| 90 | + do_configure || do_exit $? |
| 91 | + if [ $do_maketest -eq 1 ]; then |
| 92 | + make LOG=info CONF=$RELEASE_NAME clean images test-image || do_exit $? |
| 93 | + else |
| 94 | + make LOG=info CONF=$RELEASE_NAME clean images || do_exit $? |
| 95 | + fi |
| 96 | +else |
| 97 | + if [ $do_maketest -eq 1 ]; then |
| 98 | + make LOG=info CONF=$RELEASE_NAME images test-image || do_exit $? |
| 99 | + else |
| 100 | + make LOG=info CONF=$RELEASE_NAME images || do_exit $? |
| 101 | + fi |
| 102 | +fi |
| 103 | + |
| 104 | +IMAGES_DIR=build/$RELEASE_NAME/images |
| 105 | +JSDK=$IMAGES_DIR/jdk |
| 106 | +JSDK_MODS_DIR=$IMAGES_DIR/jmods |
| 107 | +JBRSDK_BUNDLE=jbrsdk |
| 108 | + |
| 109 | +where cygpath |
| 110 | +if [ $? -eq 0 ]; then |
| 111 | + JCEF_PATH="$(cygpath -w $JCEF_PATH | sed 's/\\/\//g')" |
| 112 | +fi |
| 113 | + |
| 114 | +if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then |
| 115 | + git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $? |
| 116 | + update_jsdk_mods "$BOOT_JDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $? |
| 117 | + cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not unchanged |
| 118 | + |
| 119 | + jbr_name_postfix="_${bundle_type}" |
| 120 | +fi |
| 121 | + |
| 122 | +# create runtime image bundle |
| 123 | +modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $? |
| 124 | +modules+=",jdk.crypto.mscapi" |
| 125 | +create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $? |
| 126 | + |
| 127 | +# create sdk image bundle |
| 128 | +modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g) || do_exit $? |
| 129 | +if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then |
| 130 | + modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods) |
| 131 | +fi |
| 132 | +create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $? |
| 133 | + |
| 134 | +do_exit 0 |
0 commit comments