diff --git a/.github/README.md b/.github/README.md
new file mode 100644
index 000000000000..49a4b9126c58
--- /dev/null
+++ b/.github/README.md
@@ -0,0 +1,238 @@
+[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
+
+# Welcome to JetBrains Runtime!
+
+JetBrains Runtime is a fork of [OpenJDK](https://github.com/openjdk/jdk) available for Windows, Mac OS X, and Linux.
+It supports enhanced class redefinition ([DCEVM](https://ssw.jku.at/dcevm/)),
+features optional [JCEF](https://github.com/JetBrains/jcef), a framework for embedding Chromium-based browsers,
+includes a number of improvements in font rendering, keyboards support,
+windowing/focus subsystems, HiDPI, accessibility, and performance, provides better desktop integration
+and bugfixes not yet present in OpenJDK.
+
+> **_NOTE_**: This is a **development** branch that is periodically synchronized with
+> the [OpenJDK master](https://github.com/openjdk/jdk/tree/master) branch.
+>
+ Release builds are based on these branches:
+ * [jbr11](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr11) (JDK 11)
+ * [jbr17](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr17) (JDK 17)
+ * [jbr21](https://github.com/JetBrains/JetBrainsRuntime/tree/jbr21) (JDK 21)
+
+Download the latest releases of JetBrains Runtime to use with JetBrains IDEs. The full list
+can be found on the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases).
+
+## Releases based on JDK 21
+
+| IDE Version | Latest JBR | Date Released |
+|-------------|---------------------------------------------------------------------------------------------------------|---------------|
+| 2024.3 | [21.0.5-b631.28](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b631.28) | 26-Nov-2024 |
+| 2024.2 | [21.0.4-b509.30](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.5b509.30) | 26-Nov-2024 |
+| 2024.1 | [21.0.2-b346.3](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-21.0.2b346.3) | 30-Jan-2024 |
+
+## Releases based on JDK 17
+
+| IDE Version | Latest JBR | Date Released |
+|-------------|--------------------------------------------------------------------------------------------------------|---------------|
+| 2024.2 | [17.0.11-b1312.2](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.11b1312.2) | 18-Jun-2024|
+| 2024.1 | [17.0.12-b1207.37](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1207.37) | 15-Oct-2024|
+| 2023.3 | [17.0.12-b1087.25](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1087.25) | 02-Sep-2024|
+| 2023.2 | [17.0.12-b1000.54](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.12b1000.54) | 02-Sep-2024|
+| 2023.1 | [17.0.10-b829.27](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.10b829.27) | 21-Mar-2024 |
+| 2022.3 | [17.0.6-b653.34](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b653.34) | 28-Feb-2023 |
+| 2022.2 | [17.0.6-b469.82](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b469.82) | 06-Mar-2023 |
+
+## Releases based on JDK 11
+
+| IDE Version | Latest JBR | Date Released |
+|-------------|-------------------------------------------------------------------------------------------------------|---------------|
+| 2022.1 | [11_0_16-b2043.64](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_16b2043.64) | 10-Nov-2022 |
+| 2021.3 | [11_0_14_1-b1751.46](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr11_0_14_1b1751.46) | 21-Feb-2022 |
+| 2021.2 | [11_0_13-b1504.49](https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jb11_0_13-b1504.49) | 15-Nov-2021 |
+| 2021.1 | [11.0.11+9-b1341.60](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1248891540)| 15-Jun-2021 |
+| 2020.3 | [11_0_10-b1145.115](https://github.com/JetBrains/JetBrainsRuntime/issues/171#issuecomment-1249243977) | 21-Jun-2021 |
+
+## Contents
+- [Welcome to JetBrains Runtime](#welcome-to-jetbrains-runtime)
+ - [Why Use JetBrains Runtime?](#why-use-jetbrains-runtime)
+ - [Products Built on JetBrains Runtime](#products-built-on-jetbrains-runtime)
+ - [Getting Sources](#getting-sources)
+ - [macOS, Linux](#macos-linux)
+ - [Windows](#sources-windows)
+ - [Configuring the Build Environment](#configuring-the-build-environment)
+ - [Linux (Docker)](#linux-docker)
+ - [Ubuntu Linux](#ubuntu-linux)
+ - [Windows](#build-windows)
+ - [macOS](#macos)
+ - [Developing](#developing)
+ - [Contributing](#contributing)
+ - [Resources](#resources)
+
+## Why Use JetBrains Runtime?
+* **Embedded browser**: JetBrains Runtime includes the Java Chromium Embedded Framework ([JCEF](https://github.com/JetBrains/jcef)), which
+ enables you to embed a Chromium-based browsers in your JVM-based application.
+ To use it, [download a build with JCEF](https://github.com/JetBrains/JetBrainsRuntime/releases).
+* **Enhanced class re-definition** with the [DCEVM](https://ssw.jku.at/dcevm/) technology that makes it easier to reload
+ changed code without restarting JVM; this feature needs to be explicitly enabled with `-XX:+AllowEnhancedClassRedefinition`.
+* **Better FPS performance** for graphics-intensive applications.
+* **Improved font rendering**, **keyboard input** (such as shortcuts and multinational keyboards),
+ **HiDPI** and **accessibility** support.
+* **Robust desktop experience**: GUI-related fixes often reach JetBrains Runtime much earlier than the corresponding version of OpenJDK.
+
+## Products Built on JetBrains Runtime
+* [Android Studio](https://developer.android.com/studio). The official IDE for Google's Android operating system.
+* [CLion](https://www.jetbrains.com/clion/). A cross-platform IDE for C and C++ from JetBrains.
+* [DataGrip](https://www.jetbrains.com/datagrip/). The IDE for Databases and SQL from JetBrains.
+* [GoLand](https://www.jetbrains.com/go/). The cross-platform Go IDE from JetBrains.
+* [IntelliJ IDEA](https://www.jetbrains.com/idea/). The IDE for JVM from JetBrains.
+* [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html). The Java profiler.
+* [PhpStorm](https://www.jetbrains.com/phpstorm/). The PHP IDE from JetBrains.
+* [PyCharm](https://www.jetbrains.com/pycharm/). The Python IDE from JetBrains.
+* [Rider](https://www.jetbrains.com/rider/). The cross-platform .NET IDE from JetBrains.
+* [RubyMine](https://www.jetbrains.com/ruby/). The Ruby and Rails IDE from JetBrains.
+* [Toolbox App](https://www.jetbrains.com/toolbox-app/). JetBrains IDE manager.
+* [WebStorm](https://www.jetbrains.com/webstorm/). The JavaScript IDE from JetBrains.
+* [YourKit](https://www.yourkit.com/). Java and .NET profilers.
+
+## Getting Sources
+### macOS, Linux
+```
+git config --global core.autocrlf input
+git clone git@github.com:JetBrains/JetBrainsRuntime.git
+```
+
+### Windows
+
+```
+git config --global core.autocrlf false
+git clone git@github.com:JetBrains/JetBrainsRuntime.git
+```
+
+## Configuring the Build Environment
+Here are quick per-platform instructions for those who can't wait to get started.
+Please refer to [OpenJDK build docs](https://openjdk.java.net/groups/build/doc/building.html) for in-depth
+coverage of all the details.
+
+> **_TIP:_** To get a preliminary report of what's missing, run `./configure` and check its output.
+> It would usually have meaningful advice on how to solve the problem.
+
+### Linux (Docker)
+Create a container (use the `mkdocker...` variant for your architecture):
+```
+$ cd jb/project/docker
+$ ./mkdocker_x86_64.sh
+...
+Successfully built 942ea9900054
+```
+Run these commands in the new container:
+```
+$ docker run -v `pwd`../../../../:/JetBrainsRuntime -it 942ea9900054
+# cd /JetBrainsRuntime
+# sh ./configure
+# make images
+```
+
+### Ubuntu Linux
+Install the necessary tools, libraries, and headers with:
+```
+$ sudo apt-get install autoconf make build-essential libx11-dev libxext-dev libxrender-dev libxtst-dev \
+ libxt-dev libxrandr-dev libcups2-dev libfontconfig1-dev libasound2-dev libspeechd-dev libwayland-dev \
+ wayland-protocols libxkbcommon-x11-0
+```
+Get Java 23 (for instance, [Azul Zulu Builds of OpenJDK 23](https://www.azul.com/downloads/?version=java-23&os=linux&package=jdk#zulu)).
+
+Then run the following:
+```
+$ cd JetBrainsRuntime
+$ git checkout main
+$ sh ./configure
+$ make images
+```
+This will build the release configuration under `./build/linux-x86_64-server-release/`.
+
+### Windows
+
+Install the following:
+* [Cygwin x64](http://www.cygwin.com/).
+ Required packages: `autoconf`, `binutils`, `cpio`, `diffutils`, `file`, `gawk`, `gcc-core`, `make`, `m4`, `unzip`, `zip`.
+ Install those together with Cygwin.
+* [Visual Studio compiler toolset](https://visualstudio.microsoft.com/downloads/).
+ Install with the desktop development kit, which includes Windows SDK and compilers.
+ Visual Studio 2019 is supported by default.
+* Java 21 (for instance, [Azul Zulu Builds of OpenJDK 21](https://www.azul.com/downloads/?version=java-21-lts&os=windows&package=jdk#zulu)).
+ If you have problems while configuring, read [Java tips on Cygwin](http://horstmann.com/articles/cygwin-tips.html).
+
+From the command line:
+```
+"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
+"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
+```
+The first command sets up environment variables, the second starts a Cygwin shell with the proper environment.
+
+In the Cygwin shell:
+```
+$ cd JetBrainsRuntime
+$ git checkout main
+$ bash configure --with-toolchain-version=2019
+$ make images
+```
+This will build the release configuration under `./build/windows-x86_64-server-release/`.
+
+#### Enable optional NVDA screen reader support
+If you want to add support of a11y announcing via [NVDA screen reader](https://www.nvaccess.org/about-nvda/),
+you will need to bundle the NVDA Controller Client library.
+You can do it with the following steps:
+1. Download the NVDA Controller Client library. You can find the link in its official README [here](https://github.com/nvaccess/nvda/blob/master/extras/controllerClient/readme.md)
+2. Pass the path to the unpacked package to `configure` via an additional flag `--with-nvdacontrollerclient=`.
+ The build system will search the required library files under `/`.
+
+#### Disable optional JAWS screen reader support
+JBR is built with built-in support of JAWS screen reader.
+If you want to disable it, run `configure` with the additional flag `--disable-jaws-client`.
+
+### macOS
+Install the following:
+* Xcode command line developer tools and `autoconf` via [Homebrew](https://brew.sh/).
+* Java 21 (for instance, [Azul Zulu Builds of OpenJDK 21](https://www.azul.com/downloads/?version=java-21-lts&os=macos&package=jdk#zulu)).
+
+From the command line:
+```
+$ cd JetBrainsRuntime
+$ git checkout main
+$ sh ./configure
+$ make images
+```
+This will build the release configuration under `./build/macosx-x86_64-server-release/`.
+
+## Developing
+You can use [CLion](https://www.jetbrains.com/clion/) to develop native parts of the JetBrains Runtime and
+[IntelliJ IDEA](https://www.jetbrains.com/idea/) for the parts written in Java.
+Both require projects to be created.
+
+### CLion
+Run
+```
+$ make compile-commands
+```
+in the git root and open the resulting `build/.../compile_commands.json` file as a project.
+Then use `Tools | Compilation Database | Change Project Root` to point to git root of this repository.
+
+See also this detailed step-by-step tutorial for all platforms:
+[How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
+
+### IDEA
+Run
+```
+$ sh ./bin/idea.sh
+```
+in the git root to generate project files (add `--help` for options). If you have multiple
+configurations (for example, `release` and `fastdebug`), supply the `--conf ` argument.
+Then open the git root directory as a project in IDEA.
+
+## Contributing
+We are happy to receive your pull requests!
+Before you submit one, please sign our [Contributor License Agreement (CLA)](https://www.jetbrains.com/agreements/cla/).
+
+## Resources
+* [JetBrains Runtime on GitHub](https://github.com/JetBrains/JetBrainsRuntime).
+* [OpenJDK build instructions](https://openjdk.java.net/groups/build/doc/building.html).
+* [OpenJDK test instructions](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk/master/doc/building.html#running-tests).
+* [How to develop OpenJDK with CLion](https://blog.jetbrains.com/clion/2020/03/openjdk-with-clion/).
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 210d53be6581..00bee56f6cdd 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -31,6 +31,7 @@ on:
- master
- pr/*
- jdk*
+ - main
workflow_dispatch:
inputs:
platforms:
diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
new file mode 100644
index 000000000000..33697b7a9799
--- /dev/null
+++ b/.github/workflows/pr.yml
@@ -0,0 +1,270 @@
+#
+# Copyright 2000-2023 JetBrains s.r.o.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+name: 'Build OpenJDK on pull request'
+
+on:
+ pull_request:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ ###
+ ### Determine platforms to include
+ ###
+ select:
+ name: 'Select platforms'
+ runs-on: ubuntu-22.04
+ outputs:
+ linux-x64: ${{ steps.include.outputs.linux-x64 }}
+ linux-x86: ${{ steps.include.outputs.linux-x86 }}
+ linux-cross-compile: ${{ steps.include.outputs.linux-cross-compile }}
+ macos-x64: ${{ steps.include.outputs.macos-x64 }}
+ macos-aarch64: ${{ steps.include.outputs.macos-aarch64 }}
+ windows-x64: ${{ steps.include.outputs.windows-x64 }}
+ windows-aarch64: ${{ steps.include.outputs.windows-aarch64 }}
+ windows-x86: ${{ steps.include.outputs.windows-x86 }}
+
+ steps:
+ # This function must be inlined in main.yml, or we'd be forced to checkout the repo
+ - name: 'Check what jobs to run'
+ id: include
+ run: |
+ # Determine which platform jobs to run
+
+ # Returns 'true' if the input platform list matches any of the platform monikers given as argument,
+ # 'false' otherwise.
+ # arg $1: platform name or names to look for
+ function check_platform() {
+ if [[ $GITHUB_EVENT_NAME == workflow_dispatch ]]; then
+ input='${{ github.event.inputs.platforms }}'
+ elif [[ $GITHUB_EVENT_NAME == push ]]; then
+ if [[ '${{ !secrets.JDK_SUBMIT_FILTER || startsWith(github.ref, 'refs/heads/submit/') }}' == 'false' ]]; then
+ # If JDK_SUBMIT_FILTER is set, and this is not a "submit/" branch, don't run anything
+ >&2 echo 'JDK_SUBMIT_FILTER is set and not a "submit/" branch'
+ echo 'false'
+ return
+ else
+ input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
+ fi
+ fi
+
+ normalized_input="$(echo ,$input, | tr -d ' ')"
+ if [[ "$normalized_input" == ",," ]]; then
+ # For an empty input, assume all platforms should run
+ echo 'true'
+ return
+ else
+ # Check for all acceptable platform names
+ for part in $* ; do
+ if echo "$normalized_input" | grep -q -e ",$part," ; then
+ echo 'true'
+ return
+ fi
+ done
+ fi
+
+ echo 'false'
+ }
+
+ echo "linux-x64=$(check_platform linux-x64 linux x64)" >> $GITHUB_OUTPUT
+ echo "linux-x86=$(check_platform linux-x86 linux x86)" >> $GITHUB_OUTPUT
+ echo "linux-x64-variants=$(check_platform linux-x64-variants variants)" >> $GITHUB_OUTPUT
+ echo "linux-cross-compile=$(check_platform linux-cross-compile cross-compile)" >> $GITHUB_OUTPUT
+ echo "macos-x64=$(check_platform macos-x64 macos x64)" >> $GITHUB_OUTPUT
+ echo "macos-aarch64=$(check_platform macos-aarch64 macos aarch64)" >> $GITHUB_OUTPUT
+ echo "windows-x64=$(check_platform windows-x64 windows x64)" >> $GITHUB_OUTPUT
+ echo "windows-x86=$(check_platform windows-x86 windows x86)" >> $GITHUB_OUTPUT
+ echo "windows-aarch64=$(check_platform windows-aarch64 windows aarch64)" >> $GITHUB_OUTPUT
+ echo "docs=$(check_platform docs)" >> $GITHUB_OUTPUT
+
+ ###
+ ### Build jobs
+ ###
+
+ build-linux-x64:
+ name: linux-x64
+ needs: select
+ uses: ./.github/workflows/build-linux.yml
+ with:
+ platform: linux-x64
+ gcc-major-version: '10'
+ apt-gcc-version: '10.4.0-4ubuntu1~22.04'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ # The linux-x64 jdk bundle is used as buildjdk for the cross-compile job
+ if: needs.select.outputs.linux-x64 == 'true' || needs.select.outputs.linux-cross-compile == 'true'
+
+ build-linux-x86:
+ name: linux-x86
+ needs: select
+ uses: ./.github/workflows/build-linux.yml
+ with:
+ platform: linux-x86
+ gcc-major-version: '10'
+ gcc-package-suffix: '-multilib'
+ apt-gcc-version: '10.4.0-4ubuntu1~22.04'
+ apt-architecture: 'i386'
+ # Some multilib libraries do not have proper inter-dependencies, so we have to
+ # install their dependencies manually.
+ apt-extra-packages: 'libfreetype6-dev:i386 libtiff-dev:i386 libcupsimage2-dev:i386 libc6-i386'
+ extra-conf-options: '--with-target-bits=32'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.linux-x86 == 'true'
+
+ build-linux-cross-compile:
+ name: linux-cross-compile
+ needs:
+ - select
+ - build-linux-x64
+ uses: ./.github/workflows/build-cross-compile.yml
+ with:
+ gcc-major-version: '10'
+ apt-gcc-version: '10.4.0-4ubuntu1~22.04'
+ apt-gcc-cross-version: '10.4.0-4ubuntu1~22.04cross1'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.linux-cross-compile == 'true'
+
+ build-macos-x64:
+ name: macos-x64
+ needs: select
+ uses: ./.github/workflows/build-macos.yml
+ with:
+ platform: macos-x64
+ xcode-toolset-version: '12.5.1'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.macos-x64 == 'true'
+
+ build-macos-aarch64:
+ name: macos-aarch64
+ needs: select
+ uses: ./.github/workflows/build-macos.yml
+ with:
+ platform: macos-aarch64
+ xcode-toolset-version: '12.5.1'
+ extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.macos-aarch64 == 'true'
+
+ build-windows-x64:
+ name: windows-x64
+ needs: select
+ uses: ./.github/workflows/build-windows.yml
+ with:
+ platform: windows-x64
+ msvc-toolset-version: '14.29'
+ msvc-toolset-architecture: 'x86.x64'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.windows-x64 == 'true'
+
+ build-windows-x86:
+ name: windows-x86
+ needs: select
+ uses: ./.github/workflows/build-windows.yml
+ with:
+ platform: windows-x86
+ msvc-toolset-version: '14.29'
+ msvc-toolset-architecture: 'x86'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.windows-x86 == 'true'
+
+ build-windows-aarch64:
+ name: windows-aarch64
+ needs: select
+ uses: ./.github/workflows/build-windows.yml
+ with:
+ platform: windows-aarch64
+ msvc-toolset-version: '14.29'
+ msvc-toolset-architecture: 'arm64'
+ make-target: 'hotspot'
+ extra-conf-options: '--openjdk-target=aarch64-unknown-cygwin'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.windows-aarch64 == 'true'
+
+ build-docs:
+ name: docs
+ needs: select
+ uses: ./.github/workflows/build-linux.yml
+ with:
+ platform: linux-x64
+ debug-levels: '[ "debug" ]'
+ make-target: 'docs-jdk-bundles'
+ # Make sure we never try to make full docs, since that would require a
+ # build JDK, and we do not need the additional testing of the graphs.
+ extra-conf-options: '--disable-full-docs'
+ gcc-major-version: '10'
+ apt-gcc-version: '10.4.0-4ubuntu1~22.04'
+ configure-arguments: ${{ github.event.inputs.configure-arguments }}
+ make-arguments: ${{ github.event.inputs.make-arguments }}
+ if: needs.select.outputs.docs == 'true'
+
+ # Remove bundles so they are not misconstrued as binary distributions from the JDK project
+ remove-bundles:
+ name: 'Remove bundle artifacts'
+ runs-on: ubuntu-22.04
+ if: always()
+ needs:
+ - build-linux-x64
+ - build-linux-x86
+ - build-linux-cross-compile
+ - build-macos-x64
+ - build-macos-aarch64
+ - build-windows-x64
+ - build-windows-aarch64
+ - build-windows-x86
+
+ steps:
+ # Hack to get hold of the api environment variables that are only defined for actions
+ - name: 'Get API configuration'
+ id: api
+ uses: actions/github-script@v6
+ with:
+ script: 'return { url: process.env["ACTIONS_RUNTIME_URL"], token: process.env["ACTIONS_RUNTIME_TOKEN"] }'
+
+ - name: 'Remove bundle artifacts'
+ run: |
+ # Find and remove all bundle artifacts
+ ALL_ARTIFACT_URLS="$(curl -s \
+ -H 'Accept: application/json;api-version=6.0-preview' \
+ -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
+ '${{ fromJson(steps.api.outputs.result).url }}_apis/pipelines/workflows/${{ github.run_id }}/artifacts?api-version=6.0-preview')"
+ BUNDLE_ARTIFACT_URLS="$(echo "$ALL_ARTIFACT_URLS" | jq -r -c '.value | map(select(.name|startswith("bundles-"))) | .[].url')"
+ for url in $BUNDLE_ARTIFACT_URLS; do
+ echo "Removing $url"
+ curl -s \
+ -H 'Accept: application/json;api-version=6.0-preview' \
+ -H 'Authorization: Bearer ${{ fromJson(steps.api.outputs.result).token }}' \
+ -X DELETE "$url" \
+ || echo "Failed to remove bundle"
+ done
diff --git a/.gitignore b/.gitignore
index b57addfccc9a..1947eff1cc14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,4 @@ NashornProfile.txt
/.cache
/.gdbinit
/.lldbinit
+/jbr-api/
diff --git a/README.md b/README.md
index b3f30676b3cf..bbe063c24bb6 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![official JetBrains project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
+
# Welcome to the JDK!
For build instructions please see the
diff --git a/bin/idea.sh b/bin/idea.sh
index c85ae294454e..11c727dd936b 100644
--- a/bin/idea.sh
+++ b/bin/idea.sh
@@ -25,7 +25,26 @@
# Shell script for generating an IDEA project from a given list of modules
usage() {
- echo "usage: $0 [-h|--help] [-v|--verbose] [-o|--output ] [-c|--conf ] [modules]+"
+ echo "Usage: $0 [-h|--help] [-q|--quiet] [-a|--absolute-paths] [-r|--root ] [-o|--output ] [-c|--conf ] [modules...]"
+ echo " -h | --help"
+ echo " -q | --quiet
+ No stdout output"
+ echo " -a | --absolute-paths
+ Use absolute paths to this jdk, so that generated .idea
+ project files can be moved independently of jdk sources"
+ echo " -r | --root
+ Project content root
+ Default: $TOPLEVEL_DIR"
+ echo " -o | --output
+ Where .idea directory with project files will be generated
+ (e.g. using '-o .' will place project files in './.idea')
+ Default: same as --root"
+ echo " -c | --conf
+ make configuration (release, slowdebug etc)"
+ echo " [modules...]
+ Generate project modules for specific java modules
+ (e.g. 'java.base java.desktop')
+ Default: all existing modules (java.* and jdk.*)"
exit 1
}
@@ -33,10 +52,13 @@ SCRIPT_DIR=`dirname $0`
#assume TOP is the dir from which the script has been called
TOP=`pwd`
cd $SCRIPT_DIR; SCRIPT_DIR=`pwd`
+if [ "x$TOPLEVEL_DIR" = "x" ] ; then
+ cd .. ; TOPLEVEL_DIR=`pwd`
+fi
cd $TOP;
-IDEA_OUTPUT=$TOP/.idea
-VERBOSE="false"
+VERBOSE=true
+ABSOLUTE_PATHS=false
CONF_ARG=
while [ $# -gt 0 ]
do
@@ -45,14 +67,24 @@ do
usage
;;
- -v | --vebose )
- VERBOSE="true"
+ -q | --quiet )
+ VERBOSE=false
+ ;;
+
+ -a | --absolute-paths )
+ ABSOLUTE_PATHS=true
+ ;;
+
+ -r | --root )
+ TOPLEVEL_DIR="$2"
+ shift
;;
-o | --output )
- IDEA_OUTPUT=$2/.idea
+ IDEA_OUTPUT="$2/.idea"
shift
;;
+
-c | --conf )
CONF_ARG="CONF_NAME=$2"
shift
@@ -69,20 +101,17 @@ do
shift
done
-if [ -e $IDEA_OUTPUT ] ; then
- rm -r $IDEA_OUTPUT
+if [ "x$IDEA_OUTPUT" = "x" ] ; then
+ IDEA_OUTPUT="$TOPLEVEL_DIR/.idea"
fi
-mkdir -p $IDEA_OUTPUT || exit 1
-cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
-if [ "x$TOPLEVEL_DIR" = "x" ] ; then
- cd $SCRIPT_DIR/..
- TOPLEVEL_DIR=`pwd`
- cd $IDEA_OUTPUT
-fi
+mkdir -p $IDEA_OUTPUT || exit 1
+cd "$TOP" ; cd $TOPLEVEL_DIR; TOPLEVEL_DIR=`pwd`
+cd "$TOP" ; cd $IDEA_OUTPUT; IDEA_OUTPUT=`pwd`
+cd ..; IDEA_OUTPUT_PARENT=`pwd`
+cd "$SCRIPT_DIR/.." ; OPENJDK_DIR=`pwd`
-MAKE_DIR="$SCRIPT_DIR/../make"
-IDEA_MAKE="$MAKE_DIR/ide/idea/jdk"
+IDEA_MAKE="$OPENJDK_DIR/make/ide/idea/jdk"
IDEA_TEMPLATE="$IDEA_MAKE/template"
cp -r "$IDEA_TEMPLATE"/* "$IDEA_OUTPUT"
@@ -94,31 +123,31 @@ if [ -d "$TEMPLATES_OVERRIDE" ] ; then
done
fi
-if [ "$VERBOSE" = "true" ] ; then
- echo "output dir: $IDEA_OUTPUT"
- echo "idea template dir: $IDEA_TEMPLATE"
+if [ "$VERBOSE" = true ] ; then
+ echo "Will generate IDEA project files in \"$IDEA_OUTPUT\" for project \"$TOPLEVEL_DIR\""
fi
-cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I $MAKE_DIR/.. idea MAKEOVERRIDES= OUT=$IDEA_OUTPUT/env.cfg MODULES="$*" $CONF_ARG || exit 1
+cd $TOP ; make -f "$IDEA_MAKE/idea.gmk" -I "$OPENJDK_DIR" idea TOPLEVEL_DIR="$TOPLEVEL_DIR" \
+ MAKEOVERRIDES= IDEA_OUTPUT_PARENT="$IDEA_OUTPUT_PARENT" OUT="$IDEA_OUTPUT/env.cfg" MODULES="$*" $CONF_ARG || exit 1
cd $SCRIPT_DIR
. $IDEA_OUTPUT/env.cfg
-# Expect MODULE_ROOTS, MODULE_NAMES, BOOT_JDK & SPEC to be set
-if [ "x$MODULE_ROOTS" = "x" ] ; then
- echo "FATAL: MODULE_ROOTS is empty" >&2; exit 1
+# Expect MODULES, MODULE_NAMES, RELATIVE_PROJECT_DIR, RELATIVE_BUILD_DIR to be set
+if [ "xMODULES" = "x" ] ; then
+ echo "FATAL: MODULES is empty" >&2; exit 1
fi
if [ "x$MODULE_NAMES" = "x" ] ; then
echo "FATAL: MODULE_NAMES is empty" >&2; exit 1
fi
-if [ "x$BOOT_JDK" = "x" ] ; then
- echo "FATAL: BOOT_JDK is empty" >&2; exit 1
+if [ "x$RELATIVE_PROJECT_DIR" = "x" ] ; then
+ echo "FATAL: RELATIVE_PROJECT_DIR is empty" >&2; exit 1
fi
-if [ "x$SPEC" = "x" ] ; then
- echo "FATAL: SPEC is empty" >&2; exit 1
+if [ "x$RELATIVE_BUILD_DIR" = "x" ] ; then
+ echo "FATAL: RELATIVE_BUILD_DIR is empty" >&2; exit 1
fi
if [ -d "$TOPLEVEL_DIR/.hg" ] ; then
@@ -129,6 +158,43 @@ if [ -d "$TOPLEVEL_DIR/.git" ] ; then
VCS_TYPE="Git"
fi
+if [ "$ABSOLUTE_PATHS" = true ] ; then
+ if [ "x$PATHTOOL" != "x" ]; then
+ PROJECT_DIR="`$PATHTOOL -am $OPENJDK_DIR`"
+ TOPLEVEL_PROJECT_DIR="`$PATHTOOL -am $TOPLEVEL_DIR`"
+ else
+ PROJECT_DIR="$OPENJDK_DIR"
+ TOPLEVEL_PROJECT_DIR="$TOPLEVEL_DIR"
+ fi
+ MODULE_DIR="$PROJECT_DIR"
+ TOPLEVEL_MODULE_DIR="$TOPLEVEL_PROJECT_DIR"
+ cd "$IDEA_OUTPUT_PARENT" && cd "$RELATIVE_BUILD_DIR" && BUILD_DIR="`pwd`"
+ CLION_SCRIPT_TOPDIR="$OPENJDK_DIR"
+ CLION_PROJECT_DIR="$PROJECT_DIR"
+else
+ if [ "$RELATIVE_PROJECT_DIR" = "." ] ; then
+ PROJECT_DIR=""
+ else
+ PROJECT_DIR="/$RELATIVE_PROJECT_DIR"
+ fi
+ if [ "$RELATIVE_TOPLEVEL_PROJECT_DIR" = "." ] ; then
+ TOPLEVEL_PROJECT_DIR=""
+ else
+ TOPLEVEL_PROJECT_DIR="/$RELATIVE_TOPLEVEL_PROJECT_DIR"
+ fi
+ MODULE_DIR="\$MODULE_DIR\$$PROJECT_DIR"
+ PROJECT_DIR="\$PROJECT_DIR\$$PROJECT_DIR"
+ TOPLEVEL_MODULE_DIR="\$MODULE_DIR\$$TOPLEVEL_PROJECT_DIR"
+ TOPLEVEL_PROJECT_DIR="\$PROJECT_DIR\$$TOPLEVEL_PROJECT_DIR"
+ BUILD_DIR="\$PROJECT_DIR\$/$RELATIVE_BUILD_DIR"
+ CLION_SCRIPT_TOPDIR="$CLION_RELATIVE_PROJECT_DIR"
+ CLION_PROJECT_DIR="\$PROJECT_DIR\$/$CLION_SCRIPT_TOPDIR"
+fi
+if [ "$VERBOSE" = true ] ; then
+ echo "Project root: $PROJECT_DIR"
+ echo "Generating IDEA project files..."
+fi
+
### Replace template variables
NUM_REPLACEMENTS=0
@@ -152,116 +218,106 @@ add_replacement() {
eval TO$NUM_REPLACEMENTS='$2'
}
+add_replacement "###PATHTOOL###" "$PATHTOOL"
+add_replacement "###CLION_SCRIPT_TOPDIR###" "$CLION_SCRIPT_TOPDIR"
+add_replacement "###CLION_PROJECT_DIR###" "$CLION_PROJECT_DIR"
+add_replacement "###PROJECT_DIR###" "$PROJECT_DIR"
+add_replacement "###MODULE_DIR###" "$MODULE_DIR"
+add_replacement "###TOPLEVEL_PROJECT_DIR###" "$TOPLEVEL_PROJECT_DIR"
+add_replacement "###TOPLEVEL_MODULE_DIR###" "$TOPLEVEL_MODULE_DIR"
add_replacement "###MODULE_NAMES###" "$MODULE_NAMES"
add_replacement "###VCS_TYPE###" "$VCS_TYPE"
-SPEC_DIR=`dirname $SPEC`
-if [ "x$CYGPATH" != "x" ]; then
- add_replacement "###BUILD_DIR###" "`$CYGPATH -am $SPEC_DIR`"
- add_replacement "###IMAGES_DIR###" "`$CYGPATH -am $SPEC_DIR`/images/jdk"
- add_replacement "###ROOT_DIR###" "`$CYGPATH -am $TOPLEVEL_DIR`"
- add_replacement "###IDEA_DIR###" "`$CYGPATH -am $IDEA_OUTPUT`"
- if [ "x$JT_HOME" = "x" ]; then
- add_replacement "###JTREG_HOME###" ""
- else
- add_replacement "###JTREG_HOME###" "`$CYGPATH -am $JT_HOME`"
- fi
-elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
- add_replacement "###BUILD_DIR###" "`wslpath -am $SPEC_DIR`"
- add_replacement "###IMAGES_DIR###" "`wslpath -am $SPEC_DIR`/images/jdk"
- add_replacement "###ROOT_DIR###" "`wslpath -am $TOPLEVEL_DIR`"
- add_replacement "###IDEA_DIR###" "`wslpath -am $IDEA_OUTPUT`"
+add_replacement "###BUILD_DIR###" "$BUILD_DIR"
+add_replacement "###RELATIVE_BUILD_DIR###" "$RELATIVE_BUILD_DIR"
+if [ "x$PATHTOOL" != "x" ]; then
+ add_replacement "###BASH_RUNNER_PREFIX###" "\$PROJECT_DIR\$/.idea/bash.bat"
+else
+ add_replacement "###BASH_RUNNER_PREFIX###" ""
+fi
+if [ "x$PATHTOOL" != "x" ]; then
if [ "x$JT_HOME" = "x" ]; then
add_replacement "###JTREG_HOME###" ""
else
- add_replacement "###JTREG_HOME###" "`wslpath -am $JT_HOME`"
+ add_replacement "###JTREG_HOME###" "`$PATHTOOL -am $JT_HOME`"
fi
else
- add_replacement "###BUILD_DIR###" "$SPEC_DIR"
add_replacement "###JTREG_HOME###" "$JT_HOME"
- add_replacement "###IMAGES_DIR###" "$SPEC_DIR/images/jdk"
- add_replacement "###ROOT_DIR###" "$TOPLEVEL_DIR"
- add_replacement "###IDEA_DIR###" "$IDEA_OUTPUT"
fi
-SOURCE_PREFIX=""
-
-for root in $MODULE_ROOTS; do
- if [ "x$CYGPATH" != "x" ]; then
- root=`$CYGPATH -am $root`
- elif [ "x$WSL_DISTRO_NAME" != "x" ]; then
- root=`wslpath -am $root`
- fi
-
- SOURCES=$SOURCES" $SOURCE_PREFIX""$root""$SOURCE_POSTFIX"
+MODULE_IMLS=""
+TEST_MODULE_DEPENDENCIES=""
+for module in $MODULE_NAMES; do
+ MODULE_IMLS="$MODULE_IMLS "
+ TEST_MODULE_DEPENDENCIES="$TEST_MODULE_DEPENDENCIES "
done
-
-add_replacement "###SOURCE_ROOTS###" "$SOURCES"
+add_replacement "###MODULE_IMLS###" "$MODULE_IMLS"
+add_replacement "###TEST_MODULE_DEPENDENCIES###" "$TEST_MODULE_DEPENDENCIES"
replace_template_dir "$IDEA_OUTPUT"
-### Compile the custom Logger
-
-CLASSES=$IDEA_OUTPUT/classes
+### Generate module project files
-if [ "x$ANT_HOME" = "x" ] ; then
- # try some common locations
- if [ -f "/usr/share/ant/lib/ant.jar" ] ; then
- ANT_HOME="/usr/share/ant"
- else
- try_ant=$(ls /opt/homebrew/Cellar/ant/*/libexec/lib/ant.jar 2> /dev/null | sort -r | head -n 1)
- if [ "x$try_ant" != "x" ] ; then
- ANT_HOME=$(cd $(dirname $try_ant)/.. && pwd)
- else
- try_ant=$(ls /usr/local/Cellar/ant/*/libexec/lib/ant.jar 2> /dev/null | sort -r | head -n 1)
- if [ "x$try_ant" != "x" ] ; then
- ANT_HOME=$(cd $(dirname $try_ant)/.. && pwd)
- fi
- fi
+if [ "$VERBOSE" = true ] ; then
+ echo "Generating project modules:"
fi
-else
- if [ ! -f "$ANT_HOME/lib/ant.jar" ] ; then
- echo "FATAL: ANT_HOME is incorrect. Try removing it and use autodetection, or fix the value" >&2; exit 1
+(
+DEFAULT_IFS="$IFS"
+IFS='#'
+for value in $MODULES; do
+ (
+ eval "$value"
+ if [ "$VERBOSE" = true ] ; then
+ echo " $module"
fi
-fi
+ MAIN_SOURCE_DIRS=""
+ CONTENT_ROOTS=""
+ IFS=' '
+ for dir in $moduleSrcDirs; do
+ case $dir in
+ "src/"*) MAIN_SOURCE_DIRS="$MAIN_SOURCE_DIRS " ;;
+ *"/support/gensrc/$module") ;; # Exclude generated sources to avoid module-info conflicts, see https://youtrack.jetbrains.com/issue/IDEA-185108
+ *) CONTENT_ROOTS="$CONTENT_ROOTS \
+ " ;;
+ esac
+ done
+ if [ "x$MAIN_SOURCE_DIRS" != "x" ] ; then
+ CONTENT_ROOTS="$MAIN_SOURCE_DIRS$CONTENT_ROOTS"
+ fi
+ add_replacement "###MODULE_CONTENT_ROOTS###" "$CONTENT_ROOTS"
+ DEPENDENCIES=""
+ for dep in $moduleDependencies; do
+ case $MODULE_NAMES in # Exclude skipped modules from dependencies
+ *"$dep"*) DEPENDENCIES="$DEPENDENCIES "
+ esac
+ done
+ add_replacement "###DEPENDENCIES###" "$DEPENDENCIES"
+ cp "$IDEA_OUTPUT/module.iml" "$IDEA_OUTPUT/$module.iml"
+ IFS="$DEFAULT_IFS"
+ replace_template_file "$IDEA_OUTPUT/$module.iml"
+ )
+done
+)
+rm "$IDEA_OUTPUT/module.iml"
-if [ "x$ANT_HOME" = "x" ] ; then
- echo "FATAL: cannot find ant. Try setting ANT_HOME." >&2; exit 1
-fi
-CP=$ANT_HOME/lib/ant.jar
-rm -rf $CLASSES; mkdir $CLASSES
+### Create shell script runner for Windows
-# If we have a Windows boot JDK, we need a .exe suffix
-if [ -e "$BOOT_JDK/bin/java.exe" ] ; then
- JAVAC=javac.exe
-else
- JAVAC=javac
+if [ "x$PATHTOOL" != "x" ]; then
+ echo "@echo off" > "$IDEA_OUTPUT/bash.bat"
+ if [ "x$WSL_DISTRO_NAME" != "x" ] ; then
+ echo "wsl -d $WSL_DISTRO_NAME --cd \"%cd%\" -e %*" >> "$IDEA_OUTPUT/bash.bat"
+ else
+ echo "$WINENV_ROOT\bin\bash.exe -l -c \"cd %CD:\=/%/ && %*\"" >> "$IDEA_OUTPUT/bash.bat"
+ fi
fi
-# If we are on WSL, the boot JDK might be either Windows or Linux,
-# and we need to use realpath instead of CYGPATH to make javac work on both.
-# We need to handle this case first since CYGPATH might be set on WSL.
-if [ "x$WSL_DISTRO_NAME" != "x" ]; then
- JAVAC_SOURCE_FILE=`realpath --relative-to=./ $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
- JAVAC_SOURCE_PATH=`realpath --relative-to=./ $IDEA_OUTPUT/src`
- JAVAC_CLASSES=`realpath --relative-to=./ $CLASSES`
- ANT_TEMP=`mktemp -d -p ./`
- cp $ANT_HOME/lib/ant.jar $ANT_TEMP/ant.jar
- JAVAC_CP=$ANT_TEMP/ant.jar
-elif [ "x$CYGPATH" != "x" ] ; then ## CYGPATH may be set in env.cfg
- JAVAC_SOURCE_FILE=`$CYGPATH -am $IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java`
- JAVAC_SOURCE_PATH=`$CYGPATH -am $IDEA_OUTPUT/src`
- JAVAC_CLASSES=`$CYGPATH -am $CLASSES`
- JAVAC_CP=`$CYGPATH -am $CP`
-else
- JAVAC_SOURCE_FILE=$IDEA_OUTPUT/src/idea/IdeaLoggerWrapper.java
- JAVAC_SOURCE_PATH=$IDEA_OUTPUT/src
- JAVAC_CLASSES=$CLASSES
- JAVAC_CP=$CP
-fi
-$BOOT_JDK/bin/$JAVAC -d $JAVAC_CLASSES -sourcepath $JAVAC_SOURCE_PATH -cp $JAVAC_CP $JAVAC_SOURCE_FILE
-if [ "x$WSL_DISTRO_NAME" != "x" ]; then
- rm -rf $ANT_TEMP
-fi
+if [ "$VERBOSE" = true ] ; then
+ IDEA_PROJECT_DIR="`dirname $IDEA_OUTPUT`"
+ if [ "x$PATHTOOL" != "x" ]; then
+ IDEA_PROJECT_DIR="`$PATHTOOL -am $IDEA_PROJECT_DIR`"
+ fi
+ echo "
+Now you can open \"$IDEA_PROJECT_DIR\" as IDEA project
+You can also run 'bash \"$IDEA_OUTPUT/jdk-clion/update-project.sh\"' to generate Clion project"
+fi
\ No newline at end of file
diff --git a/configure b/configure
old mode 100644
new mode 100755
diff --git a/jb/branchdiff.py b/jb/branchdiff.py
new file mode 100755
index 000000000000..81d48de0cd68
--- /dev/null
+++ b/jb/branchdiff.py
@@ -0,0 +1,274 @@
+#!/usr/bin/env python3
+
+import argparse
+import os.path
+import sys
+import subprocess
+
+errors_count = 0
+
+
+def fatal(msg):
+ sys.stderr.write(f"[fatal] {msg}\n")
+ sys.exit(1)
+
+
+def error(msg):
+ global errors_count
+ errors_count += 1
+ sys.stderr.write(f"[error] {msg}\n")
+
+
+def verbose(options, *msg):
+ if options.verbose:
+ sys.stderr.write(f"[verbose] ")
+ sys.stderr.write(*msg)
+ sys.stderr.write('\n')
+
+
+def first_line(str):
+ return "" if not str else str.splitlines()[0]
+
+
+class Options:
+ def __init__(self):
+ ap = argparse.ArgumentParser(description="Show commit differences between branches of JBR git repos",
+ epilog="Example: %(prog)s --from origin/jbr17 --to jbr17.b469 --path "
+ "src/hotspot --limit 200")
+ ap.add_argument('--jbr', dest='jbrpath', help='path to JBR git root', required=True)
+ ap.add_argument('--from', dest='frombranch', help='branch to take commits from', required=True)
+ ap.add_argument('--to', dest='tobranch', help='branch to apply new commits to', required=True)
+ ap.add_argument('--path', dest='path', help='limit to changes in this path (relative to git root)')
+ ap.add_argument('--limit', dest='limit', help='limit to this many log entries in --jdk repo', type=int,
+ default=-1)
+ ap.add_argument('--html', dest="ishtml", help="print out HTML rather than plain text", action='store_true')
+ ap.add_argument('-o', dest="output", help="print the list of missing commits to this file"
+ " to be used as exclude list later")
+ ap.add_argument('--exclude', dest='exclude', help='exclude commits listed in the given file '
+ '(can use edited -o output file as input here)')
+ ap.add_argument('-v', dest='verbose', help="verbose output", default=False, action='store_true')
+ args = ap.parse_args()
+
+ if not os.path.isdir(args.jbrpath):
+ fatal(f"{args.jbrpath} not a directory")
+
+ if not git_is_available():
+ fatal("can't run git commands; make sure git is in PATH")
+
+ self.frombranch = args.frombranch
+ self.tobranch = args.tobranch
+ self.jbrpath = args.jbrpath
+ self.path = args.path
+ self.limit = args.limit
+ self.exclude = args.exclude
+ self.output = args.output
+ self.ishtml = args.ishtml
+ self.verbose = args.verbose
+
+
+class GitRepo:
+ def __init__(self, rootpath):
+ self.rootpath = rootpath
+
+ def run_git_cmd(self, git_args):
+ args = ["git", "-C", self.rootpath]
+ args.extend(git_args)
+ # print(f"Runnig git cmd '{' '.join(args)}'")
+ p = subprocess.run(args, capture_output=True, text=True)
+ if p.returncode != 0:
+ fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
+ return p.stdout
+
+ def save_git_cmd(self, fname, git_args):
+ args = ["git", "-C", self.rootpath]
+ args.extend(git_args)
+ # print(f"Runnig git cmd '{' '.join(args)}'")
+ with open(fname, "w") as stdout_file:
+ p = subprocess.run(args, stdout=stdout_file)
+ if p.returncode != 0:
+ fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
+
+ def current_branch(self):
+ branch_name = self.run_git_cmd(["branch", "--show-current"]).strip()
+ return branch_name
+
+ def log(self, branch, path=None, limit=None):
+ cmds = ["log", "--no-decorate", branch]
+ if limit:
+ cmds.extend(["-n", str(limit)])
+ if path:
+ cmds.append(path)
+ full_log = self.run_git_cmd(cmds)
+ return full_log
+
+
+class Commit:
+ def __init__(self, lines):
+ self.sha = lines[0].split()[1]
+ self.message = ""
+ self.fullmessage = ""
+ self.bugid = ""
+
+ # Commit message starts after one blank line
+ read_message = False
+ for l in lines:
+ if read_message:
+ self.fullmessage += l.strip() + "\n"
+ if not read_message and l == "":
+ read_message = True
+
+ if len(self.fullmessage) > 0:
+ self.message = first_line(self.fullmessage).strip()
+ t = self.message.split(' ')
+ if len(t) > 1:
+ bugid = t[0]
+ if bugid.startswith("fixup"):
+ bugid = t[1]
+ bugid = bugid.strip(":")
+ if bugid.startswith("JBR-") or bugid.isnumeric():
+ self.bugid = bugid
+
+
+class History:
+ def __init__(self, log):
+ log_itr = iter(log.splitlines())
+ self.commits = []
+ self.unique_fullmessages = set()
+ self.duplicates = set()
+ commit_lines = []
+ for line in log_itr:
+ if line.startswith("commit ") and len(commit_lines) > 0:
+ commit = Commit(commit_lines)
+ self.add_commit(commit)
+ commit_lines = []
+ commit_lines.append(line)
+
+ if len(commit_lines) > 0:
+ commit = Commit(commit_lines)
+ self.add_commit(commit)
+
+ def add_commit(self, commit):
+ self.commits.append(commit)
+ if commit.fullmessage in self.unique_fullmessages:
+ self.duplicates.add(commit.fullmessage)
+ else:
+ self.unique_fullmessages.add(commit.fullmessage)
+
+ def appears_more_than_once(self, commit):
+ return commit.fullmessage in self.duplicates
+
+ def contains(self, commit):
+ return commit.fullmessage in self.unique_fullmessages
+
+ def size(self):
+ return len(self.commits)
+
+
+def print_explanation(options, jbr):
+ verbose(options, f"Reading history from '{jbr.rootpath}'")
+ if options.path:
+ verbose(options, f"\t(only under '{options.path}')")
+ if options.limit > 0:
+ verbose(options, f"\t(up to '{options.limit}' commits)")
+ verbose(options, f"Searching for missing fixes in '{options.tobranch}' compared with '{options.frombranch}'")
+
+
+def git_is_available():
+ p = None
+ try:
+ p = subprocess.run(["git", "--help"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ except:
+ pass
+ return p is not None and p.returncode == 0
+
+
+def main():
+ check_python_min_requirements()
+ options = Options()
+ jbr = GitRepo(options.jbrpath)
+ print_explanation(options, jbr)
+
+ commits_to_save = []
+ try:
+ log_from = jbr.log(options.frombranch, options.path, options.limit)
+ log_to = jbr.log(options.tobranch, options.path, options.limit)
+ history_from = History(log_from)
+ history_to = History(log_to)
+
+ verbose(options,
+ f"Read {history_from.size()} commits from '{options.frombranch}', {history_to.size()} from {options.tobranch}")
+
+ exclude_list = []
+ if options.exclude:
+ with open(options.exclude, "r") as exclude_file:
+ l = exclude_file.read().split('\n')
+ exclude_list = list(filter(lambda line: not line.startswith("#"), l))
+
+ warned = set()
+ for c in history_from.commits:
+ if c.message:
+ verbose(options, f"Looking for commit '{c.message}'")
+ if c.message in exclude_list:
+ verbose(options, "...nope, in exclude list")
+ continue
+
+ if not history_to.contains(c):
+ commits_to_save.append(c)
+ else:
+ if history_from.appears_more_than_once(c) and c.fullmessage not in warned:
+ # Not sure which of those seemingly identical commits are present in the target branch
+ error(f"Commit '{c.message}' appears more than once in branch '{options.frombranch}'. ")
+ warned.add(c.fullmessage)
+ except KeyboardInterrupt:
+ fatal("Interrupted")
+
+ print_out_commits(options, commits_to_save)
+ save_commits_to_file(commits_to_save, options)
+ if errors_count > 0:
+ error(f"{errors_count} error(s) generated to stderr. MANUAL CHECK OF COMMITS IS REQUIRED.")
+
+
+def save_commits_to_file(commits_to_save, options):
+ if len(commits_to_save) > 0 and options.output:
+ print()
+ with open(options.output, "w") as out:
+ for i, c in enumerate(reversed(commits_to_save)):
+ print(f"# {c.sha}", file=out)
+ print(c.message, file=out)
+
+
+def print_out_commits(options, commits_to_save):
+ if options.ishtml:
+ print("")
+ print(f"
Commits on {options.frombranch}"
+ f" missing from {options.tobranch}
")
+ if len(commits_to_save) > 0:
+ for c in sorted(commits_to_save, key=lambda commit: commit.bugid):
+ if options.ishtml:
+ msg = c.message
+ bugurl = ""
+ if c.bugid:
+ if c.bugid.isnumeric():
+ bugurl = f"https://bugs.openjdk.org/browse/JDK-{c.bugid}"
+ elif c.bugid.startswith("JBR-"):
+ bugurl = f"https://youtrack.jetbrains.com/issue/{c.bugid}"
+
+ if len(bugurl) > 0:
+ msg = msg.replace(c.bugid, f"{c.bugid}")
+
+ sha = f"" \
+ f"{c.sha[0:8]}"
+ print(f"
{msg} ({sha})
")
+ else:
+ print(f"{c.message} ({c.sha[0:8]})")
+ if options.ishtml:
+ print("")
+
+
+def check_python_min_requirements():
+ if sys.version_info < (3, 6):
+ fatal("Minimum version 3.6 is required to run this script")
+
+
+if __name__ == '__main__':
+ main()
diff --git a/jb/generate-wakefield.sh b/jb/generate-wakefield.sh
new file mode 100755
index 000000000000..5a9f6ffba2d8
--- /dev/null
+++ b/jb/generate-wakefield.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+if [[ -z "$1" ]]; then
+ SCANNER=wayland-scanner
+else
+ SCANNER="$1"
+fi
+
+set -ex
+
+"$SCANNER" client-header src/java.desktop/share/native/libwakefield/protocol/wakefield.xml src/java.desktop/unix/native/libawt_wlawt/wakefield-client-protocol.h
+"$SCANNER" private-code src/java.desktop/share/native/libwakefield/protocol/wakefield.xml src/java.desktop/unix/native/libawt_wlawt/wakefield-client-protocol.c
diff --git a/jb/jbr-api.version b/jb/jbr-api.version
new file mode 100644
index 000000000000..6d7de6e6abef
--- /dev/null
+++ b/jb/jbr-api.version
@@ -0,0 +1 @@
+1.0.2
diff --git a/jb/jdkdiff.py b/jb/jdkdiff.py
new file mode 100755
index 000000000000..2d9f10b68607
--- /dev/null
+++ b/jb/jdkdiff.py
@@ -0,0 +1,230 @@
+#!/usr/bin/env python3
+
+import argparse
+import math
+import os.path
+import sys
+import subprocess
+
+
+def fatal(msg):
+ sys.stderr.write(f"[fatal] {msg}\n")
+ sys.exit(1)
+
+
+def verbose(options, *msg):
+ if options.verbose:
+ sys.stdout.write(f"[verbose] ")
+ sys.stdout.write(*msg)
+ sys.stdout.write('\n')
+
+
+def first_line(str):
+ return "" if not str else str.splitlines()[0]
+
+
+class Options:
+ def __init__(self):
+ ap = argparse.ArgumentParser(description="Show bugfixes differences between JBR and OpenJDK git repos",
+ epilog="Example: %(prog)s --jdk ./jdk11u/ --jbr ./JetBrainsRuntime/ --path src/hotspot --limit 200")
+ ap.add_argument('--jdk', dest='jdkpath', help='path to OpenJDK git repo', required=True)
+ ap.add_argument('--jbr', dest='jbrpath', help='path to JBR git repo', required=True)
+ ap.add_argument('--path', dest='path', help='limit to changes in this path (relative to git root)')
+ ap.add_argument('--limit', dest='limit', help='limit to this many log entries in --jdk repo', type=int, default=-1)
+ ap.add_argument('-o', dest="output_dir", help="save patches to this directory (created if necessary)")
+ ap.add_argument('-v', dest='verbose', help="verbose output", default=False, action='store_true')
+ args = ap.parse_args()
+
+ if not os.path.isdir(args.jdkpath):
+ fatal(f"{args.jdkpath} not a directory")
+
+ if not os.path.isdir(args.jbrpath):
+ fatal(f"{args.jbrpath} not a directory")
+
+ if not git_is_available():
+ fatal("can't run git commands; make sure git is in PATH")
+
+ self.jdkpath = args.jdkpath
+ self.jbrpath = args.jbrpath
+ self.path = args.path
+ self.limit = args.limit
+ self.output_dir = args.output_dir
+ self.verbose = args.verbose
+
+
+class GitRepo:
+ def __init__(self, rootpath):
+ self.rootpath = rootpath
+
+ def run_git_cmd(self, git_args):
+ args = ["git", "-C", self.rootpath]
+ args.extend(git_args)
+ # print(f"Runnig git cmd '{' '.join(args)}'")
+ p = subprocess.run(args, capture_output=True, text=True)
+ if p.returncode != 0:
+ fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
+ return p.stdout
+
+ def save_git_cmd(self, fname, git_args):
+ args = ["git", "-C", self.rootpath]
+ args.extend(git_args)
+ # print(f"Runnig git cmd '{' '.join(args)}'")
+ with open(fname, "w") as stdout_file:
+ p = subprocess.run(args, stdout=stdout_file)
+ if p.returncode != 0:
+ fatal(f"git returned non-zero code in {self.rootpath} ({first_line(p.stderr)})")
+
+ def current_branch(self):
+ branch_name = self.run_git_cmd(["branch", "--show-current"]).strip()
+ return branch_name
+
+ def log(self, path=None, limit=None):
+ cmds = ["log", "--no-decorate"]
+ if limit:
+ cmds.extend(["-n", str(limit)])
+ if path:
+ cmds.append(path)
+ full_log = self.run_git_cmd(cmds)
+ return full_log
+
+
+class Commit:
+ def __init__(self, lines):
+ self.sha = lines[0].split()[1]
+ self.message = ""
+ self.bugid = None
+
+ # Commit message starts after one blank line
+ read_message = False
+ for l in lines:
+ if read_message:
+ self.message += l + "\n"
+ if not read_message and l == "":
+ read_message = True
+
+ if self.message and self.message != "" and ":" in self.message:
+ maybe_bugid = self.message.split(":")[0].strip()
+ if 10 >= len(maybe_bugid) >= 4:
+ self.bugid = maybe_bugid
+
+
+class History:
+ def __init__(self, log):
+ log_itr = iter(log.splitlines())
+ self.commits = []
+ commit_lines = []
+ for line in log_itr:
+ if line.startswith("commit ") and len(commit_lines) > 0:
+ commit = Commit(commit_lines)
+ self.commits.append(commit)
+ commit_lines = []
+ commit_lines.append(line)
+
+ if len(commit_lines) > 0:
+ commit = Commit(commit_lines)
+ self.commits.append(commit)
+
+ def contains(self, str):
+ return any(str in commit.message for commit in self.commits)
+
+ def size(self):
+ return len(self.commits)
+
+
+def print_explanation(options, jdk, jbr):
+ verbose(options, f"Reading history from '{jdk.rootpath}' on branch '{jdk.current_branch()}'")
+ if options.path:
+ verbose(options, f"\t(only under '{options.path}')")
+ verbose(options, f"Searching for same fixes in '{jbr.rootpath}' on branch '{jbr.current_branch()}'")
+
+
+def git_is_available():
+ p = None
+ try:
+ p = subprocess.run(["git", "--help"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ except:
+ pass
+ return p is not None and p.returncode == 0
+
+
+def main():
+ check_python_min_requirements()
+
+ options = Options()
+
+ jdk = GitRepo(options.jdkpath)
+ jbr = GitRepo(options.jbrpath)
+
+ print_explanation(options, jdk, jbr)
+
+ commits_to_save = []
+ try:
+ jdk_log = jdk.log(options.path, options.limit)
+ jdk_history = History(jdk_log)
+
+ jbr_log = jbr.log(options.path)
+ jbr_history = History(jbr_log)
+
+ verbose(options, f"Read {jdk_history.size()} commits in JDK, {jbr_history.size()} in JBR")
+
+ for c in jdk_history.commits:
+ if c.bugid:
+ verbose(options, f"Looking for bugfix for {c.bugid}")
+ if not jbr_history.contains(c.bugid):
+ commits_to_save.append(c)
+ print(f"[note] Fix for {c.bugid} not found in JBR ({jbr.rootpath})")
+ print(f" commit {c.sha}")
+ print(f" {first_line(c.message).strip()}")
+ except KeyboardInterrupt:
+ fatal("Interrupted")
+
+ if len(commits_to_save) > 0 and options.output_dir:
+ print()
+ if not os.path.exists(options.output_dir):
+ verbose(options, f"Creating output directory {options.output_dir}")
+ os.makedirs(options.output_dir)
+ nzeroes = len(str(len(commits_to_save)))
+ for i, c in enumerate(reversed(commits_to_save)):
+ fname = os.path.join(options.output_dir, f"{str(i).zfill(nzeroes)}-{c.bugid}.patch")
+ print(f"[note] {c.bugid} saved as {fname}")
+ fname = os.path.abspath(fname)
+ jdk.save_git_cmd(fname, ["format-patch", "-1", c.sha, "--stdout"])
+
+ script_fname = os.path.join(options.output_dir, "apply.sh")
+ with open(script_fname, "w") as script_file:
+ print(apply_script_code.format(os.path.abspath(jbr.rootpath), os.path.abspath(options.output_dir)),
+ file=script_file)
+ print(f"[note] Execute 'bash {script_fname}' to apply patches to {jbr.rootpath}")
+
+
+def check_python_min_requirements():
+ if sys.version_info < (3, 6):
+ fatal("Minimum version 3.6 is required to run this script")
+
+
+apply_script_code = """
+#!/bin/bash
+
+GITROOT={0}
+PATCHROOT={1}
+
+cd $PATCHROOT || exit 1
+PATCHES=$(find $PATCHROOT -name '*.patch' | sort -n)
+
+for P in $PATCHES; do
+ git -C $GITROOT am $P
+ if [ $? != 0 ]; then
+ mv "$P" "$P.failed"
+ echo "[ERROR] Patch $P did not apply cleanly. Try applying it manually."
+ echo "[NOTE] Execute this script to apply the remaining patches."
+ exit 1
+ else
+ mv "$P" "$P.done"
+ fi
+done
+
+echo "[NOTE] Done applying patches; check $PATCHROOT for .patch and .patch.failed to see if all have been applied."
+"""
+
+if __name__ == '__main__':
+ main()
diff --git a/jb/project/docker/Dockerfile-jbrTest b/jb/project/docker/Dockerfile-jbrTest
new file mode 100644
index 000000000000..8d8a284c4770
--- /dev/null
+++ b/jb/project/docker/Dockerfile-jbrTest
@@ -0,0 +1,57 @@
+# NOTE: This Dockerfile is meant to be used from the mkdocker_jbrtest.sh script.
+
+# Pull a concrete version of Linux that does NOT recieve updates after it's
+# been created. This is so that the image is as stable as possible to make
+# image creation reproducible.
+# NB: this also means there may be no security-related fixes there, need to
+# move the version to the next manually.
+
+ARG ARCH_FROM
+ARG ARCH=i386
+ARG OS_NAME
+ARG OS_VERSION
+
+# jetbrains/runtime:jbrTest_${os_name}${os_version}-$arch
+FROM ${ARCH_FROM}/${OS_NAME}:${OS_VERSION}
+
+COPY jbr-11_0_16-linux-x86-b2043.64.tar.gz /jbr/
+ARG ARCH
+RUN \
+ if [ "$ARCH" = "i386" ]; then \
+ # Set up boot JDK for building
+ cd /jbr && \
+ tar --strip-components=1 -xzf jbr-11_0_16-linux-x86-b2043.64.tar.gz && \
+ rm jbr-11_0_16-linux-x86-b2043.64.tar.gz; \
+ echo Installing packages required for i386 only; \
+ dpkg --add-architecture i386; \
+ apt-get update -y; \
+ apt-get install -y \
+ libc6:i386 \
+ libncurses5 libncurses5:i386 \
+ libstdc++6:i386 \
+ zlib1g:i386; \
+ else \
+ echo Skipping the step installing packages specific for the platform; \
+ fi; \
+ apt-get update -y; \
+ apt-get install -y \
+ binutils:${ARCH} \
+ libcanberra-gtk-module:${ARCH} \
+ libgtk2.0-0:${ARCH} \
+ libxext6:${ARCH} \
+ libxi6:${ARCH} \
+ libxrender-dev:${ARCH} \
+ libxtst6:${ARCH} \
+ libxrandr2:${ARCH} \
+ libfreetype6:${ARCH} \
+ fontconfig:${ARCH} \
+ libnss3:${ARCH} \
+ libatk-bridge2.0-0:${ARCH} \
+ libgbm1:${ARCH} \
+ libxkbcommon0:${ARCH} \
+ libasound2:${ARCH};\
+ apt-get clean all
+
+ENV JAVA_HOME=/jbr
+ENV DISPLAY=:0
+
diff --git a/jb/project/docker/Dockerfile-jbrTest.musl b/jb/project/docker/Dockerfile-jbrTest.musl
new file mode 100644
index 000000000000..28fb05114816
--- /dev/null
+++ b/jb/project/docker/Dockerfile-jbrTest.musl
@@ -0,0 +1,35 @@
+# NOTE: This Dockerfile is meant to be used from the mkdocker_jbrtest.sh script.
+
+# Pull a concrete version of Linux that does NOT recieve updates after it's
+# been created. This is so that the image is as stable as possible to make
+# image creation reproducible.
+# NB: this also means there may be no security-related fixes there, need to
+# move the version to the next manually.
+
+ARG ARCH_FROM
+ARG ARCH=i386
+ARG OS_NAME
+ARG OS_VERSION
+
+# jetbrains/runtime:jbrTest_${os_name}${os_version}-$arch
+FROM ${ARCH_FROM}/${OS_NAME}:${OS_VERSION}
+#FROM arm64v8/alpine:3.12
+
+ARG ARCH
+RUN \
+ apk --no-cache add --update \
+ binutils=2.34-r2 \
+ libcanberra-gtk2=0.30-r5 \
+ gtk+2.0=2.24.32-r1 \
+ libxext=1.3.4-r0 \
+ libxrender-dev=0.9.10-r3 \
+ libxtst=1.2.3-r3 \
+ freetype=2.10.4-r2 \
+ fontconfig=2.13.1-r2 \
+ font-xfree86-type1=1.0.4-r0
+
+COPY jbrsdk_17.tar.gz /jdk17/
+RUN cd /jdk17 && tar --strip-components=1 -xzf jbrsdk_17.tar.gz && rm /jdk17/jbrsdk_17.tar.gz
+
+ENV JAVA_HOME=/jdk17
+ENV DISPLAY=:0
diff --git a/jb/project/docker/Dockerfile.alpine b/jb/project/docker/Dockerfile.alpine
new file mode 100644
index 000000000000..f7d3770d050f
--- /dev/null
+++ b/jb/project/docker/Dockerfile.alpine
@@ -0,0 +1,45 @@
+# NOTE: This Dockerfile is meant to be used from the mkdocker_musl_.sh script.
+
+# Pull a concrete version of Linux that does NOT recieve updates after it's
+# been created. This is so that the image is as stable as possible to make
+# image creation reproducible.
+# NB: this also means there may be no security-related fixes there, need to
+# move the version to the next manually.
+FROM alpine:3.14
+
+# Install the necessary build tools
+RUN apk --no-cache add --update \
+ alsa-lib-dev=1.2.5-r2 \
+ autoconf=2.71-r0 \
+ bash=5.1.16-r0 \
+ build-base=0.5-r3 \
+ bzip2=1.0.8-r1 \
+ cups-dev=2.3.3-r3 \
+ file=5.40-r1 \
+ fontconfig=2.13.1-r4 \
+ fontconfig-dev=2.13.1-r4 \
+ freetype-dev=2.10.4-r3 \
+ git=2.32.7-r0 \
+ grep=3.7-r0 \
+ libx11-dev=1.7.3.1-r0 \
+ libxext-dev=1.3.4-r0 \
+ libxrandr-dev=1.5.2-r1 \
+ libxrender-dev=0.9.10-r3 \
+ libxt-dev=1.2.1-r0 \
+ libxtst-dev=1.2.3-r3 \
+ linux-headers=5.10.41-r0 \
+ rsync=3.2.5-r0 \
+ tar=1.34-r1 \
+ wayland-dev=1.19.0-r0 \
+ wayland-protocols=1.21-r0 \
+ zip=3.0-r9 \
+ vulkan-headers=1.2.170-r0 \
+ vulkan-loader-dev=1.2.170-r1 \
+ glslang=8.13.3743-r1
+
+COPY gtk-shell.xml /gtk-shell.xml
+
+RUN git config --global user.email "teamcity@jetbrains.com" && \
+ git config --global user.name "builduser" && \
+ git config --global --add safe.directory '*' && \
+ git config --global http.postBuffer 524288000
diff --git a/jb/project/docker/Dockerfile.oraclelinux b/jb/project/docker/Dockerfile.oraclelinux
new file mode 100644
index 000000000000..416542119de6
--- /dev/null
+++ b/jb/project/docker/Dockerfile.oraclelinux
@@ -0,0 +1,78 @@
+# NOTE: This Dockerfile is meant to be used from the mkdocker_.sh script.
+
+# Pull a concrete version of Linux that does NOT recieve updates after it's
+# been created. This is so that the image is as stable as possible to make
+# image creation reproducible.
+# NB: this also means there may be no security-related fixes there, need to
+# move the version to the next manually.
+
+FROM oraclelinux:8
+
+# Install the necessary build tools
+RUN yum -y update && \
+ yum -y install gcc-toolset-10-10.1-0.el8 && \
+ yum -y install --enablerepo=ol8_codeready_builder \
+ alsa-lib-devel-1.1.9-4.el8 \
+ at-spi2-atk-devel-2.26.2-1.el8 \
+ autoconf-2.69-29.el8_10.1 \
+ automake-1.16.1-6.el8 \
+ bison-3.0.4-10.el8 \
+ bzip2-libs-1.0.6-26.el8 \
+ cairo-devel-1.15.12-6.el8 \
+ cups-devel-2.2.6-60.el8_10 \
+ file-5.33-26.el8 \
+ flex-2.6.1-9.el8 \
+ fontconfig-devel-2.13.1-4.el8 \
+ freetype-devel-2.9.1-9.el8 \
+ gcc-c++-8.5.0-22.0.1.el8_10 \
+ git-2.43.5-1.el8_10 \
+ git-core-2.43.5-1.el8_10 \
+ libtool-2.4.6-25.el8 \
+ libstdc++-static-8.5.0-22.0.1.el8_10 \
+ libXcomposite-0.4.4-14.el8 \
+ libXdamage-1.1.4-14.el8 \
+ libXi-devel-1.7.10-1.el8 \
+ libxkbcommon-0.9.1-1.el8 \
+ libXrandr-devel-1.5.2-1.el8 \
+ libXrender-devel-0.9.10-7.el8 \
+ libXt-devel-1.1.5-12.el8 \
+ libXtst-devel-1.2.3-7.el8 \
+ make-devel-4.2.1-11.el8 \
+ mesa-libgbm-23.1.4-3.el8_10 \
+ ninja-build-1.8.2-1.el8 \
+ perl-IPC-Cmd-1.02-1.el8 \
+ rsync-3.1.3-19.el8_7.1 \
+ unzip-6.0-46.el8 \
+ wayland-devel-1.21.0-1.el8 \
+ wayland-protocols-devel-1.25-1.el8 \
+ pango-devel-1.42.4-8.el8 \
+ python36-3.6.8-39.module+el8.10.0+90274+07ba55de \
+ cmake-3.26.5-2.el8 \
+ vulkan-headers-1.3.250.1-1.el8 \
+ vulkan-loader-devel-1.3.250.1-1.el8 \
+ vulkan-validation-layers-1.3.250.1-1.el8 && \
+ yum -y clean all
+
+COPY gtk-shell.xml /gtk-shell.xml
+
+RUN git config --global user.email "teamcity@jetbrains.com" && \
+ git config --global user.name "builduser" && \
+ git config --global --add safe.directory '*' && \
+ git config --global http.postBuffer 524288000
+
+# Build GLSLC
+RUN git clone https://github.com/google/shaderc --branch v2023.6 \
+ && cd shaderc \
+ && ./utils/git-sync-deps \
+ && mkdir build \
+ && cd build \
+ && cmake \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_INSTALL_PREFIX=/usr/local \
+ -DSHADERC_SKIP_TESTS=ON \
+ -DSHADERC_SKIP_EXAMPLES=ON \
+ -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
+ -DSPIRV_SKIP_EXECUTABLES=ON \
+ -DENABLE_SPVREMAPPER=OFF \
+ .. \
+ && make install
diff --git a/jb/project/docker/Dockerfile.ubuntu.x86 b/jb/project/docker/Dockerfile.ubuntu.x86
new file mode 100644
index 000000000000..6bdb74b7c844
--- /dev/null
+++ b/jb/project/docker/Dockerfile.ubuntu.x86
@@ -0,0 +1,50 @@
+# NOTE: This Dockerfile is meant to be used from the mkdocker_x86.sh script.
+
+# Pull a concrete version of Linux that does NOT receive updates after it's
+# been created. This is so that the image is as stable as possible to make
+# image creation reproducible.
+# NB: this also means there may be no security-related fixes there, need to
+# move the version to the next manually.
+#FROM i386/ubuntu:xenial
+#FROM i386/ubuntu:bionic
+FROM i386/ubuntu:focal
+
+RUN linux32 \
+ apt-get update && apt-get install -y --no-install-recommends apt-utils
+RUN export DEBIAN_FRONTEND=noninteractive \
+ export DEBCONF_NONINTERACTIVE_SEEN=true && \
+ echo 'tzdata tzdata/Areas select Etc' | debconf-set-selections; \
+ echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections; \
+ linux32 \
+ apt-get -y install \
+ autoconf \
+ build-essential \
+ curl \
+ file \
+ git \
+ libx11-dev \
+ libxext-dev \
+ libxrender-dev \
+ libxrandr-dev \
+ libxtst-dev \
+ libxt-dev \
+ libcups2-dev \
+ libasound2-data \
+# libpng12-0 \
+ libasound2 \
+ libfreetype6 \
+ libfontconfig1-dev \
+ libasound2-dev \
+ rsync \
+ unzip \
+ zip
+RUN linux32 \
+ apt-get -y install \
+ g++-10 \
+ gcc-10 && \
+ update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 && \
+ apt-get clean -qy && \
+ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
+
+RUN git config --global user.email "teamcity@jetbrains.com" && \
+ git config --global user.name "builduser"
diff --git a/jb/project/docker/mkdocker_aarch64.sh b/jb/project/docker/mkdocker_aarch64.sh
new file mode 100755
index 000000000000..f0476f4cd7b5
--- /dev/null
+++ b/jb/project/docker/mkdocker_aarch64.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -euxo pipefail
+
+wget https://raw.githubusercontent.com/GNOME/gtk/refs/heads/main/gdk/wayland/protocol/gtk-shell.xml
+# This script creates a Docker image suitable for building AArch64 variant
+
+docker build --platform=linux/aarch64 -t jetbrains/runtime:oraclelinux8_aarch64 -f Dockerfile.oraclelinux .
+
+# NB: the resulting container can (and should) be used without the network
+# connection (--network none) during build in order to reduce the chance
+# of build contamination.
diff --git a/jb/project/docker/mkdocker_jbrtest.sh b/jb/project/docker/mkdocker_jbrtest.sh
new file mode 100755
index 000000000000..4550098c7f32
--- /dev/null
+++ b/jb/project/docker/mkdocker_jbrtest.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+machine=$(uname -m)
+
+echo "Building image for "$machine" arch"
+
+case "$machine" in
+ "aarch64" | "arm64v8" | "arm64")
+ arch=arm64
+ arch_from=arm64v8
+ ;;
+ "x86_64" | "amd64")
+ arch=amd64
+ arch_from=amd64
+ ;;
+esac
+
+
+# This script creates Docker images for testing JBR executables
+
+
+function build {
+ local arch=$1
+ local os_name=$2
+ local os_version=$3
+ local arch_from=${4:-$arch}
+
+ echo "Building image for ${os_name} ${os_version} ${arch}"
+ echo "====================================="
+
+ docker build -t jetbrains/runtime:jbrTest_${os_name}${os_version}-$arch \
+ --build-arg ARCH="$arch" \
+ --build-arg ARCH_FROM=$arch_from \
+ --build-arg OS_NAME=${os_name} \
+ --build-arg OS_VERSION="${os_version}" \
+ -f Dockerfile-jbrTest .
+
+ return 0
+}
+
+
+function downloadJBR {
+ JBR_REMOTE_FILE=jbr-11_0_16-linux-x86-b2043.64.tar.gz
+ JBR_SHA=d3e4d488bb8e0edf4fa0832a4ff5b5dcac69e646640ae06afb1b49e419536762
+ JBR_LOCAL_FILE=$JBR_REMOTE_FILE
+
+ if [ ! -f $JBR_LOCAL_FILE ]; then
+ # Obtain "JBR" from outside of the container.
+ curl -o $JBR_LOCAL_FILE https://cache-redirector.jetbrains.com/intellij-jbr/${JBR_REMOTE_FILE} -O
+ else
+ echo "Runtime \"$JBR_LOCAL_FILE\" present, skipping download"
+ fi
+
+ # Verify that what we've downloaded can be trusted.
+ sha256sum -c - <
+
+
+
+
+
+
+
+
diff --git a/jb/project/idea-project-files/modules.xml b/jb/project/idea-project-files/modules.xml
new file mode 100644
index 000000000000..a87145139038
--- /dev/null
+++ b/jb/project/idea-project-files/modules.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+ ###MODULE_IMLS###
+
+
+
+
+
diff --git a/jb/project/idea-project-files/vcs.xml b/jb/project/idea-project-files/vcs.xml
new file mode 100644
index 000000000000..c2220951e2dd
--- /dev/null
+++ b/jb/project/idea-project-files/vcs.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/jb/project/java-gradle/build.gradle b/jb/project/java-gradle/build.gradle
new file mode 100644
index 000000000000..c5d18ab682ef
--- /dev/null
+++ b/jb/project/java-gradle/build.gradle
@@ -0,0 +1,135 @@
+apply plugin: 'java'
+import org.gradle.internal.os.OperatingSystem
+
+repositories {
+ mavenCentral()
+}
+
+def test_jvm = {
+ if (project.hasProperty('jbsdkhome')) {
+ file(jbsdkhome + (OperatingSystem.current().isWindows()?"/bin/java.exe" : "/bin/java")).absolutePath
+ } else {
+ if (OperatingSystem.current().isMacOsX()) {
+ file('../../../build/macosx-x86_64-normal-server-release/images/jdk-bundle/jdk-11.0.4.jdk/Contents/Home/bin/java').absolutePath
+ } else if (OperatingSystem.current().isLinux()) {
+ file('../../../build/linux-x86_64-normal-server-release/images/jdk/bin/java').absolutePath
+ } else {
+ file('../../../build/windows-x86_64-normal-server-release/images/jdk/bin/java.exe').absolutePath
+ }
+ }
+}
+
+dependencies {
+ testCompile('junit:junit:4.12'){
+ exclude group: 'org.hamcrest'
+ }
+ testCompile 'org.hamcrest:hamcrest-library:1.3'
+ testCompile 'net.java.dev.jna:jna:4.4.0'
+ testCompile 'com.twelvemonkeys.imageio:imageio-tiff:3.3.2'
+ testCompile 'org.apache.commons:commons-lang3:3.0'
+}
+
+def jdk_modules = ["java.base", "java.logging", "java.prefs",
+ "java.se.ee", "java.sql", "java.datatransfer",
+ "java.management", "java.rmi", "java.security.jgss",
+ "java.sql.rowset", "java.desktop", "java.management.rmi",
+ "java.scripting", "java.security.sasl", "java.transaction",
+ "java.instrument", "java.naming", "java.se",
+ "java.smartcardio", "java.xml.crypto"]
+
+def jdk_class_dirs = []
+
+jdk_modules.collect(jdk_class_dirs) {
+ new File("../../../src/" + it + "/share/classes")
+}
+
+if (OperatingSystem.current().isMacOsX())
+ jdk_modules.collect(jdk_class_dirs) {
+ "../../../src/" + it + "/macosx/classes"
+ }
+else if (OperatingSystem.current().isLinux()) {
+ jdk_modules.collect(jdk_class_dirs) {
+ "../../../src/" + it + "/solaris/classes"
+ }
+ jdk_modules.collect(jdk_class_dirs) {
+ "../../../src/" + it + "/unix/classes"
+ }
+} else
+ jdk_modules.collect(jdk_class_dirs) {
+ "../../../src/" + it + "/windows/classes"
+ }
+
+sourceSets.main.java.srcDirs = jdk_class_dirs
+
+sourceSets {
+ test {
+ java {
+ srcDir "../../../test/jdk/jbu"
+ }
+ }
+}
+
+test.dependsOn.clear()
+
+test.dependsOn tasks.compileTestJava
+
+test {
+ systemProperty "jb.java2d.metal", "true"
+ systemProperty "testdata", file('../../../test/jdk/jbu/testdata').absolutePath
+
+// Generate golden images for DroidFontTest and MixedTextTest
+// systemProperty "gentestdata", ""
+
+// Enable Java2D logging (https://confluence.jetbrains.com/display/JRE/Java2D+Rendering+Logging)
+// systemProperty "sun.java2d.trace", "log"
+// systemProperty "sun.java2d.trace", "log,pimpl"
+
+ outputs.upToDateWhen { false }
+ executable = test_jvm()
+
+// Enable async/dtrace profiler
+ jvmArgs "-XX:+PreserveFramePointer"
+// Enable native J2D logging (only in debug build)
+// Can be turned on for J2D by adding "#define DEBUG 1" into jdk/src/share/native/sun/java2d/Trace.h
+
+// environment 'J2D_TRACE_LEVEL', '4'
+}
+
+def buildDir = project.buildscript.sourceFile.parentFile.parentFile.parentFile.parentFile
+
+def make_cmd = "make"
+if (OperatingSystem.current().isWindows()) {
+ def cyg_make_cmd = new File("c:/cygwin64/bin/make.exe")
+ if (cyg_make_cmd.exists()) make_cmd = cyg_make_cmd.absolutePath
+}
+def test_run = false
+task make_images {
+ doLast {
+ if (!test_run) {
+ def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "images")
+ def proc = pb.redirectErrorStream(true).start()
+ proc.inputStream.eachLine { println it }
+ assert proc.waitFor() == 0
+ }
+ }
+}
+
+task make_clean {
+ doLast {
+ def pb = new ProcessBuilder().command(make_cmd.toString(), "-C", buildDir.absolutePath, "clean")
+ def proc = pb.redirectErrorStream(true).start()
+ proc.inputStream.eachLine { println it }
+ assert proc.waitFor() == 0
+ }
+}
+
+task run_test {
+ doLast {
+ test_run = true
+ }
+}
+
+tasks.cleanTest.dependsOn tasks.run_test
+classes.dependsOn.clear()
+classes.dependsOn tasks.make_images
+tasks.cleanClasses.dependsOn tasks.make_clean
diff --git a/jb/project/tools/common/modules.list b/jb/project/tools/common/modules.list
new file mode 100644
index 000000000000..522acb7cb43b
--- /dev/null
+++ b/jb/project/tools/common/modules.list
@@ -0,0 +1,54 @@
+java.base,
+java.compiler,
+java.datatransfer,
+java.desktop,
+java.instrument,
+java.logging,
+java.management,
+java.management.rmi,
+java.naming,
+java.net.http,
+java.prefs,
+java.rmi,
+java.scripting,
+java.se,
+java.security.jgss,
+java.security.sasl,
+java.smartcardio,
+java.sql,
+java.sql.rowset,
+java.transaction.xa,
+java.xml,
+java.xml.crypto,
+jdk.accessibility,
+jdk.attach,
+jdk.charsets,
+jdk.compiler,
+jdk.crypto.cryptoki,
+jdk.crypto.ec,
+jdk.dynalink,
+jdk.httpserver,
+jdk.internal.ed,
+jdk.internal.le,
+jdk.internal.vm.ci,
+jdk.javadoc,
+jdk.jdi,
+jdk.jdwp.agent,
+jdk.jfr,
+jdk.jsobject,
+jdk.localedata,
+jdk.management,
+jdk.management.agent,
+jdk.management.jfr,
+jdk.naming.dns,
+jdk.naming.rmi,
+jdk.net,
+jdk.sctp,
+jdk.security.auth,
+jdk.security.jgss,
+jdk.unsupported,
+jdk.unsupported.desktop,
+jdk.xml.dom,
+jdk.zipfs,
+jdk.hotspot.agent,
+jdk.jcmd
diff --git a/jb/project/tools/common/scripts/common.sh b/jb/project/tools/common/scripts/common.sh
new file mode 100644
index 000000000000..852f8d1a4317
--- /dev/null
+++ b/jb/project/tools/common/scripts/common.sh
@@ -0,0 +1,188 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+function check_bundle_type_maketest() {
+ # check whether last char is 't', if so remove it
+ if [ "${bundle_type: -1}" == "t" ] && [ "${bundle_type: -2}" != "ft" ]; then
+ bundle_type="${bundle_type%?}"
+ do_maketest=1
+ else
+ do_maketest=0
+ fi
+}
+
+function getVersionProp() {
+ grep "^${1}" make/conf/version-numbers.conf | cut -d'=' -f2
+}
+
+DISABLE_WARNINGS_AS_ERRORS=""
+while getopts ":iw?" o; do
+ case "${o}" in
+ i) INC_BUILD=1 ;;
+ w) DISABLE_WARNINGS_AS_ERRORS="--disable-warnings-as-errors" ;;
+ esac
+done
+shift $((OPTIND-1))
+
+if [[ $# -lt 2 ]]; then
+ echo "Required at least two arguments: build_number bundle_type"
+ exit 1
+fi
+
+build_number=$1
+bundle_type=$2
+# shellcheck disable=SC2034
+architecture=${3:-x64} # aarch64 or x64
+
+check_bundle_type_maketest
+
+tag_prefix="jdk-"
+VERSION_FEATURE=$(getVersionProp "DEFAULT_VERSION_FEATURE")
+VERSION_INTERIM=$(getVersionProp "DEFAULT_VERSION_INTERIM")
+VERSION_UPDATE=$(getVersionProp "DEFAULT_VERSION_UPDATE")
+VERSION_PATCH=$(getVersionProp "DEFAULT_VERSION_PATCH")
+[[ $VERSION_UPDATE = 0 ]] && JBSDK_VERSION="$VERSION_FEATURE" || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}"
+[[ $VERSION_PATCH = 0 ]] || JBSDK_VERSION="${VERSION_FEATURE}.${VERSION_INTERIM}.${VERSION_UPDATE}.${VERSION_PATCH}"
+echo "##teamcity[setParameter name='env.JBSDK_VERSION' value='${JBSDK_VERSION}']"
+OPENJDK_TAG=$(git tag -l | grep "$tag_prefix$JBSDK_VERSION" | grep -v ga | sort -t "-" -k 2 -g | tail -n 1)
+JDK_BUILD_NUMBER=${JDK_BUILD_NUMBER:=$(echo $OPENJDK_TAG | awk -F "-|[+]" '{print $3}')}
+[ -z $JDK_BUILD_NUMBER ] && JDK_BUILD_NUMBER=1
+re='^[0-9]+$'
+if ! [[ $JDK_BUILD_NUMBER =~ $re ]] ; then
+ echo "error: JDK_BUILD_NUMBER Not a number: $JDK_BUILD_NUMBER"
+ JDK_BUILD_NUMBER=1
+fi
+echo "##teamcity[setParameter name='env.JDK_UPDATE_NUMBER' value='${JDK_BUILD_NUMBER}']"
+
+VENDOR_NAME="JetBrains s.r.o."
+VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION}+${JDK_BUILD_NUMBER}-${build_number}"
+[ -z "$bundle_type" ] || VENDOR_VERSION_STRING="${VENDOR_VERSION_STRING}-${bundle_type}"
+
+do_reset_changes=0
+do_reset_dcevm=0
+HEAD_REVISION=0
+
+STATIC_CONF_ARGS=""
+common_conf_props_file="jb/project/tools/common/static_conf_args.txt"
+if [[ -f "$common_conf_props_file" ]]; then
+ STATIC_CONF_ARGS=$(<$common_conf_props_file)
+fi
+OS_NAME=$(uname -s)
+# Enable reproducible builds
+TZ=UTC
+export TZ
+SOURCE_DATE_EPOCH="$(git log -1 --pretty=%ct)"
+export SOURCE_DATE_EPOCH
+
+COPYRIGHT_YEAR=""
+BUILD_TIME=""
+TOUCH_TIME=""
+REPRODUCIBLE_TAR_OPTS=""
+case "$OS_NAME" in
+ Linux)
+ COPYRIGHT_YEAR="$(date --utc --date=@$SOURCE_DATE_EPOCH +%Y)"
+ BUILD_TIME="$(date --utc --date=@$SOURCE_DATE_EPOCH +%F)"
+ REPRODUCIBLE_TAR_OPTS="--mtime=@$SOURCE_DATE_EPOCH --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
+ ;;
+ CYGWIN*)
+ COPYRIGHT_YEAR="$(date --utc --date=@$SOURCE_DATE_EPOCH +%Y)"
+ BUILD_TIME="$(date --utc --date=@$SOURCE_DATE_EPOCH +%F)"
+ REPRODUCIBLE_TAR_OPTS="--mtime=@$SOURCE_DATE_EPOCH --owner=0 --group=0 --numeric-owner --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime"
+ ;;
+ Darwin)
+ COPYRIGHT_YEAR="$(date -u -r $SOURCE_DATE_EPOCH +%Y)"
+ BUILD_TIME="$(date -u -r $SOURCE_DATE_EPOCH +%F)"
+ TOUCH_TIME="$(date -u -r $SOURCE_DATE_EPOCH +%Y%m%d%H%M.%S)"
+ REPRODUCIBLE_TAR_OPTS="--uid 0 --gid 0 --numeric-owner"
+ ;;
+esac
+
+WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS="--with-native-debug-symbols=zipped"
+
+if [ "$bundle_type" == "nomodft" ]; then
+ WITH_BUNDLED_FREETYPE="--with-freetype=bundled"
+else
+ WITH_BUNDLED_FREETYPE=""
+fi
+
+REPRODUCIBLE_BUILD_OPTS="--with-source-date=$SOURCE_DATE_EPOCH
+ --with-hotspot-build-time=$BUILD_TIME
+ --with-copyright-year=$COPYRIGHT_YEAR
+ --disable-absolute-paths-in-output
+ --with-build-user=builduser"
+
+function zip_native_debug_symbols() {
+ image_bundle_path=$(echo $1 | cut -d"/" -f-4)
+ jdk_name=$(echo $1 | cut -d"/" -f5)
+ jbr_diz_name=$2
+
+ [ -d "dizfiles" ] && rm -rf dizfiles
+ mkdir dizfiles
+
+ rsync_target="../../../../dizfiles"
+ [ -z "$jdk_name" ] && rsync_target=$rsync_target"/"$jbr_diz_name
+ (cd $image_bundle_path && find . -name '*.diz' -exec rsync -R {} $rsync_target \;)
+ [ ! -z "$jdk_name" ] && mv dizfiles/$jdk_name dizfiles/$jbr_diz_name
+
+ (cd dizfiles && find $jbr_diz_name -print0 | COPYFILE_DISABLE=1 \
+ tar --no-recursion --null -T - -czf ../"$jbr_diz_name".tar.gz) || do_exit $?
+}
+
+function do_exit() {
+ exit_code=$1
+ [ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
+ if [ $do_reset_dcevm -eq 1 ]; then
+ [ ! -z $HEAD_REVISION ] && git reset --hard $HEAD_REVISION
+ fi
+ exit "$exit_code"
+}
+
+function update_jsdk_mods() {
+ __jsdk=$1
+ __jcef_mods=$2
+ __orig_jsdk_mods=$3
+ __updated_jsdk_mods=$4
+
+ # re-create java.desktop.jmod with updated module-info.class
+ tmp=.java.desktop.$$.tmp
+ mkdir "$tmp" || exit $?
+ "$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.desktop.jmod || exit $?
+ "$__jsdk"/bin/javac \
+ --patch-module java.desktop="$__orig_jsdk_mods"/java.desktop.jmod \
+ --module-path "$__jcef_mods" -d "$tmp"/classes src/java.desktop/share/classes/module-info.java || exit $?
+ "$__jsdk"/bin/jmod \
+ create --class-path "$tmp"/classes --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
+ java.desktop.jmod || exit $?
+ mv java.desktop.jmod "$__updated_jsdk_mods" || exit $?
+ rm -rf "$tmp"
+
+ # re-create java.base.jmod with updated hashes
+ tmp=.java.base.$$.tmp
+ mkdir "$tmp" || exit $?
+ hash_modules=$("$__jsdk"/bin/jmod describe "$__orig_jsdk_mods"/java.base.jmod | grep hashes | awk '{print $2}' | tr '\n' '|' | sed s/\|$//) || exit $?
+ "$__jsdk"/bin/jmod extract --dir "$tmp" "$__orig_jsdk_mods"/java.base.jmod || exit $?
+ rm "$__updated_jsdk_mods"/java.base.jmod || exit $? # temp exclude from path
+ "$__jsdk"/bin/jmod \
+ create --module-path "$__updated_jsdk_mods" --hash-modules "$hash_modules" \
+ --class-path "$tmp"/classes --cmds "$tmp"/bin --config "$tmp"/conf --header-files "$tmp"/include --legal-notice "$tmp"/legal --libs "$tmp"/lib \
+ java.base.jmod || exit $?
+ mv java.base.jmod "$__updated_jsdk_mods" || exit $?
+ rm -rf "$tmp"
+}
+
+function get_mods_list() {
+ __mods=$1
+ echo $(ls $__mods) | sed s/\.jmod/,/g | sed s/,$//g | sed s/' '//g
+}
+
+function copy_jmods() {
+ __mods_list=$1
+ __jmods_from=$2
+ __jmods_to=$3
+
+ mkdir -p $__jmods_to
+
+ echo "${__mods_list}," | while read -d, mod; do cp $__jmods_from/$mod.jmod $__jmods_to/; done
+}
diff --git a/jb/project/tools/common/static_conf_args.txt b/jb/project/tools/common/static_conf_args.txt
new file mode 100644
index 000000000000..4bf644481990
--- /dev/null
+++ b/jb/project/tools/common/static_conf_args.txt
@@ -0,0 +1,4 @@
+--with-vendor-url=https://www.jetbrains.com/
+--with-vendor-bug-url=https://youtrack.jetbrains.com/issues/JBR
+--with-vendor-vm-bug-url=https://youtrack.jetbrains.com/issues/JBR
+
diff --git a/jb/project/tools/linux/scripts/mkimages_aarch64.sh b/jb/project/tools/linux/scripts/mkimages_aarch64.sh
new file mode 100755
index 000000000000..f43dd521fcc7
--- /dev/null
+++ b/jb/project/tools/linux/scripts/mkimages_aarch64.sh
@@ -0,0 +1,173 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script makes test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+# Environment variables:
+# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
+# to configure
+# By default JDK_BUILD_NUMBER is set zero
+# JCEF_PATH - specifies the path to the directory with JCEF binaries.
+# By default JCEF binaries should be located in ./jcef_linux_aarch64
+
+source jb/project/tools/common/scripts/common.sh
+
+JCEF_PATH=${JCEF_PATH:=./jcef_linux_aarch64}
+
+function do_configure {
+ sh configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build="$JDK_BUILD_NUMBER" \
+ --with-version-opt=b"$build_number" \
+ --with-boot-jdk="$BOOT_JDK" \
+ --enable-cds=yes \
+ --with-gtk-shell1-protocol=/gtk-shell.xml \
+ --with-vulkan \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ $WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
+ $WITH_BUNDLED_FREETYPE \
+ || do_exit $?
+}
+
+function is_musl {
+ libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
+ if [ -z $libc ]; then
+ # This is not Musl, return 1 == false
+ return 1
+ fi
+ return 0
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ libc_type_suffix=''
+ fastdebug_infix=''
+ __cds_opt=''
+
+ if is_musl; then libc_type_suffix='musl-' ; fi
+ __cds_opt="--generate-cds-archive"
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}aarch64-${fastdebug_infix:-}b${build_number}
+
+ echo Running jlink....
+ [ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+ $JSDK/bin/jlink \
+ --module-path "$__modules_path" --no-man-pages --compress=2 \
+ $__cds_opt --add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
+ mv release "$IMAGES_DIR"/"$__root_dir"/release
+ cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
+ copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
+ zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
+ fi
+
+ # jmod does not preserve file permissions (JDK-8173610)
+ [ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
+ [ -f "$IMAGES_DIR"/"$__root_dir"/lib/cef_server ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/cef_server
+
+ echo Creating "$JBR".tar.gz ...
+
+ (cd "$IMAGES_DIR" &&
+ find "$__root_dir" -print0 | LC_ALL=C sort -z | \
+ tar $REPRODUCIBLE_TAR_OPTS \
+ --no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
+ mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
+ [ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
+ touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
+ gzip "$JBR".tar || do_exit $?
+ rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=linux-aarch64-server-release
+
+jbr_name_postfix=""
+
+case "$bundle_type" in
+ "jcef")
+ do_reset_changes=1
+ jbr_name_postfix="_${bundle_type}"
+ do_maketest=1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "nomodft" | "")
+ jbr_name_postfix="_ft"
+ ;;
+ "fd")
+ do_reset_changes=1
+ jbr_name_postfix="_${bundle_type}"
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=linux-aarch64-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ make clean CONF=$RELEASE_NAME || do_exit $?
+fi
+make images CONF=$RELEASE_NAME || do_exit $?
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+echo Fixing permissions
+chmod -R a+r $JSDK
+
+if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
+ update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
+ cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
+ cat $JCEF_PATH/jcef.version >> $JSDK/release
+fi
+
+# create runtime image bundle
+modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-aarch64-b${build_number}
+ echo Creating "$JBRSDK_TEST" ...
+ [ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
+ make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
+ tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+ [ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
+ gzip "$JBRSDK_TEST".tar || do_exit $?
+fi
+
+do_exit 0
diff --git a/jb/project/tools/linux/scripts/mkimages_x64.sh b/jb/project/tools/linux/scripts/mkimages_x64.sh
new file mode 100755
index 000000000000..b6267439a719
--- /dev/null
+++ b/jb/project/tools/linux/scripts/mkimages_x64.sh
@@ -0,0 +1,190 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script makes test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+# Environment variables:
+# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
+# to configure
+# By default JDK_BUILD_NUMBER is set zero
+# JCEF_PATH - specifies the path to the directory with JCEF binaries.
+# By default JCEF binaries should be located in ./jcef_linux_x64
+
+source jb/project/tools/common/scripts/common.sh
+
+JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
+
+function do_configure {
+ if is_musl; then
+ LINUX_TARGET=""
+ else
+ LINUX_TARGET="\
+ --build=x86_64-unknown-linux-gnu \
+ --openjdk-target=x86_64-unknown-linux-gnu"
+ fi
+ sh configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build="$JDK_BUILD_NUMBER" \
+ --with-version-opt=b"$build_number" \
+ --with-boot-jdk="$BOOT_JDK" \
+ --enable-cds=yes \
+ --with-gtk-shell1-protocol=/gtk-shell.xml \
+ --with-vulkan \
+ $LINUX_TARGET \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ $WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
+ $WITH_BUNDLED_FREETYPE \
+ || do_exit $?
+}
+
+function is_musl {
+ libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
+ if [ -z $libc ]; then
+ # This is not Musl, return 1 == false
+ return 1
+ fi
+ return 0
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ libc_type_suffix=''
+ fastdebug_infix=''
+ __cds_opt=''
+
+ if is_musl; then
+ libc_type_suffix='musl-'
+ else
+ LINUX_TARGET="\
+ --build=x86_64-unknown-linux-gnu \
+ --openjdk-target=x86_64-unknown-linux-gnu"
+ fi
+ __cds_opt="--generate-cds-archive"
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x64-${fastdebug_infix:-}b${build_number}
+
+ echo Running jlink....
+ [ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+ $JSDK/bin/jlink \
+ --module-path "$__modules_path" --no-man-pages --compress=2 \
+ $__cds_opt --add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
+ mv release "$IMAGES_DIR"/"$__root_dir"/release
+ cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
+ copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
+ zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
+ fi
+
+ # jmod does not preserve file permissions (JDK-8173610)
+ [ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
+ [ -f "$IMAGES_DIR"/"$__root_dir"/lib/cef_server ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/cef_server
+
+ echo Creating "$JBR".tar.gz ...
+
+ (cd "$IMAGES_DIR" &&
+ find "$__root_dir" -print0 | LC_ALL=C sort -z | \
+ tar $REPRODUCIBLE_TAR_OPTS \
+ --no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
+ mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
+ [ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
+ touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
+ gzip "$JBR".tar || do_exit $?
+ rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=linux-x86_64-server-release
+
+jbr_name_postfix=""
+
+case "$bundle_type" in
+ "jcef")
+ do_reset_changes=1
+ jbr_name_postfix="_${bundle_type}"
+ jbrsdk_name_postfix="_${bundle_type}"
+ do_maketest=1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ jbrsdk_name_postfix="_${bundle_type}"
+ ;;
+ "nomodft" | "")
+ jbr_name_postfix="_ft"
+ jbrsdk_name_postfix="_ft"
+ ;;
+ "fd")
+ do_reset_changes=1
+ jbr_name_postfix="_${bundle_type}"
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=linux-x86_64-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ make clean CONF=$RELEASE_NAME || do_exit $?
+fi
+make images CONF=$RELEASE_NAME || do_exit $?
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+echo Fixing permissions
+chmod -R a+r $JSDK
+
+if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
+ update_jsdk_mods $JSDK $JCEF_PATH/jmods $JSDK/jmods $JSDK_MODS_DIR || do_exit $?
+ cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
+ cat $JCEF_PATH/jcef.version >> $JSDK/release
+fi
+
+# create runtime image bundle
+modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
+if [ "$bundle_type" == "jcef" ]|| [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x64-b${build_number}
+ echo Creating "$JBRSDK_TEST" ...
+ [ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
+ make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
+ tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+ [ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
+ gzip "$JBRSDK_TEST".tar || do_exit $?
+fi
+
+do_exit 0
diff --git a/jb/project/tools/linux/scripts/mkimages_x86.sh b/jb/project/tools/linux/scripts/mkimages_x86.sh
new file mode 100755
index 000000000000..cde46c7b58e4
--- /dev/null
+++ b/jb/project/tools/linux/scripts/mkimages_x86.sh
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+
+source jb/project/tools/common/scripts/common.sh
+
+function do_configure {
+ linux32 bash configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build="$JDK_BUILD_NUMBER" \
+ --with-version-opt=b"$build_number" \
+ --with-boot-jdk="$BOOT_JDK" \
+ $STATIC_CONF_ARGS \
+ --enable-cds=yes \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ $WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
+ || do_exit $?
+}
+
+function is_musl {
+ libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
+ if [ -z $libc ]; then
+ # This is not Musl, return 1 == false
+ return 1
+ fi
+ return 0
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ libc_type_suffix=''
+ fastdebug_infix=''
+ __cds_opt=''
+
+ if is_musl; then libc_type_suffix='musl-' ; fi
+ __cds_opt="--generate-cds-archive"
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-linux-${libc_type_suffix}x86-${fastdebug_infix:-}b${build_number}
+
+ echo Running jlink....
+ [ -d "$IMAGES_DIR"/"$__root_dir" ] && rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+ $JSDK/bin/jlink \
+ --module-path "$__modules_path" --no-man-pages --compress=2 \
+ $__cds_opt --add-modules "$__modules" --output "$IMAGES_DIR"/"$__root_dir"
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$IMAGES_DIR"/"$__root_dir"/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' "$IMAGES_DIR"/"$__root_dir"/release > release
+ mv release "$IMAGES_DIR"/"$__root_dir"/release
+ cp $IMAGES_DIR/jdk/lib/src.zip "$IMAGES_DIR"/"$__root_dir"/lib
+ copy_jmods "$__modules" "$__modules_path" "$IMAGES_DIR"/"$__root_dir"/jmods
+ zip_native_debug_symbols $IMAGES_DIR/jdk "${JBR}_diz"
+ fi
+
+ # jmod does not preserve file permissions (JDK-8173610)
+ [ -f "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper ] && chmod a+x "$IMAGES_DIR"/"$__root_dir"/lib/jcef_helper
+
+ echo Creating "$JBR".tar.gz ...
+
+ (cd "$IMAGES_DIR" &&
+ find "$__root_dir" -print0 | LC_ALL=C sort -z | \
+ tar $REPRODUCIBLE_TAR_OPTS \
+ --no-recursion --null -T - -cf "$JBR".tar) || do_exit $?
+ mv "$IMAGES_DIR"/"$JBR".tar ./"$JBR".tar
+ [ -f "$JBR".tar.gz ] && rm "$JBR.tar.gz"
+ touch -c -d "@$SOURCE_DATE_EPOCH" "$JBR".tar
+ gzip "$JBR".tar || do_exit $?
+ rm -rf "${IMAGES_DIR:?}"/"$__root_dir"
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=linux-x86-server-release
+
+case "$bundle_type" in
+ "jcef")
+ echo "not implemented" && do_exit 1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "fd")
+ do_reset_changes=1
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=linux-x86-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ make clean CONF=$RELEASE_NAME || do_exit $?
+fi
+make images CONF=$RELEASE_NAME || do_exit $?
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+echo Fixing permissions
+chmod -R a+r $JSDK
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+# create runtime image bundle
+modules=$(grep -v "jdk.internal.vm" jb/project/tools/common/modules.list | xargs | sed s/" "//g) || do_exit $?
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat $JSDK/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" $JBRSDK_BUNDLE $JSDK_MODS_DIR "$modules" || do_exit $?
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-linux-${libc_type_suffix}test-x86-b${build_number}
+ echo Creating "$JBRSDK_TEST" ...
+ [ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
+ make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
+ tar -pcf "$JBRSDK_TEST".tar -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+ [ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
+ gzip "$JBRSDK_TEST".tar || do_exit $?
+fi
+
+do_exit 0
diff --git a/jb/project/tools/mac/scripts/codesign.sh b/jb/project/tools/mac/scripts/codesign.sh
new file mode 100755
index 000000000000..108f9c20af3c
--- /dev/null
+++ b/jb/project/tools/mac/scripts/codesign.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
+
+source "$SCRIPT_DIR/jetsign-common.sh" || exit 1
+
+function isMacOsBinary() {
+ file "$1" | grep -q 'Mach-O'
+}
+
+function isSigned() {
+ codesign --verify "$1" >/dev/null 2>&1 && ! grep -q Signature=adhoc < <(codesign --display --verbose "$1" 2>&1)
+}
+
+# last argument is a path to be signed
+pathToBeSigned="$(pwd)/${*: -1}"
+jetSignArgs=("${@:1:$#-1}")
+if [[ ! -f "$pathToBeSigned" ]]; then
+ echo "$pathToBeSigned is missing or not a file"
+ exit 1
+elif isSigned "$pathToBeSigned" && ! isForced "${jetSignArgs[@]}" ; then
+ echo "Already signed: $pathToBeSigned"
+elif [[ "$JETSIGN_CLIENT" == "null" ]]; then
+ echo "JetSign client is missing, cannot proceed with signing"
+ exit 1
+elif ! isMacOsBinary "$pathToBeSigned" && [[ "$pathToBeSigned" != *.sit ]] && [[ "$pathToBeSigned" != *.tar.gz ]]; then
+ echo "$pathToBeSigned won't be signed, assumed not to be a macOS executable"
+else
+ if isMacOsBinary "$pathToBeSigned" && ! isSigned "$pathToBeSigned" ; then
+ echo "Unsigned macOS binary: $pathToBeSigned"
+ fi
+ workDir=$(dirname "$pathToBeSigned")
+ pathSigned="$workDir/signed/${pathToBeSigned##*/}"
+ jetSignExtensions=$(jetSignExtensions "${jetSignArgs[@]}")
+ contentType=$(jetSignContentType "$pathToBeSigned")
+ (
+ cd "$workDir" || exit 1
+
+ max_attempts=3
+ attempt=1
+ while [ $attempt -le $max_attempts ]; do
+ if "$JETSIGN_CLIENT" -log-format text -max-wait 1m -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"; then
+ break
+ else
+ if [ $attempt -eq $max_attempts ]; then
+ echo "Failed to sign after $max_attempts attempts"
+ exit 1
+ fi
+ echo "Attempt $attempt failed, retrying in 5 seconds..."
+ sleep 5
+ ((attempt++))
+ fi
+ done
+
+ # SRE-1223 (Codesign removes execute bits in executable files) workaround
+ chmod "$(stat -f %A "$pathToBeSigned")" "$pathSigned"
+ if isMacOsBinary "$pathSigned"; then
+ isSigned "$pathSigned"
+ fi
+ rm "$pathToBeSigned"
+ mv "$pathSigned" "$pathToBeSigned"
+ rm -rf "$workDir/signed"
+ )
+fi
diff --git a/jb/project/tools/mac/scripts/entitlements.xml b/jb/project/tools/mac/scripts/entitlements.xml
new file mode 100644
index 000000000000..9d4904529342
--- /dev/null
+++ b/jb/project/tools/mac/scripts/entitlements.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ com.apple.security.cs.allow-jit
+
+ com.apple.security.cs.allow-unsigned-executable-memory
+
+ com.apple.security.cs.allow-dyld-environment-variables
+
+ com.apple.security.cs.disable-library-validation
+
+ com.apple.security.cs.disable-executable-page-protection
+
+
+
\ No newline at end of file
diff --git a/jb/project/tools/mac/scripts/jetsign-common.sh b/jb/project/tools/mac/scripts/jetsign-common.sh
new file mode 100755
index 000000000000..4153ba80dfd3
--- /dev/null
+++ b/jb/project/tools/mac/scripts/jetsign-common.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+set -euo pipefail
+
+function isForced() {
+ for arg in "$@"; do
+ if [[ "$arg" == --force ]]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+function jetSignExtensions() {
+ args=("$@")
+ ((lastElementIndex=${#args[@]}-1))
+ for index in "${!args[@]}"; do
+ arg=${args[$index]}
+ case "$arg" in
+ --sign | -s)
+ echo -n 'mac_codesign_identity='
+ continue
+ ;;
+ --entitlements)
+ echo -n 'mac_codesign_entitlements='
+ continue
+ ;;
+ --options=runtime)
+ echo -n 'mac_codesign_options=runtime'
+ ;;
+ --force)
+ echo -n 'mac_codesign_force=true'
+ ;;
+ --timestamp | --verbose | -v)
+ continue
+ ;;
+ *)
+ echo -n "$arg"
+ ;;
+ esac
+ if [[ $index != "$lastElementIndex" ]]; then
+ echo -n ","
+ fi
+ done
+}
+
+# See jetbrains.sign.util.FileUtil.contentType
+function jetSignContentType() {
+ case "${1##*/}" in
+ *.sit)
+ echo -n 'application/x-mac-app-zip'
+ ;;
+ *.tar.gz)
+ echo -n 'application/x-mac-app-targz'
+ ;;
+ *.pkg)
+ echo -n 'application/x-mac-pkg'
+ ;;
+ *)
+ echo -n 'application/x-mac-app-bin'
+ ;;
+ esac
+}
+
diff --git a/jb/project/tools/mac/scripts/mkimages.sh b/jb/project/tools/mac/scripts/mkimages.sh
new file mode 100755
index 000000000000..6756d5cc899e
--- /dev/null
+++ b/jb/project/tools/mac/scripts/mkimages.sh
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script makes test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+# Environment variables:
+# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
+# to configure
+# By default JDK_BUILD_NUMBER is set zero
+# JCEF_PATH - specifies the path to the directory with JCEF binaries.
+# By default JCEF binaries should be located in ./jcef_mac
+
+source jb/project/tools/common/scripts/common.sh
+
+JCEF_PATH=${JCEF_PATH:=./jcef_mac}
+BOOT_JDK=${BOOT_JDK:=$(/usr/libexec/java_home -v 17)}
+
+function do_configure {
+ sh configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-macosx-bundle-name-base=${VENDOR_VERSION_STRING} \
+ --with-macosx-bundle-id-base="com.jetbrains.jbr" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build="$JDK_BUILD_NUMBER" \
+ --with-version-opt=b"$build_number" \
+ --with-boot-jdk="$BOOT_JDK" \
+ --enable-cds=yes \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ $WITH_ZIPPED_NATIVE_DEBUG_SYMBOLS \
+ || do_exit $?
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ fastdebug_infix=''
+ __cds_opt=''
+ __cds_opt="--generate-cds-archive"
+
+ tmp=.bundle.$$.tmp
+ mkdir "$tmp" || do_exit $?
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-osx-${architecture}-${fastdebug_infix:-}b${build_number}
+
+ JRE_CONTENTS=$tmp/$__root_dir/Contents
+ mkdir -p "$JRE_CONTENTS" || do_exit $?
+
+ echo Running jlink...
+ "$JSDK"/bin/jlink \
+ --module-path "$__modules_path" --no-man-pages --compress=2 \
+ $__cds_opt --add-modules "$__modules" --output "$JRE_CONTENTS/Home" || do_exit $?
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> "$JRE_CONTENTS/Home/release"
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' $JRE_CONTENTS/Home/release > release
+ mv release $JRE_CONTENTS/Home/release
+ cp $IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk/Contents/Home/lib/src.zip $JRE_CONTENTS/Home/lib
+ copy_jmods "$__modules" "$__modules_path" "$JRE_CONTENTS"/Home/jmods
+ zip_native_debug_symbols $IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk "${JBR}_diz"
+ fi
+
+ if [ "$bundle_type" == "jcef" ]; then
+ cat $JCEF_PATH/jcef.version >> "$JRE_CONTENTS/Home/release"
+ fi
+
+ cp -R "$JSDK"/../MacOS "$JRE_CONTENTS"
+ cp "$JSDK"/../Info.plist "$JRE_CONTENTS"
+
+ [ -n "$bundle_type" ] && (cp -a $JCEF_PATH/Frameworks "$JRE_CONTENTS" || do_exit $?)
+
+ echo Creating "$JBR".tar.gz ...
+ # Normalize timestamp
+ find "$tmp"/"$__root_dir" -print0 | xargs -0 touch -c -h -t "$TOUCH_TIME"
+
+ (cd "$tmp" &&
+ find "$__root_dir" -print0 | LC_ALL=C sort -z | \
+ COPYFILE_DISABLE=1 tar $REPRODUCIBLE_TAR_OPTS --no-recursion --null -T - \
+ -czf "$JBR".tar.gz --exclude='*.dSYM' --exclude='man') || do_exit $?
+ mv "$tmp"/"$JBR".tar.gz "$JBR".tar.gz
+ rm -rf "$tmp"
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+CONF_ARCHITECTURE=x86_64
+if [[ "${architecture}" == *aarch64* ]]; then
+ CONF_ARCHITECTURE=aarch64
+fi
+RELEASE_NAME=macosx-${CONF_ARCHITECTURE}-server-release
+
+case "$bundle_type" in
+ "jcef")
+ do_reset_changes=1
+ do_maketest=1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "fd")
+ do_reset_changes=1
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=macosx-${CONF_ARCHITECTURE}-server-fastdebug
+ JBSDK=macosx-${architecture}-server-release
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ make clean CONF=$RELEASE_NAME || do_exit $?
+fi
+make images CONF=$RELEASE_NAME || do_exit $?
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+
+JSDK=$IMAGES_DIR/jdk-bundle/jdk-$JBSDK_VERSION.jdk/Contents/Home
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+# test/jdk/jb/java/awt/Focus/FullScreenFocusStealing.java test/jdk/java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java test/jdk/java/awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java test/jdk/java/awt/Robot/NonEmptyErrorStream.java
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
+ if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
+ update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
+ cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not changed
+ fi
+
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+# create runtime image bundle
+modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat "$JSDK"/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\n//g) || do_exit $?
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=${JBRSDK_BUNDLE}-${JBSDK_VERSION}-osx-test-${architecture}-b${build_number}
+ echo Creating "$JBRSDK_TEST" ...
+ [ $do_reset_changes -eq 1 ] && git checkout HEAD jb/project/tools/common/modules.list src/java.desktop/share/classes/module-info.java
+ make test-image CONF=$RELEASE_NAME JBR_API_JBR_VERSION=TEST || do_exit $?
+ [ -f "$JBRSDK_TEST.tar.gz" ] && rm "$JBRSDK_TEST.tar.gz"
+ COPYFILE_DISABLE=1 tar -pczf "$JBRSDK_TEST".tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+fi
+
+do_exit 0
diff --git a/jb/project/tools/mac/scripts/notarize.sh b/jb/project/tools/mac/scripts/notarize.sh
new file mode 100755
index 000000000000..92a51dfb2f91
--- /dev/null
+++ b/jb/project/tools/mac/scripts/notarize.sh
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+#immediately exit script with an error if a command fails
+set -euo pipefail
+[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
+
+APP_PATH=$1
+
+if [[ -z "$APP_PATH" ]]; then
+ echo "Usage: $0 AppPath"
+ exit 1
+fi
+if [[ ! -f "$APP_PATH" ]]; then
+ echo "AppName '$APP_PATH' does not exist or not a file"
+ exit 1
+fi
+
+function log() {
+ echo "$(date '+[%H:%M:%S]') $*"
+}
+
+
+# check required parameters
+: "${APPLE_ISSUER_ID}"
+: "${APPLE_KEY_ID}"
+: "${APPLE_PRIVATE_KEY}"
+
+# shellcheck disable=SC2064
+trap "rm -f \"$PWD/tmp_key\"" INT EXIT RETURN
+echo -n "${APPLE_PRIVATE_KEY}" > tmp_key
+
+log "Notarizing $APP_PATH..."
+xcrun notarytool submit --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" "$APP_PATH" 2>&1 --wait| tee "notarytool.submit.out"
+REQUEST_ID="$(grep -e " id: " "notarytool.submit.out" | grep -oE '([0-9a-f-]{36})'| head -n1)"
+
+waitOutput=$(xcrun notarytool wait "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" --timeout 6h)
+if [ $? -ne 0 ]; then
+ log "Notarizing failed (wait command)"
+ echo "$waitOutput"
+ exit 1
+else
+ echo "$waitOutput"
+fi
+
+logOutout=$(xcrun notarytool log "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}" developer_log.json)
+if [ $? -ne 0 ]; then
+ log "Notarizing failed (log command)"
+ echo "$logOutout"
+ exit 1
+else
+ echo "$logOutout"
+fi
+
+infoOUtput=$(xcrun notarytool info "$REQUEST_ID" --key tmp_key --key-id "${APPLE_KEY_ID}" --issuer "${APPLE_ISSUER_ID}")
+if [ $? -ne 0 ]; then
+ log "Notarizing failed (info command)"
+ echo "$infoOUtput"
+ exit 1
+else
+ echo "$infoOUtput"
+fi
+
+log "Notarizing finished"
diff --git a/jb/project/tools/mac/scripts/productsign.sh b/jb/project/tools/mac/scripts/productsign.sh
new file mode 100755
index 000000000000..790a05081b0b
--- /dev/null
+++ b/jb/project/tools/mac/scripts/productsign.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
+
+source "$SCRIPT_DIR/jetsign-common.sh" || exit 1
+
+function isSigned() {
+ pkgutil --check-signature "$1" >/dev/null 2>&1 && grep -q "signed by a developer certificate" < <(pkgutil --check-signature "$1" 2>&1)
+}
+
+# second last argument is a path to be signed
+pathToBeSigned="$(pwd)/${*:(-2):1}"
+# last argument is a path to signed file
+pathOut="$(pwd)/${*:(-1)}"
+jetSignArgs=("${@:1:$#-2}")
+if [[ ! -f "$pathToBeSigned" ]]; then
+ echo "$pathToBeSigned is missing or not a file"
+ exit 1
+elif isSigned "$pathToBeSigned" && ! isForced "${jetSignArgs[@]}" ; then
+ echo "Already signed: $pathToBeSigned"
+elif [[ "$JETSIGN_CLIENT" == "null" ]]; then
+ echo "JetSign client is missing, cannot proceed with signing"
+ exit 1
+elif [[ "$pathToBeSigned" != *.pkg ]]; then
+ echo "$pathToBeSigned won't be signed, assumed not to be a macOS package"
+else
+ if ! isSigned "$pathToBeSigned" ; then
+ echo "Unsigned macOS package: $pathToBeSigned"
+ fi
+ workDir=$(dirname "$pathToBeSigned")
+ pathSigned="$workDir/signed/${pathToBeSigned##*/}"
+ jetSignExtensions=$(jetSignExtensions "${jetSignArgs[@]}")
+ contentType=$(jetSignContentType "$pathToBeSigned")
+ (
+ cd "$workDir" || exit 1
+ "$JETSIGN_CLIENT" -log-format text -denoted-content-type "$contentType" -extensions "$jetSignExtensions" "$pathToBeSigned"
+ isSigned "$pathSigned"
+ rm -f "$pathOut"
+ mv "$pathSigned" "$pathOut"
+ rm -rf "$workDir/signed"
+ )
+fi
diff --git a/jb/project/tools/mac/scripts/sign.sh b/jb/project/tools/mac/scripts/sign.sh
new file mode 100755
index 000000000000..b17f8592ae1e
--- /dev/null
+++ b/jb/project/tools/mac/scripts/sign.sh
@@ -0,0 +1,199 @@
+#!/bin/bash
+
+#immediately exit script with an error if a command fails
+set -euo pipefail
+[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
+
+if [[ $# -lt 5 ]]; then
+ echo "Usage: $0 AppDirectory AppName BundleId CertificateID InstallerCertificateID"
+ exit 1
+fi
+
+APPLICATION_PATH=$1
+PKG_NAME=$2
+BUNDLE_ID=$3
+JB_DEVELOPER_CERT=$4
+JB_INSTALLER_CERT=$5
+
+SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
+
+# Use JetBrains sign utility if it's available
+if [[ "${JETSIGN_CLIENT:=}" == "null" ]] || [[ "$JETSIGN_CLIENT" == "" ]]; then
+ JB_SIGN=false
+ SIGN_UTILITY="codesign"
+ PRODUCTSIGN_UTILITY="productsign"
+else
+ JB_SIGN=true
+ SIGN_UTILITY="$SCRIPT_DIR/codesign.sh"
+ PRODUCTSIGN_UTILITY="$SCRIPT_DIR/productsign.sh"
+fi
+
+if [[ ! -d "$APPLICATION_PATH" ]]; then
+ echo "AppDirectory '$APPLICATION_PATH' does not exist or not a directory"
+ exit 1
+fi
+
+function log() {
+ echo "$(date '+[%H:%M:%S]') $*"
+}
+
+# Cleanup files left from previous sign attempt (if any)
+find "$APPLICATION_PATH" -name '*.cstemp' -exec rm '{}' \;
+
+log "Signing libraries and executables..."
+# -perm +111 searches for executables
+for f in \
+ "Contents/Home/lib" "Contents/MacOS" \
+ "Contents/Home/Frameworks" \
+ "Contents/Frameworks"; do
+ if [ -d "$APPLICATION_PATH/$f" ]; then
+ find "$APPLICATION_PATH/$f" \
+ -type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "*.node" -o -perm +111 \) \
+ -exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
+ fi
+done
+
+log "Signing jmod files"
+JMODS_DIR="$APPLICATION_PATH/Contents/Home/jmods"
+JMOD_EXE="$APPLICATION_PATH/Contents/Home/bin/jmod"
+if [ -d "$JMODS_DIR" ]; then
+ for jmod_file in "$JMODS_DIR"/*.jmod; do
+ log "Processing $jmod_file"
+
+ TMP_DIR="$JMODS_DIR/tmp"
+ rm -rf "$TMP_DIR"
+ mkdir "$TMP_DIR"
+
+ log "Unzipping $jmod_file"
+ $JMOD_EXE extract --dir "$TMP_DIR" "$jmod_file" >/dev/null
+ log "Removing $jmod_file"
+ rm -f "$jmod_file"
+
+ log "Signing dylibs in $TMP_DIR"
+ find "$TMP_DIR" \
+ -type f \( -name "*.dylib" -o -name "*.so"-o -perm +111 -o -name jarsigner -o -name jnativescan -o -name jdeps -o -name jpackageapplauncher -o -name jspawnhelper -o -name jar -o -name javap -o -name jdeprscan -o -name jfr -o -name rmiregistry -o -name java -o -name jhsdb -o -name jstatd -o -name jstatd -o -name jpackage -o -name keytool -o -name jmod -o -name jlink -o -name jimage -o -name jstack -o -name jcmd -o -name jps -o -name jmap -o -name jstat -o -name jinfo -o -name jshell -o -name jwebserver -o -name javac -o -name serialver -o -name jrunscript -o -name jdb -o -name jconsole -o -name javadoc \) \
+ -exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
+
+ cmd="$JMOD_EXE create --class-path $TMP_DIR/classes"
+
+ # Check each directory and add to the command if it exists
+ [ -d "$TMP_DIR/bin" ] && cmd="$cmd --cmds $TMP_DIR/bin"
+ [ -d "$TMP_DIR/conf" ] && cmd="$cmd --config $TMP_DIR/conf"
+ [ -d "$TMP_DIR/lib" ] && cmd="$cmd --libs $TMP_DIR/lib"
+ [ -d "$TMP_DIR/include" ] && cmd="$cmd --header-files $TMP_DIR/include"
+ [ -d "$TMP_DIR/legal" ] && cmd="$cmd --legal-notices $TMP_DIR/legal"
+ [ -d "$TMP_DIR/man" ] && cmd="$cmd --man-pages $TMP_DIR/man"
+
+ # Add the output file
+ cmd="$cmd $jmod_file"
+
+ # Execute the command
+ eval $cmd
+
+ log "Removing $TMP_DIR"
+ rm -rf "$TMP_DIR"
+ done
+else
+ echo "Directory '$JMODS_DIR' does not exist. Skipping signing of jmod files."
+fi
+
+log "Signing libraries in jars in $APPLICATION_PATH"
+
+# todo: add set -euo pipefail; into the inner sh -c
+# `-e` prevents `grep -q && printf` loginc
+# with `-o pipefail` there's no input for 'while' loop
+find "$APPLICATION_PATH" -name '*.jar' \
+ -exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '\.tbd\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
+ while IFS= read -r -d $'\0' file; do
+ log "Processing libraries in $file"
+
+ rm -rf jarfolder jar.jar
+ mkdir jarfolder
+ filename="${file##*/}"
+ log "Filename: $filename"
+ cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
+
+ find jarfolder \
+ -type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -name "jattach" \) \
+ -exec sh -c '"$1" --timestamp --force -v -s "$2" --options=runtime --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
+
+ (cd jarfolder; zip -q -r -o -0 ../jar.jar .)
+ mv jar.jar "$file"
+ done
+
+rm -rf jarfolder jar.jar
+
+log "Signing other files..."
+# shellcheck disable=SC2043
+for f in \
+ "Contents/Home/bin"; do
+ if [ -d "$APPLICATION_PATH/$f" ]; then
+ find "$APPLICATION_PATH/$f" \
+ -type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "*.tbd" -o -perm +111 \) \
+ -exec sh -c '"$1" --timestamp -v -s "$2" --options=runtime --force --entitlements "$3" "$4" || exit 1' sh "$SIGN_UTILITY" "$JB_DEVELOPER_CERT" "$SCRIPT_DIR/entitlements.xml" {} \;
+ fi
+done
+
+log "Signing whole frameworks..."
+# shellcheck disable=SC2043
+if [ "$JB_SIGN" = true ]; then for f in \
+ "Contents/Frameworks/cef_server.app/Contents/Frameworks" "Contents/Home/Frameworks" "Contents/Frameworks"; do
+ if [ -d "$APPLICATION_PATH/$f" ]; then
+ find "$APPLICATION_PATH/$f" \( -name '*.framework' -o -name '*.app' \) -maxdepth 1 | while read -r line
+ do
+ log "Signing '$line':"
+ tar -pczf tmp-to-sign.tar.gz -C "$(dirname "$line")" "$(basename "$line")"
+ "$SIGN_UTILITY" --timestamp \
+ -v -s "$JB_DEVELOPER_CERT" --options=runtime \
+ --force \
+ --entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz || exit 1
+ rm -rf "$line"
+ tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$line")"
+ rm -f tmp-to-sign.tar.gz
+ done
+ fi
+done; fi
+
+log "Checking framework signatures..."
+for f in \
+ "Contents/Home/Frameworks" "Contents/Frameworks"; do
+ if [ -d "$APPLICATION_PATH/$f" ]; then
+ find "$APPLICATION_PATH/$f" -name '*.framework' -maxdepth 1 | while read -r line
+ do
+ log "Checking '$line':"
+ codesign --verify --deep --strict --verbose=4 "$line"
+ done
+ fi
+done
+
+log "Signing whole app..."
+if [ "$JB_SIGN" = true ]; then
+ tar -pczf tmp-to-sign.tar.gz --exclude='man' -C "$(dirname "$APPLICATION_PATH")" "$(basename "$APPLICATION_PATH")"
+ "$SIGN_UTILITY" --timestamp \
+ -v -s "$JB_DEVELOPER_CERT" --options=runtime \
+ --force \
+ --entitlements "$SCRIPT_DIR/entitlements.xml" tmp-to-sign.tar.gz || exit 1
+ rm -rf "$APPLICATION_PATH"
+ tar -xzf tmp-to-sign.tar.gz --directory "$(dirname "$APPLICATION_PATH")"
+ rm -f tmp-to-sign.tar.gz
+else
+ "$SIGN_UTILITY" --timestamp \
+ -v -s "$JB_DEVELOPER_CERT" --options=runtime \
+ --force \
+ --entitlements "$SCRIPT_DIR/entitlements.xml" "$APPLICATION_PATH" || exit 1
+fi
+
+BUILD_NAME="$(basename "$APPLICATION_PATH")"
+
+log "Creating $PKG_NAME..."
+rm -rf "$PKG_NAME"
+
+mkdir -p unsigned
+pkgbuild --identifier $BUNDLE_ID --root $APPLICATION_PATH \
+ --install-location /Library/Java/JavaVirtualMachines/${BUILD_NAME} unsigned/${PKG_NAME}
+log "Signing $PKG_NAME..."
+"$PRODUCTSIGN_UTILITY" --timestamp --sign "$JB_INSTALLER_CERT" unsigned/${PKG_NAME} ${PKG_NAME}
+
+log "Verifying java is not broken"
+find "$APPLICATION_PATH" \
+ -type f -name 'java' -perm +111 -exec {} -version \;
diff --git a/jb/project/tools/mac/scripts/signapp.sh b/jb/project/tools/mac/scripts/signapp.sh
new file mode 100755
index 000000000000..d0b6e97e71c7
--- /dev/null
+++ b/jb/project/tools/mac/scripts/signapp.sh
@@ -0,0 +1,153 @@
+#!/bin/bash
+
+#immediately exit script with an error if a command fails
+set -euo pipefail
+[[ "${SCRIPT_VERBOSE:-}" == "1" ]] && set -x
+
+export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
+export COPYFILE_DISABLE=true
+
+INPUT_FILE=$1
+EXPLODED=$2.exploded
+USERNAME=$3
+PASSWORD=$4
+CODESIGN_STRING=$5
+JB_INSTALLER_CERT=$6
+NOTARIZE=$7
+BUNDLE_ID=$8
+
+SCRIPT_DIR="$(cd "$(dirname "$0")" >/dev/null && pwd)"
+
+function log() {
+ echo "$(date '+[%H:%M:%S]') $*"
+}
+
+log "Deleting $EXPLODED ..."
+if test -d "$EXPLODED"; then
+ find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
+fi
+rm -rf "$EXPLODED"
+mkdir "$EXPLODED"
+
+log "Unzipping $INPUT_FILE to $EXPLODED ..."
+tar -xzvf "$INPUT_FILE" --directory $EXPLODED
+BUILD_NAME="$(ls "$EXPLODED")"
+#sed -i '' s/BNDL/APPL/ $EXPLODED/$BUILD_NAME/Contents/Info.plist
+rm -f $EXPLODED/$BUILD_NAME/Contents/CodeResources
+rm "$INPUT_FILE"
+
+log "$INPUT_FILE extracted and removed"
+
+APP_NAME=$(basename "$INPUT_FILE" | awk -F".tar" '{ print $1 }')
+PKG_NAME="$APP_NAME.pkg"
+APPLICATION_PATH=$EXPLODED/$(ls $EXPLODED)
+
+find "$APPLICATION_PATH/Contents/Home/bin" \
+ -maxdepth 1 -type f -name '*.jnilib' -print0 |
+ while IFS= read -r -d $'\0' file; do
+ if [ -f "$file" ]; then
+ log "Linking $file"
+ b="$(basename "$file" .jnilib)"
+ ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
+ fi
+ done
+
+find "$APPLICATION_PATH/Contents/" \
+ -maxdepth 1 -type f -name '*.txt' -print0 |
+ while IFS= read -r -d $'\0' file; do
+ if [ -f "$file" ]; then
+ log "Moving $file"
+ mv "$file" "$APPLICATION_PATH/Contents/Resources"
+ fi
+ done
+
+non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
+if [[ $non_plist -gt 0 ]]; then
+ log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
+ log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
+ exit 1
+fi
+
+if [[ "${JETSIGN_CLIENT:=}" == "null" ]] || [[ "$JETSIGN_CLIENT" == "" ]]; then
+ log "Unlocking keychain..."
+ # Make sure *.p12 is imported into local KeyChain
+ security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
+fi
+
+attempt=1
+limit=3
+set +e
+while [[ $attempt -le $limit ]]; do
+ log "Signing (attempt $attempt) $APPLICATION_PATH ..."
+ "$SCRIPT_DIR/sign.sh" "$APPLICATION_PATH" "$PKG_NAME" "$BUNDLE_ID" "$CODESIGN_STRING" "$JB_INSTALLER_CERT"
+ ec=$?
+ if [[ $ec -ne 0 ]]; then
+ ((attempt += 1))
+ if [ $attempt -eq $limit ]; then
+ set -e
+ fi
+ log "Signing failed, wait for 30 sec and try to sign again"
+ sleep 30
+ else
+ log "Signing done"
+ codesign -v "$APPLICATION_PATH" -vvvvv
+ log "Check sign done"
+ spctl -a -v $APPLICATION_PATH
+ ((attempt += limit))
+ fi
+done
+
+set -e
+
+if [ "$NOTARIZE" = "yes" ]; then
+ log "Notarizing..."
+ "$SCRIPT_DIR/notarize.sh" "$PKG_NAME"
+
+ log "Stapling..."
+ appStaplerOutput=$(xcrun stapler staple "$APPLICATION_PATH")
+ if [ $? -ne 0 ]; then
+ log "Stapling application failed"
+ echo "$appStaplerOutput"
+ exit 1
+ else
+ echo "$appStaplerOutput"
+ fi
+
+ log "Stapling package..."
+ pkgStaplerOutput=$(xcrun stapler staple "$PKG_NAME")
+ if [ $? -ne 0 ]; then
+ log "Stapling package failed"
+ echo "$pkgStaplerOutput"
+ exit 1
+ else
+ echo "$pkgStaplerOutput"
+ fi
+
+ # Verify stapling
+ log "Verifying stapling..."
+ if ! stapler validate "$APPLICATION_PATH"; then
+ log "Stapling verification failed for application"
+ exit 1
+ fi
+ if ! stapler validate "$PKG_NAME"; then
+ log "Stapling verification failed for package"
+ exit 1
+ fi
+else
+ log "Notarization disabled"
+ log "Stapling disabled"
+fi
+
+log "Zipping $BUILD_NAME to $INPUT_FILE ..."
+(
+ if [[ "$APPLICATION_PATH" != "$EXPLODED/$BUILD_NAME" ]]; then
+ mv $APPLICATION_PATH $EXPLODED/$BUILD_NAME
+ else
+ echo "No move, source == destination: $APPLICATION_PATH"
+ fi
+
+ tar -pczvf $INPUT_FILE --exclude='man' -C $EXPLODED $BUILD_NAME
+ log "Finished zipping"
+)
+rm -rf "$EXPLODED"
+log "Done"
diff --git a/jb/project/tools/patches/add_jcef_module.patch b/jb/project/tools/patches/add_jcef_module.patch
new file mode 100644
index 000000000000..6a4aed824f6a
--- /dev/null
+++ b/jb/project/tools/patches/add_jcef_module.patch
@@ -0,0 +1,30 @@
+diff --git jb/project/tools/common/modules.list jb/project/tools/common/modules.list
+index 522acb7cb43..c40e689d5de 100644
+--- jb/project/tools/common/modules.list
++++ jb/project/tools/common/modules.list
+@@ -51,4 +51,7 @@ jdk.unsupported.desktop,
+ jdk.xml.dom,
+ jdk.zipfs,
+ jdk.hotspot.agent,
+-jdk.jcmd
++jdk.jcmd,
++jcef,
++gluegen.rt,
++jogl.all
+diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
+index 897647ee368..781d1809493 100644
+--- src/java.desktop/share/classes/module-info.java
++++ src/java.desktop/share/classes/module-info.java
+@@ -116,7 +116,11 @@ module java.desktop {
+ // see make/GensrcModuleInfo.gmk
+ exports sun.awt to
+ jdk.accessibility,
+- jdk.unsupported.desktop;
++ jdk.unsupported.desktop,
++ jcef,
++ jogl.all;
++
++ exports java.awt.peer to jcef;
+
+ exports java.awt.dnd.peer to jdk.unsupported.desktop;
+ exports sun.awt.dnd to jdk.unsupported.desktop;
diff --git a/jb/project/tools/patches/add_jcef_module_aarch64.patch b/jb/project/tools/patches/add_jcef_module_aarch64.patch
new file mode 100644
index 000000000000..2752dc95f3b9
--- /dev/null
+++ b/jb/project/tools/patches/add_jcef_module_aarch64.patch
@@ -0,0 +1,30 @@
+diff --git jb/project/tools/common/modules.list jb/project/tools/common/modules.list
+index 522acb7..c40e689 100644
+--- jb/project/tools/common/modules.list
++++ jb/project/tools/common/modules.list
+@@ -51,4 +51,7 @@ jdk.unsupported.desktop,
+ jdk.xml.dom,
+ jdk.zipfs,
+ jdk.hotspot.agent,
+-jdk.jcmd
++jdk.jcmd,
++jcef,
++gluegen.rt,
++jogl.all
+diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
+index 897647e..781d180 100644
+--- src/java.desktop/share/classes/module-info.java
++++ src/java.desktop/share/classes/module-info.java
+@@ -116,7 +116,11 @@ module java.desktop {
+ // see make/GensrcModuleInfo.gmk
+ exports sun.awt to
+ jdk.accessibility,
+- jdk.unsupported.desktop;
++ jdk.unsupported.desktop,
++ jcef,
++ jogl.all;
++
++ exports java.awt.peer to jcef;
+
+ exports java.awt.dnd.peer to jdk.unsupported.desktop;
+ exports sun.awt.dnd to jdk.unsupported.desktop;
diff --git a/jb/project/tools/perf/j2dbopts_poly250-AA-rand_col.txt b/jb/project/tools/perf/j2dbopts_poly250-AA-rand_col.txt
new file mode 100644
index 000000000000..9e94d063b1ff
--- /dev/null
+++ b/jb/project/tools/perf/j2dbopts_poly250-AA-rand_col.txt
@@ -0,0 +1,267 @@
+prog.verbose=disabled
+prog.printresults=enabled
+global.env.outputwidth=640
+global.env.outputheight=480
+global.env.runcount=5
+global.env.repcount=0
+global.env.testtime=2500
+global.results.workunits=units
+global.results.timeunits=sec
+global.results.ratio=unitspersec
+global.dest.offscreen=disabled
+global.dest.frame.defaultframe=enabled
+global.dest.frame.transframe=disabled
+global.dest.frame.shapedframe=disabled
+global.dest.frame.shapedtransframe=disabled
+global.dest.compatimg.compatimg=disabled
+global.dest.compatimg.opqcompatimg=disabled
+global.dest.compatimg.bmcompatimg=disabled
+global.dest.compatimg.transcompatimg=disabled
+global.dest.volimg.volimg=disabled
+global.dest.volimg.opqvolimg=disabled
+global.dest.volimg.bmvolimg=disabled
+global.dest.volimg.transvolimg=disabled
+global.dest.bufimg.IntXrgb=disabled
+global.dest.bufimg.IntArgb=disabled
+global.dest.bufimg.IntArgbPre=disabled
+global.dest.bufimg.3ByteBgr=disabled
+global.dest.bufimg.ByteIndexed=disabled
+global.dest.bufimg.ByteGray=disabled
+global.dest.bufimg.4ByteAbgr=disabled
+global.dest.bufimg.4ByteAbgrPre=disabled
+global.dest.bufimg.custom=disabled
+graphics.opts.anim=2
+graphics.opts.sizes=250
+graphics.opts.alpharule=SrcOver
+graphics.opts.transform=ident
+graphics.opts.extraalpha=Off
+graphics.opts.xormode=Off
+graphics.opts.clip=Off
+graphics.opts.renderhint=Default
+graphics.render.opts.paint=random
+graphics.render.opts.alphacolor=Off
+graphics.render.opts.antialias=On
+graphics.render.opts.stroke=width1
+graphics.render.tests.drawLine=disabled
+graphics.render.tests.drawLineHoriz=disabled
+graphics.render.tests.drawLineVert=disabled
+graphics.render.tests.fillRect=disabled
+graphics.render.tests.drawRect=disabled
+graphics.render.tests.fillOval=disabled
+graphics.render.tests.drawOval=disabled
+graphics.render.tests.fillPoly=disabled
+graphics.render.tests.drawPoly=enabled
+graphics.render.tests.shape.fillCubic=disabled
+graphics.render.tests.shape.drawCubic=disabled
+graphics.render.tests.shape.fillEllipse2D=disabled
+graphics.render.tests.shape.drawEllipse2D=disabled
+graphics.imaging.src.offscr.opaque=disabled
+graphics.imaging.src.offscr.bitmask=disabled
+graphics.imaging.src.offscr.translucent=disabled
+graphics.imaging.src.opqcompatimg.opaque=disabled
+graphics.imaging.src.opqcompatimg.bitmask=disabled
+graphics.imaging.src.opqcompatimg.translucent=disabled
+graphics.imaging.src.bmcompatimg.opaque=disabled
+graphics.imaging.src.bmcompatimg.bitmask=disabled
+graphics.imaging.src.bmcompatimg.translucent=disabled
+graphics.imaging.src.transcompatimg.opaque=disabled
+graphics.imaging.src.transcompatimg.bitmask=disabled
+graphics.imaging.src.transcompatimg.translucent=disabled
+graphics.imaging.src.opqvolimg.opaque=disabled
+graphics.imaging.src.opqvolimg.bitmask=disabled
+graphics.imaging.src.opqvolimg.translucent=disabled
+graphics.imaging.src.bmvolimg.opaque=disabled
+graphics.imaging.src.bmvolimg.bitmask=disabled
+graphics.imaging.src.bmvolimg.translucent=disabled
+graphics.imaging.src.transvolimg.opaque=disabled
+graphics.imaging.src.transvolimg.bitmask=disabled
+graphics.imaging.src.transvolimg.translucent=disabled
+graphics.imaging.src.bufimg.IntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.IntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgb.opaque=disabled
+graphics.imaging.src.bufimg.IntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.IntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteGray.opaque=disabled
+graphics.imaging.src.bufimg.ByteGray.bitmask=disabled
+graphics.imaging.src.bufimg.ByteGray.translucent=disabled
+graphics.imaging.src.bufimg.3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.3ByteBgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.opaque=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.bitmask=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.translucent=disabled
+graphics.imaging.benchmarks.opts.interpolation=Nearest neighbor
+graphics.imaging.benchmarks.opts.touchsrc=Off
+graphics.imaging.benchmarks.tests.drawimage=disabled
+graphics.imaging.benchmarks.tests.drawimagebg=disabled
+graphics.imaging.benchmarks.tests.drawimagescaleup=disabled
+graphics.imaging.benchmarks.tests.drawimagescaledown=disabled
+graphics.imaging.benchmarks.tests.drawimagescalesplit=disabled
+graphics.imaging.benchmarks.tests.drawimagetxform=disabled
+graphics.imaging.imageops.opts.op=convolve3x3zero
+graphics.imaging.imageops.tests.graphics2d.drawimageop=disabled
+graphics.imaging.imageops.tests.bufimgop.filternull=disabled
+graphics.imaging.imageops.tests.bufimgop.filtercached=disabled
+graphics.imaging.imageops.tests.rasterop.filternull=disabled
+graphics.imaging.imageops.tests.rasterop.filtercached=disabled
+graphics.misc.copytests.copyAreaVert=disabled
+graphics.misc.copytests.copyAreaHoriz=disabled
+graphics.misc.copytests.copyAreaDiag=disabled
+pixel.opts.renderto=Off
+pixel.opts.renderfrom=Off
+pixel.src.1BitBinary=disabled
+pixel.src.2BitBinary=disabled
+pixel.src.4BitBinary=disabled
+pixel.src.ByteIndexed=disabled
+pixel.src.ByteGray=disabled
+pixel.src.Short555=disabled
+pixel.src.Short565=disabled
+pixel.src.ShortGray=disabled
+pixel.src.3ByteBgr=disabled
+pixel.src.4ByteAbgr=disabled
+pixel.src.IntXrgb=disabled
+pixel.src.IntXbgr=disabled
+pixel.src.IntArgb=disabled
+pixel.bimgtests.getrgb=disabled
+pixel.bimgtests.setrgb=disabled
+pixel.rastests.getdataelem=disabled
+pixel.rastests.setdataelem=disabled
+pixel.rastests.getpixel=disabled
+pixel.rastests.setpixel=disabled
+pixel.dbtests.getelem=disabled
+pixel.dbtests.setelem=disabled
+text.opts.data.tlength=16
+text.opts.data.tscript=english
+text.opts.font.fname=serif,physical
+text.opts.font.fstyle=0
+text.opts.font.fsize=13.0
+text.opts.font.ftx=Identity
+text.opts.graphics.textaa=Off
+text.opts.graphics.tfm=Off
+text.opts.graphics.gaa=Off
+text.opts.graphics.gtx=Identity
+text.opts.advopts.gvstyle=0
+text.opts.advopts.tlruns=1
+text.opts.advopts.maptype=FONT
+text.Rendering.tests.drawString=disabled
+text.Rendering.tests.drawChars=disabled
+text.Rendering.tests.drawBytes=disabled
+text.Rendering.tests.drawGlyphVectors=disabled
+text.Rendering.tests.drawTextLayout=disabled
+text.Measuring.tests.stringWidth=disabled
+text.Measuring.tests.stringBounds=disabled
+text.Measuring.tests.charsWidth=disabled
+text.Measuring.tests.charsBounds=disabled
+text.Measuring.tests.fontcandisplay=disabled
+text.Measuring.tests.gvWidth=disabled
+text.Measuring.tests.gvLogicalBounds=disabled
+text.Measuring.tests.gvVisualBounds=disabled
+text.Measuring.tests.gvPixelBounds=disabled
+text.Measuring.tests.gvOutline=disabled
+text.Measuring.tests.gvGlyphLogicalBounds=disabled
+text.Measuring.tests.gvGlyphVisualBounds=disabled
+text.Measuring.tests.gvGlyphPixelBounds=disabled
+text.Measuring.tests.gvGlyphOutline=disabled
+text.Measuring.tests.gvGlyphTransform=disabled
+text.Measuring.tests.gvGlyphMetrics=disabled
+text.Measuring.tests.tlAdvance=disabled
+text.Measuring.tests.tlAscent=disabled
+text.Measuring.tests.tlBounds=disabled
+text.Measuring.tests.tlGetCaretInfo=disabled
+text.Measuring.tests.tlGetNextHit=disabled
+text.Measuring.tests.tlGetCaretShape=disabled
+text.Measuring.tests.tlGetLogicalHighlightShape=disabled
+text.Measuring.tests.tlHitTest=disabled
+text.Measuring.tests.tlOutline=disabled
+text.construction.tests.gvfromfontstring=disabled
+text.construction.tests.gvfromfontchars=disabled
+text.construction.tests.gvfromfontci=disabled
+text.construction.tests.gvfromfontglyphs=disabled
+text.construction.tests.gvfromfontlayout=disabled
+text.construction.tests.tlfromfont=disabled
+text.construction.tests.tlfrommap=disabled
+imageio.opts.size=250
+imageio.opts.content=photo
+imageio.input.opts.general.source.file=disabled
+imageio.input.opts.general.source.url=disabled
+imageio.input.opts.general.source.byteArray=disabled
+imageio.input.opts.imageio.useCache=Off
+imageio.input.image.toolkit.opts.format=
+imageio.input.image.toolkit.tests.createImage=disabled
+imageio.input.image.imageio.opts.format=
+imageio.input.image.imageio.tests.imageioRead=disabled
+imageio.input.image.imageio.reader.opts.seekForwardOnly=On
+imageio.input.image.imageio.reader.opts.ignoreMetadata=On
+imageio.input.image.imageio.reader.opts.installListener=Off
+imageio.input.image.imageio.reader.tests.read=disabled
+imageio.input.image.imageio.reader.tests.getImageMetadata=disabled
+imageio.input.stream.tests.construct=disabled
+imageio.input.stream.tests.read=disabled
+imageio.input.stream.tests.readByteArray=disabled
+imageio.input.stream.tests.readFullyByteArray=disabled
+imageio.input.stream.tests.readBit=disabled
+imageio.input.stream.tests.readByte=disabled
+imageio.input.stream.tests.readUnsignedByte=disabled
+imageio.input.stream.tests.readShort=disabled
+imageio.input.stream.tests.readUnsignedShort=disabled
+imageio.input.stream.tests.readInt=disabled
+imageio.input.stream.tests.readUnsignedInt=disabled
+imageio.input.stream.tests.readFloat=disabled
+imageio.input.stream.tests.readLong=disabled
+imageio.input.stream.tests.readDouble=disabled
+imageio.input.stream.tests.skipBytes=disabled
+imageio.output.opts.general.dest.file=disabled
+imageio.output.opts.general.dest.byteArray=disabled
+imageio.output.opts.imageio.useCache=Off
+imageio.output.image.imageio.opts.format=
+imageio.output.image.imageio.tests.imageioWrite=disabled
+imageio.output.image.imageio.writer.opts.installListener=Off
+imageio.output.image.imageio.writer.tests.write=disabled
+imageio.output.stream.tests.construct=disabled
+imageio.output.stream.tests.write=disabled
+imageio.output.stream.tests.writeByteArray=disabled
+imageio.output.stream.tests.writeBit=disabled
+imageio.output.stream.tests.writeByte=disabled
+imageio.output.stream.tests.writeShort=disabled
+imageio.output.stream.tests.writeInt=disabled
+imageio.output.stream.tests.writeFloat=disabled
+imageio.output.stream.tests.writeLong=disabled
+imageio.output.stream.tests.writeDouble=disabled
+cmm.opts.profiles=1001
+cmm.colorconv.data.fromRGB=disabled
+cmm.colorconv.data.toRGB=disabled
+cmm.colorconv.data.fromCIEXYZ=disabled
+cmm.colorconv.data.toCIEXYZ=disabled
+cmm.colorconv.ccop.ccopOptions.size=250
+cmm.colorconv.ccop.ccopOptions.content=photo
+cmm.colorconv.ccop.ccopOptions.srcType=INT_RGB
+cmm.colorconv.ccop.ccopOptions.dstType=INT_RGB
+cmm.colorconv.ccop.op_img=disabled
+cmm.colorconv.ccop.op_rst=disabled
+cmm.colorconv.ccop.op_draw=disabled
+cmm.colorconv.embed.embedOptions.Images=512x512
+cmm.colorconv.embed.embd_img_read=disabled
+cmm.profiles.getHeader=disabled
+cmm.profiles.getNumComponents=disabled
diff --git a/jb/project/tools/perf/j2dbopts_poly250-rand_col.txt b/jb/project/tools/perf/j2dbopts_poly250-rand_col.txt
new file mode 100644
index 000000000000..bf32c80daf64
--- /dev/null
+++ b/jb/project/tools/perf/j2dbopts_poly250-rand_col.txt
@@ -0,0 +1,267 @@
+prog.verbose=disabled
+prog.printresults=enabled
+global.env.outputwidth=640
+global.env.outputheight=480
+global.env.runcount=5
+global.env.repcount=0
+global.env.testtime=2500
+global.results.workunits=units
+global.results.timeunits=sec
+global.results.ratio=unitspersec
+global.dest.offscreen=disabled
+global.dest.frame.defaultframe=enabled
+global.dest.frame.transframe=disabled
+global.dest.frame.shapedframe=disabled
+global.dest.frame.shapedtransframe=disabled
+global.dest.compatimg.compatimg=disabled
+global.dest.compatimg.opqcompatimg=disabled
+global.dest.compatimg.bmcompatimg=disabled
+global.dest.compatimg.transcompatimg=disabled
+global.dest.volimg.volimg=disabled
+global.dest.volimg.opqvolimg=disabled
+global.dest.volimg.bmvolimg=disabled
+global.dest.volimg.transvolimg=disabled
+global.dest.bufimg.IntXrgb=disabled
+global.dest.bufimg.IntArgb=disabled
+global.dest.bufimg.IntArgbPre=disabled
+global.dest.bufimg.3ByteBgr=disabled
+global.dest.bufimg.ByteIndexed=disabled
+global.dest.bufimg.ByteGray=disabled
+global.dest.bufimg.4ByteAbgr=disabled
+global.dest.bufimg.4ByteAbgrPre=disabled
+global.dest.bufimg.custom=disabled
+graphics.opts.anim=2
+graphics.opts.sizes=250
+graphics.opts.alpharule=SrcOver
+graphics.opts.transform=ident
+graphics.opts.extraalpha=Off
+graphics.opts.xormode=Off
+graphics.opts.clip=Off
+graphics.opts.renderhint=Default
+graphics.render.opts.paint=random
+graphics.render.opts.alphacolor=Off
+graphics.render.opts.antialias=Off
+graphics.render.opts.stroke=width1
+graphics.render.tests.drawLine=disabled
+graphics.render.tests.drawLineHoriz=disabled
+graphics.render.tests.drawLineVert=disabled
+graphics.render.tests.fillRect=disabled
+graphics.render.tests.drawRect=disabled
+graphics.render.tests.fillOval=disabled
+graphics.render.tests.drawOval=disabled
+graphics.render.tests.fillPoly=disabled
+graphics.render.tests.drawPoly=enabled
+graphics.render.tests.shape.fillCubic=disabled
+graphics.render.tests.shape.drawCubic=disabled
+graphics.render.tests.shape.fillEllipse2D=disabled
+graphics.render.tests.shape.drawEllipse2D=disabled
+graphics.imaging.src.offscr.opaque=disabled
+graphics.imaging.src.offscr.bitmask=disabled
+graphics.imaging.src.offscr.translucent=disabled
+graphics.imaging.src.opqcompatimg.opaque=disabled
+graphics.imaging.src.opqcompatimg.bitmask=disabled
+graphics.imaging.src.opqcompatimg.translucent=disabled
+graphics.imaging.src.bmcompatimg.opaque=disabled
+graphics.imaging.src.bmcompatimg.bitmask=disabled
+graphics.imaging.src.bmcompatimg.translucent=disabled
+graphics.imaging.src.transcompatimg.opaque=disabled
+graphics.imaging.src.transcompatimg.bitmask=disabled
+graphics.imaging.src.transcompatimg.translucent=disabled
+graphics.imaging.src.opqvolimg.opaque=disabled
+graphics.imaging.src.opqvolimg.bitmask=disabled
+graphics.imaging.src.opqvolimg.translucent=disabled
+graphics.imaging.src.bmvolimg.opaque=disabled
+graphics.imaging.src.bmvolimg.bitmask=disabled
+graphics.imaging.src.bmvolimg.translucent=disabled
+graphics.imaging.src.transvolimg.opaque=disabled
+graphics.imaging.src.transvolimg.bitmask=disabled
+graphics.imaging.src.transvolimg.translucent=disabled
+graphics.imaging.src.bufimg.IntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.IntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgb.opaque=disabled
+graphics.imaging.src.bufimg.IntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.IntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteGray.opaque=disabled
+graphics.imaging.src.bufimg.ByteGray.bitmask=disabled
+graphics.imaging.src.bufimg.ByteGray.translucent=disabled
+graphics.imaging.src.bufimg.3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.3ByteBgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.opaque=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.bitmask=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.translucent=disabled
+graphics.imaging.benchmarks.opts.interpolation=Nearest neighbor
+graphics.imaging.benchmarks.opts.touchsrc=Off
+graphics.imaging.benchmarks.tests.drawimage=disabled
+graphics.imaging.benchmarks.tests.drawimagebg=disabled
+graphics.imaging.benchmarks.tests.drawimagescaleup=disabled
+graphics.imaging.benchmarks.tests.drawimagescaledown=disabled
+graphics.imaging.benchmarks.tests.drawimagescalesplit=disabled
+graphics.imaging.benchmarks.tests.drawimagetxform=disabled
+graphics.imaging.imageops.opts.op=convolve3x3zero
+graphics.imaging.imageops.tests.graphics2d.drawimageop=disabled
+graphics.imaging.imageops.tests.bufimgop.filternull=disabled
+graphics.imaging.imageops.tests.bufimgop.filtercached=disabled
+graphics.imaging.imageops.tests.rasterop.filternull=disabled
+graphics.imaging.imageops.tests.rasterop.filtercached=disabled
+graphics.misc.copytests.copyAreaVert=disabled
+graphics.misc.copytests.copyAreaHoriz=disabled
+graphics.misc.copytests.copyAreaDiag=disabled
+pixel.opts.renderto=Off
+pixel.opts.renderfrom=Off
+pixel.src.1BitBinary=disabled
+pixel.src.2BitBinary=disabled
+pixel.src.4BitBinary=disabled
+pixel.src.ByteIndexed=disabled
+pixel.src.ByteGray=disabled
+pixel.src.Short555=disabled
+pixel.src.Short565=disabled
+pixel.src.ShortGray=disabled
+pixel.src.3ByteBgr=disabled
+pixel.src.4ByteAbgr=disabled
+pixel.src.IntXrgb=disabled
+pixel.src.IntXbgr=disabled
+pixel.src.IntArgb=disabled
+pixel.bimgtests.getrgb=disabled
+pixel.bimgtests.setrgb=disabled
+pixel.rastests.getdataelem=disabled
+pixel.rastests.setdataelem=disabled
+pixel.rastests.getpixel=disabled
+pixel.rastests.setpixel=disabled
+pixel.dbtests.getelem=disabled
+pixel.dbtests.setelem=disabled
+text.opts.data.tlength=16
+text.opts.data.tscript=english
+text.opts.font.fname=serif,physical
+text.opts.font.fstyle=0
+text.opts.font.fsize=13.0
+text.opts.font.ftx=Identity
+text.opts.graphics.textaa=Off
+text.opts.graphics.tfm=Off
+text.opts.graphics.gaa=Off
+text.opts.graphics.gtx=Identity
+text.opts.advopts.gvstyle=0
+text.opts.advopts.tlruns=1
+text.opts.advopts.maptype=FONT
+text.Rendering.tests.drawString=disabled
+text.Rendering.tests.drawChars=disabled
+text.Rendering.tests.drawBytes=disabled
+text.Rendering.tests.drawGlyphVectors=disabled
+text.Rendering.tests.drawTextLayout=disabled
+text.Measuring.tests.stringWidth=disabled
+text.Measuring.tests.stringBounds=disabled
+text.Measuring.tests.charsWidth=disabled
+text.Measuring.tests.charsBounds=disabled
+text.Measuring.tests.fontcandisplay=disabled
+text.Measuring.tests.gvWidth=disabled
+text.Measuring.tests.gvLogicalBounds=disabled
+text.Measuring.tests.gvVisualBounds=disabled
+text.Measuring.tests.gvPixelBounds=disabled
+text.Measuring.tests.gvOutline=disabled
+text.Measuring.tests.gvGlyphLogicalBounds=disabled
+text.Measuring.tests.gvGlyphVisualBounds=disabled
+text.Measuring.tests.gvGlyphPixelBounds=disabled
+text.Measuring.tests.gvGlyphOutline=disabled
+text.Measuring.tests.gvGlyphTransform=disabled
+text.Measuring.tests.gvGlyphMetrics=disabled
+text.Measuring.tests.tlAdvance=disabled
+text.Measuring.tests.tlAscent=disabled
+text.Measuring.tests.tlBounds=disabled
+text.Measuring.tests.tlGetCaretInfo=disabled
+text.Measuring.tests.tlGetNextHit=disabled
+text.Measuring.tests.tlGetCaretShape=disabled
+text.Measuring.tests.tlGetLogicalHighlightShape=disabled
+text.Measuring.tests.tlHitTest=disabled
+text.Measuring.tests.tlOutline=disabled
+text.construction.tests.gvfromfontstring=disabled
+text.construction.tests.gvfromfontchars=disabled
+text.construction.tests.gvfromfontci=disabled
+text.construction.tests.gvfromfontglyphs=disabled
+text.construction.tests.gvfromfontlayout=disabled
+text.construction.tests.tlfromfont=disabled
+text.construction.tests.tlfrommap=disabled
+imageio.opts.size=250
+imageio.opts.content=photo
+imageio.input.opts.general.source.file=disabled
+imageio.input.opts.general.source.url=disabled
+imageio.input.opts.general.source.byteArray=disabled
+imageio.input.opts.imageio.useCache=Off
+imageio.input.image.toolkit.opts.format=
+imageio.input.image.toolkit.tests.createImage=disabled
+imageio.input.image.imageio.opts.format=
+imageio.input.image.imageio.tests.imageioRead=disabled
+imageio.input.image.imageio.reader.opts.seekForwardOnly=On
+imageio.input.image.imageio.reader.opts.ignoreMetadata=On
+imageio.input.image.imageio.reader.opts.installListener=Off
+imageio.input.image.imageio.reader.tests.read=disabled
+imageio.input.image.imageio.reader.tests.getImageMetadata=disabled
+imageio.input.stream.tests.construct=disabled
+imageio.input.stream.tests.read=disabled
+imageio.input.stream.tests.readByteArray=disabled
+imageio.input.stream.tests.readFullyByteArray=disabled
+imageio.input.stream.tests.readBit=disabled
+imageio.input.stream.tests.readByte=disabled
+imageio.input.stream.tests.readUnsignedByte=disabled
+imageio.input.stream.tests.readShort=disabled
+imageio.input.stream.tests.readUnsignedShort=disabled
+imageio.input.stream.tests.readInt=disabled
+imageio.input.stream.tests.readUnsignedInt=disabled
+imageio.input.stream.tests.readFloat=disabled
+imageio.input.stream.tests.readLong=disabled
+imageio.input.stream.tests.readDouble=disabled
+imageio.input.stream.tests.skipBytes=disabled
+imageio.output.opts.general.dest.file=disabled
+imageio.output.opts.general.dest.byteArray=disabled
+imageio.output.opts.imageio.useCache=Off
+imageio.output.image.imageio.opts.format=
+imageio.output.image.imageio.tests.imageioWrite=disabled
+imageio.output.image.imageio.writer.opts.installListener=Off
+imageio.output.image.imageio.writer.tests.write=disabled
+imageio.output.stream.tests.construct=disabled
+imageio.output.stream.tests.write=disabled
+imageio.output.stream.tests.writeByteArray=disabled
+imageio.output.stream.tests.writeBit=disabled
+imageio.output.stream.tests.writeByte=disabled
+imageio.output.stream.tests.writeShort=disabled
+imageio.output.stream.tests.writeInt=disabled
+imageio.output.stream.tests.writeFloat=disabled
+imageio.output.stream.tests.writeLong=disabled
+imageio.output.stream.tests.writeDouble=disabled
+cmm.opts.profiles=1001
+cmm.colorconv.data.fromRGB=disabled
+cmm.colorconv.data.toRGB=disabled
+cmm.colorconv.data.fromCIEXYZ=disabled
+cmm.colorconv.data.toCIEXYZ=disabled
+cmm.colorconv.ccop.ccopOptions.size=250
+cmm.colorconv.ccop.ccopOptions.content=photo
+cmm.colorconv.ccop.ccopOptions.srcType=INT_RGB
+cmm.colorconv.ccop.ccopOptions.dstType=INT_RGB
+cmm.colorconv.ccop.op_img=disabled
+cmm.colorconv.ccop.op_rst=disabled
+cmm.colorconv.ccop.op_draw=disabled
+cmm.colorconv.embed.embedOptions.Images=512x512
+cmm.colorconv.embed.embd_img_read=disabled
+cmm.profiles.getHeader=disabled
+cmm.profiles.getNumComponents=disabled
diff --git a/jb/project/tools/perf/j2dbopts_poly250.txt b/jb/project/tools/perf/j2dbopts_poly250.txt
new file mode 100644
index 000000000000..6cd894100d75
--- /dev/null
+++ b/jb/project/tools/perf/j2dbopts_poly250.txt
@@ -0,0 +1,267 @@
+prog.verbose=disabled
+prog.printresults=enabled
+global.env.outputwidth=640
+global.env.outputheight=480
+global.env.runcount=5
+global.env.repcount=0
+global.env.testtime=2500
+global.results.workunits=units
+global.results.timeunits=sec
+global.results.ratio=unitspersec
+global.dest.offscreen=disabled
+global.dest.frame.defaultframe=enabled
+global.dest.frame.transframe=disabled
+global.dest.frame.shapedframe=disabled
+global.dest.frame.shapedtransframe=disabled
+global.dest.compatimg.compatimg=disabled
+global.dest.compatimg.opqcompatimg=disabled
+global.dest.compatimg.bmcompatimg=disabled
+global.dest.compatimg.transcompatimg=disabled
+global.dest.volimg.volimg=disabled
+global.dest.volimg.opqvolimg=disabled
+global.dest.volimg.bmvolimg=disabled
+global.dest.volimg.transvolimg=disabled
+global.dest.bufimg.IntXrgb=disabled
+global.dest.bufimg.IntArgb=disabled
+global.dest.bufimg.IntArgbPre=disabled
+global.dest.bufimg.3ByteBgr=disabled
+global.dest.bufimg.ByteIndexed=disabled
+global.dest.bufimg.ByteGray=disabled
+global.dest.bufimg.4ByteAbgr=disabled
+global.dest.bufimg.4ByteAbgrPre=disabled
+global.dest.bufimg.custom=disabled
+graphics.opts.anim=2
+graphics.opts.sizes=250
+graphics.opts.alpharule=SrcOver
+graphics.opts.transform=ident
+graphics.opts.extraalpha=Off
+graphics.opts.xormode=Off
+graphics.opts.clip=Off
+graphics.opts.renderhint=Default
+graphics.render.opts.paint=single
+graphics.render.opts.alphacolor=Off
+graphics.render.opts.antialias=Off
+graphics.render.opts.stroke=width1
+graphics.render.tests.drawLine=disabled
+graphics.render.tests.drawLineHoriz=disabled
+graphics.render.tests.drawLineVert=disabled
+graphics.render.tests.fillRect=disabled
+graphics.render.tests.drawRect=disabled
+graphics.render.tests.fillOval=disabled
+graphics.render.tests.drawOval=disabled
+graphics.render.tests.fillPoly=disabled
+graphics.render.tests.drawPoly=enabled
+graphics.render.tests.shape.fillCubic=disabled
+graphics.render.tests.shape.drawCubic=disabled
+graphics.render.tests.shape.fillEllipse2D=disabled
+graphics.render.tests.shape.drawEllipse2D=disabled
+graphics.imaging.src.offscr.opaque=disabled
+graphics.imaging.src.offscr.bitmask=disabled
+graphics.imaging.src.offscr.translucent=disabled
+graphics.imaging.src.opqcompatimg.opaque=disabled
+graphics.imaging.src.opqcompatimg.bitmask=disabled
+graphics.imaging.src.opqcompatimg.translucent=disabled
+graphics.imaging.src.bmcompatimg.opaque=disabled
+graphics.imaging.src.bmcompatimg.bitmask=disabled
+graphics.imaging.src.bmcompatimg.translucent=disabled
+graphics.imaging.src.transcompatimg.opaque=disabled
+graphics.imaging.src.transcompatimg.bitmask=disabled
+graphics.imaging.src.transcompatimg.translucent=disabled
+graphics.imaging.src.opqvolimg.opaque=disabled
+graphics.imaging.src.opqvolimg.bitmask=disabled
+graphics.imaging.src.opqvolimg.translucent=disabled
+graphics.imaging.src.bmvolimg.opaque=disabled
+graphics.imaging.src.bmvolimg.bitmask=disabled
+graphics.imaging.src.bmvolimg.translucent=disabled
+graphics.imaging.src.transvolimg.opaque=disabled
+graphics.imaging.src.transvolimg.bitmask=disabled
+graphics.imaging.src.transvolimg.translucent=disabled
+graphics.imaging.src.bufimg.IntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.IntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgb.opaque=disabled
+graphics.imaging.src.bufimg.IntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgb.translucent=disabled
+graphics.imaging.src.bufimg.IntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.IntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.IntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteGray.opaque=disabled
+graphics.imaging.src.bufimg.ByteGray.bitmask=disabled
+graphics.imaging.src.bufimg.ByteGray.translucent=disabled
+graphics.imaging.src.bufimg.3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.3ByteBgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgr.translucent=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.opaque=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.bitmask=disabled
+graphics.imaging.src.bufimg.4ByteAbgrPre.translucent=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.opaque=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.bitmask=disabled
+graphics.imaging.src.bufimg.ByteIndexedBm.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntXrgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgb.translucent=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.opaque=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.bitmask=disabled
+graphics.imaging.src.bufimg.unmanagedIntArgbPre.translucent=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.opaque=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.bitmask=disabled
+graphics.imaging.src.bufimg.unmanaged3ByteBgr.translucent=disabled
+graphics.imaging.benchmarks.opts.interpolation=Nearest neighbor
+graphics.imaging.benchmarks.opts.touchsrc=Off
+graphics.imaging.benchmarks.tests.drawimage=disabled
+graphics.imaging.benchmarks.tests.drawimagebg=disabled
+graphics.imaging.benchmarks.tests.drawimagescaleup=disabled
+graphics.imaging.benchmarks.tests.drawimagescaledown=disabled
+graphics.imaging.benchmarks.tests.drawimagescalesplit=disabled
+graphics.imaging.benchmarks.tests.drawimagetxform=disabled
+graphics.imaging.imageops.opts.op=convolve3x3zero
+graphics.imaging.imageops.tests.graphics2d.drawimageop=disabled
+graphics.imaging.imageops.tests.bufimgop.filternull=disabled
+graphics.imaging.imageops.tests.bufimgop.filtercached=disabled
+graphics.imaging.imageops.tests.rasterop.filternull=disabled
+graphics.imaging.imageops.tests.rasterop.filtercached=disabled
+graphics.misc.copytests.copyAreaVert=disabled
+graphics.misc.copytests.copyAreaHoriz=disabled
+graphics.misc.copytests.copyAreaDiag=disabled
+pixel.opts.renderto=Off
+pixel.opts.renderfrom=Off
+pixel.src.1BitBinary=disabled
+pixel.src.2BitBinary=disabled
+pixel.src.4BitBinary=disabled
+pixel.src.ByteIndexed=disabled
+pixel.src.ByteGray=disabled
+pixel.src.Short555=disabled
+pixel.src.Short565=disabled
+pixel.src.ShortGray=disabled
+pixel.src.3ByteBgr=disabled
+pixel.src.4ByteAbgr=disabled
+pixel.src.IntXrgb=disabled
+pixel.src.IntXbgr=disabled
+pixel.src.IntArgb=disabled
+pixel.bimgtests.getrgb=disabled
+pixel.bimgtests.setrgb=disabled
+pixel.rastests.getdataelem=disabled
+pixel.rastests.setdataelem=disabled
+pixel.rastests.getpixel=disabled
+pixel.rastests.setpixel=disabled
+pixel.dbtests.getelem=disabled
+pixel.dbtests.setelem=disabled
+text.opts.data.tlength=16
+text.opts.data.tscript=english
+text.opts.font.fname=serif,physical
+text.opts.font.fstyle=0
+text.opts.font.fsize=13.0
+text.opts.font.ftx=Identity
+text.opts.graphics.textaa=Off
+text.opts.graphics.tfm=Off
+text.opts.graphics.gaa=Off
+text.opts.graphics.gtx=Identity
+text.opts.advopts.gvstyle=0
+text.opts.advopts.tlruns=1
+text.opts.advopts.maptype=FONT
+text.Rendering.tests.drawString=disabled
+text.Rendering.tests.drawChars=disabled
+text.Rendering.tests.drawBytes=disabled
+text.Rendering.tests.drawGlyphVectors=disabled
+text.Rendering.tests.drawTextLayout=disabled
+text.Measuring.tests.stringWidth=disabled
+text.Measuring.tests.stringBounds=disabled
+text.Measuring.tests.charsWidth=disabled
+text.Measuring.tests.charsBounds=disabled
+text.Measuring.tests.fontcandisplay=disabled
+text.Measuring.tests.gvWidth=disabled
+text.Measuring.tests.gvLogicalBounds=disabled
+text.Measuring.tests.gvVisualBounds=disabled
+text.Measuring.tests.gvPixelBounds=disabled
+text.Measuring.tests.gvOutline=disabled
+text.Measuring.tests.gvGlyphLogicalBounds=disabled
+text.Measuring.tests.gvGlyphVisualBounds=disabled
+text.Measuring.tests.gvGlyphPixelBounds=disabled
+text.Measuring.tests.gvGlyphOutline=disabled
+text.Measuring.tests.gvGlyphTransform=disabled
+text.Measuring.tests.gvGlyphMetrics=disabled
+text.Measuring.tests.tlAdvance=disabled
+text.Measuring.tests.tlAscent=disabled
+text.Measuring.tests.tlBounds=disabled
+text.Measuring.tests.tlGetCaretInfo=disabled
+text.Measuring.tests.tlGetNextHit=disabled
+text.Measuring.tests.tlGetCaretShape=disabled
+text.Measuring.tests.tlGetLogicalHighlightShape=disabled
+text.Measuring.tests.tlHitTest=disabled
+text.Measuring.tests.tlOutline=disabled
+text.construction.tests.gvfromfontstring=disabled
+text.construction.tests.gvfromfontchars=disabled
+text.construction.tests.gvfromfontci=disabled
+text.construction.tests.gvfromfontglyphs=disabled
+text.construction.tests.gvfromfontlayout=disabled
+text.construction.tests.tlfromfont=disabled
+text.construction.tests.tlfrommap=disabled
+imageio.opts.size=250
+imageio.opts.content=photo
+imageio.input.opts.general.source.file=disabled
+imageio.input.opts.general.source.url=disabled
+imageio.input.opts.general.source.byteArray=disabled
+imageio.input.opts.imageio.useCache=Off
+imageio.input.image.toolkit.opts.format=
+imageio.input.image.toolkit.tests.createImage=disabled
+imageio.input.image.imageio.opts.format=
+imageio.input.image.imageio.tests.imageioRead=disabled
+imageio.input.image.imageio.reader.opts.seekForwardOnly=On
+imageio.input.image.imageio.reader.opts.ignoreMetadata=On
+imageio.input.image.imageio.reader.opts.installListener=Off
+imageio.input.image.imageio.reader.tests.read=disabled
+imageio.input.image.imageio.reader.tests.getImageMetadata=disabled
+imageio.input.stream.tests.construct=disabled
+imageio.input.stream.tests.read=disabled
+imageio.input.stream.tests.readByteArray=disabled
+imageio.input.stream.tests.readFullyByteArray=disabled
+imageio.input.stream.tests.readBit=disabled
+imageio.input.stream.tests.readByte=disabled
+imageio.input.stream.tests.readUnsignedByte=disabled
+imageio.input.stream.tests.readShort=disabled
+imageio.input.stream.tests.readUnsignedShort=disabled
+imageio.input.stream.tests.readInt=disabled
+imageio.input.stream.tests.readUnsignedInt=disabled
+imageio.input.stream.tests.readFloat=disabled
+imageio.input.stream.tests.readLong=disabled
+imageio.input.stream.tests.readDouble=disabled
+imageio.input.stream.tests.skipBytes=disabled
+imageio.output.opts.general.dest.file=disabled
+imageio.output.opts.general.dest.byteArray=disabled
+imageio.output.opts.imageio.useCache=Off
+imageio.output.image.imageio.opts.format=
+imageio.output.image.imageio.tests.imageioWrite=disabled
+imageio.output.image.imageio.writer.opts.installListener=Off
+imageio.output.image.imageio.writer.tests.write=disabled
+imageio.output.stream.tests.construct=disabled
+imageio.output.stream.tests.write=disabled
+imageio.output.stream.tests.writeByteArray=disabled
+imageio.output.stream.tests.writeBit=disabled
+imageio.output.stream.tests.writeByte=disabled
+imageio.output.stream.tests.writeShort=disabled
+imageio.output.stream.tests.writeInt=disabled
+imageio.output.stream.tests.writeFloat=disabled
+imageio.output.stream.tests.writeLong=disabled
+imageio.output.stream.tests.writeDouble=disabled
+cmm.opts.profiles=1001
+cmm.colorconv.data.fromRGB=disabled
+cmm.colorconv.data.toRGB=disabled
+cmm.colorconv.data.fromCIEXYZ=disabled
+cmm.colorconv.data.toCIEXYZ=disabled
+cmm.colorconv.ccop.ccopOptions.size=250
+cmm.colorconv.ccop.ccopOptions.content=photo
+cmm.colorconv.ccop.ccopOptions.srcType=INT_RGB
+cmm.colorconv.ccop.ccopOptions.dstType=INT_RGB
+cmm.colorconv.ccop.op_img=disabled
+cmm.colorconv.ccop.op_rst=disabled
+cmm.colorconv.ccop.op_draw=disabled
+cmm.colorconv.embed.embedOptions.Images=512x512
+cmm.colorconv.embed.embd_img_read=disabled
+cmm.profiles.getHeader=disabled
+cmm.profiles.getNumComponents=disabled
diff --git a/jb/project/tools/perf/run_dc.sh b/jb/project/tools/perf/run_dc.sh
new file mode 100755
index 000000000000..b2f18c8710eb
--- /dev/null
+++ b/jb/project/tools/perf/run_dc.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+#set -euo pipefail
+set -x
+
+BASE_DIR=$(dirname "$0")
+source $BASE_DIR/run_inc.sh
+
+if [ -z "$DACAPOTEST_DIR" ]; then
+ DACAPOTEST_DIR="./"
+fi
+
+DACAPOTEST=${DACAPOTEST:='dacapo-9.12-bach.jar'}
+if [ -z "$DACAPOTEST" ]; then
+ if [ ! -f "$DACAPOTEST_DIR/$DACAPOTEST" ]; then
+ echo "ERR### cannot find $DACAPOTEST_DIR/$DACAPOTEST"
+ exit 2
+ fi
+fi
+
+
+TRACE=false
+
+if [[ ($# -eq 1 && "$1" == "-help") ]] ; then
+ echo "Usage: run_dc.sh [rendering_options]"
+ echo "$RENDER_OPS_DOC"
+ exit 3
+fi
+
+OPTS=""
+# use time + repeat
+OPTS="$OPTS -no-validation $1"
+
+echo "OPTS: $OPTS"
+
+echo "Unit: Milliseconds (not FPS), lower is better"
+
+for i in `seq $N` ; do
+ if [ $i -eq 1 ]; then
+ echo x
+ fi
+
+ $JAVA \
+ -jar $DACAPOTEST $OPTS 2>&1 | tee dacapo_$1$MODE_$i.log | grep "PASSED" | awk '{print $7 }'
+
+ if [ $i -ne $N ]; then
+ sleep $ST
+ fi
+done | $DATAMASH_CMD | expand -t12 > dacapo_$1.log
diff --git a/jb/project/tools/perf/run_inc.sh b/jb/project/tools/perf/run_inc.sh
new file mode 100644
index 000000000000..8e716b7dbee8
--- /dev/null
+++ b/jb/project/tools/perf/run_inc.sh
@@ -0,0 +1,102 @@
+ST=1 # sleep between iterations
+
+# number of iterations (jvm spawned)
+N=5
+# number of repeats (within jvm)
+R=3
+
+type datamash 2>&1 > /dev/null ; ec=$?
+if [ $ec -ne 0 ] ; then
+ echo "Missing datamash utility"
+ exit 1
+fi
+
+DATAMASH_CMD="datamash --format=%.2f -H count x min x q1 x median x q3 x max x mad x"
+
+J2D_OPTS=""
+OS=""
+case "$OSTYPE" in
+ linux*) echo "Linux"
+ ;;
+ darwin*) echo "OSX"
+ ;;
+ *) echo "unknown: $OSTYPE"
+ exit 1
+ ;;
+esac
+
+read -r -d '' RENDER_OPS_DOC << EOM
+rendering_options:
+ -opengl # OpenGL pipeline (windows, linux, macOS)
+ -metal # Metal pipeline (macOS)
+ -vulkan # Vulkan pipeline (WLToolkit)
+ -tk tk_name # AWT toolkit (linux: WLToolkit|XToolkit)
+ -scale # UI scale
+EOM
+
+while [ $# -ge 1 ] ; do
+ case "$1" in
+ -opengl) J2D_OPTS=$J2D_OPTS" -Dsun.java2d.opengl=true"
+ shift
+ ;;
+ -metal) J2D_OPTS=$J2D_OPTS" -Dsun.java2d.metal=true"
+ shift
+ ;;
+ -vulkan) J2D_OPTS=$J2D_OPTS" -Dsun.java2d.vulkan=true"
+ shift
+ ;;
+ -tk) shift
+ if [ $# -ge 1 ] ; then
+ J2D_OPTS=$J2D_OPTS" -Dawt.toolkit.name="$1
+ shift
+ else
+ echo "Invalid parameters for -tk option. Use: -tk tkname"
+ exit 1
+ fi
+ ;;
+ -scale) shift
+ if [ $# -ge 1 ] ; then
+ J2D_OPTS=$J2D_OPTS" -Dsun.java2d.uiScale="$1
+ shift
+ else
+ echo "Invalid parameters for -scale option. Use: -scale scale"
+ exit 1
+ fi
+ ;;
+ -dSync) shift
+ if [ $# -ge 1 ] ; then
+ J2D_OPTS=$J2D_OPTS" -Dsun.java2d.metal.displaySync="$1
+ shift
+ else
+ echo "Invalid parameters for -dSync option. Use: -dSync [true|false]"
+ exit 1
+ fi
+ ;;
+ -jdk) shift
+ if [ $# -ge 1 ] ; then
+ JAVA=$1/bin/java
+ shift
+ else
+ echo "Invalid parameters for -jdk option"
+ exit 1
+ fi
+ ;;
+ *) break
+ ;;
+ esac
+done
+if [ -z "$JAVA" ] ; then
+ BUILD_DIR=`find $BASE_DIR/../../../../build -name '*-release' -type d | head -n 1`
+ JAVA=`find $BUILD_DIR/images/jdk -name java -type f | head -n 1`
+fi
+
+JAVA_HOME=`dirname $JAVA`/../
+"$JAVA" -version
+
+LANG=C
+
+WS_ROOT=$BASE_DIR/../../../..
+
+echo "N: $N"
+echo "R: $R"
+echo "J2D_OPTS: $J2D_OPTS"
diff --git a/jb/project/tools/perf/run_j2b.sh b/jb/project/tools/perf/run_j2b.sh
new file mode 100755
index 000000000000..b20d53921053
--- /dev/null
+++ b/jb/project/tools/perf/run_j2b.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+BASE_DIR=$(dirname "$0")
+source $BASE_DIR/run_inc.sh
+
+J2DBENCH_DIR=$WS_ROOT/src/demo/share/java2d/J2DBench
+
+if [ -z "$J2DBENCH" ]; then
+ if [ ! -f "$J2DBENCH_DIR/dist/J2DBench.jar" ]; then
+ PATH=$JAVA_HOME/bin:$PATH make -C $J2DBENCH_DIR
+ fi
+ if [ ! -f "$J2DBENCH_DIR/dist/J2DBench.jar" ]; then
+ echo "Cannot build J2DBench. You may use J2DBench env variable instead pointing to the J2DBench.jar."
+ exit 1
+ fi
+ J2DBENCH=$J2DBENCH_DIR/dist/J2DBench.jar
+fi
+
+if [ $# -ne 1 ] ; then
+ echo "Usage: run_j2b.sh [rendering_options] bench_name"
+ echo
+ echo "bench_name: poly250 poly250-rand_col poly250-AA-rand_col"
+ echo ""
+ echo "$RENDER_OPS_DOC"
+ exit 2
+fi
+
+if [ ! -f "$BASE_DIR/j2dbopts_$1.txt" ]; then
+ echo "Unknown test: $1"
+ exit 1
+fi
+
+
+
+OPTS="j2dbopts_$1.txt"
+#OPTS=j2dbopts_poly250.txt
+#OPTS=j2dbopts_poly250-rand_col.txt
+#OPTS=j2dbopts_poly250-AA-rand_col.txt
+
+echo "OPTS: $OPTS"
+
+for i in `seq $N`; do
+ if [ $i -eq 1 ]; then
+ echo x
+ fi
+ echo `$JAVA $J2D_OPTS -jar $J2DBENCH \
+ -batch -loadopts $BASE_DIR/$OPTS -saveres pl.res \
+ -title pl -desc pl | awk '/averaged/{print $3}' | head -n1`
+
+ if [ $i -ne $N ]; then
+ sleep $ST
+ fi
+done | $DATAMASH_CMD | expand -t12
diff --git a/jb/project/tools/perf/run_rp.sh b/jb/project/tools/perf/run_rp.sh
new file mode 100755
index 000000000000..1acbfb02eb3e
--- /dev/null
+++ b/jb/project/tools/perf/run_rp.sh
@@ -0,0 +1,90 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+BASE_DIR=$(dirname "$0")
+source $BASE_DIR/run_inc.sh
+
+RENDERPERFTEST_DIR=$WS_ROOT/test/jdk/performance/client/RenderPerfTest
+RENDERPERFTEST=""
+if [ -z "$RENDERPERFTEST" ]; then
+ if [ ! -f "$RENDERPERFTEST_DIR/dist/RenderPerfTest.jar" ]; then
+ PATH=$JAVA_HOME/bin:$PATH make -C $RENDERPERFTEST_DIR
+ fi
+ if [ ! -f "$RENDERPERFTEST_DIR/dist/RenderPerfTest.jar" ]; then
+ echo "Cannot build RenderPerfTest. You may use RENDERPERFTEST env variable instead pointing to the RenderPerfTest.jar."
+ exit 1
+ fi
+ RENDERPERFTEST=$RENDERPERFTEST_DIR/dist/RenderPerfTest.jar
+fi
+
+
+TRACE=false
+
+# removes leading hyphen
+mode_param="${1/-}"
+
+while [ $# -ge 1 ] ; do
+ case "$1" in
+ -onscreen) MODE="Robot"
+ shift
+ ;;
+ -volatile) MODE="Volatile"
+ shift
+ ;;
+ -buffer) MODE="Buffer"
+ shift
+ ;;
+ *) break
+ ;;
+ esac
+done
+
+if [[ ($# -eq 1 && "$1" == "-help") || ($# -eq 0) ]] ; then
+ echo "Usage: run_rp.sh [rp_rendering_mode] [rendering_options] bench_name"
+ echo
+ echo "bench_name: ArgbSurfaceBlitImage ArgbSwBlitImage BgrSurfaceBlitImage BgrSwBlitImage"
+ echo " Image ImageAA Image_XOR VolImage VolImageAA"
+ echo " ClipFlatBox ClipFlatBoxAA ClipFlatOval ClipFlatOvalAA"
+ echo " FlatBox FlatBoxAA FlatOval FlatOvalAA FlatOval_XOR FlatQuad FlatQuadAA"
+ echo " RotatedBox RotatedBoxAA RotatedBox_XOR RotatedOval RotatedOvalAA"
+ echo " WiredBox WiredBoxAA WiredBubbles WiredBubblesAA WiredQuad WiredQuadAA"
+ echo " Lines LinesAA Lines_XOR"
+ echo " TextGray TextLCD TextLCD_XOR TextNoAA TextNoAA_XOR"
+ echo " LargeTextGray LargeTextLCD LargeTextNoAA WhiteTextGray WhiteTextLCD WhiteTextNoAA"
+ echo " LinGrad3RotatedOval LinGrad3RotatedOvalAA LinGradRotatedOval LinGradRotatedOvalAA"
+ echo " RadGrad3RotatedOval RadGrad3RotatedOvalAA"
+ echo ""
+ echo "rp_rendering_mode: "
+ echo " -onscreen : rendering to the window and check it using Robot"
+ echo " -volatile : rendering to volatile image (default)"
+ echo " -buffer : rendering to buffered image"
+ echo "$RENDER_OPS_DOC"
+ exit 2
+fi
+
+OPTS=""
+# use time + repeat
+OPTS="$OPTS -r=$R -t -e$MODE $1"
+
+echo "OPTS: $OPTS"
+
+echo "Unit: Milliseconds (not FPS), lower is better"
+
+for i in `seq $N` ; do
+ if [ $i -eq 1 ]; then
+ echo x
+ fi
+
+# echo "[debug] " + "test run"
+# $JAVA $J2D_OPTS -DTRACE=$TRACE \
+# -jar $RENDERPERFTEST $OPTS 2>&1 | awk '/'$1'/{print $3 }' | tee test_run.log
+
+ $JAVA $J2D_OPTS -DTRACE=$TRACE \
+ -jar $RENDERPERFTEST $OPTS -v 2>&1 | tee render_$1_${mode_param}_$i.log | grep -v "^#" | tail -n 2 | \
+ awk '{print $3 }'
+ if [ $i -ne $N ]; then
+ sleep $ST
+ fi
+done | $DATAMASH_CMD | expand -t12 > render_$1_${mode_param}.log
diff --git a/jb/project/tools/perf/run_sm.sh b/jb/project/tools/perf/run_sm.sh
new file mode 100755
index 000000000000..1d758dacd28e
--- /dev/null
+++ b/jb/project/tools/perf/run_sm.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+BASE_DIR=$(dirname "$0")
+source $BASE_DIR/run_inc.sh
+
+SWINGMARK_DIR=$WS_ROOT/test/jdk/performance/client/SwingMark
+
+if [ -z "$SWINGMARK" ]; then
+ if [ ! -f "$SWINGMARK_DIR/dist/SwingMark.jar" ]; then
+ PATH=$JAVA_HOME/bin:$PATH make -C $SWINGMARK_DIR
+ fi
+ if [ ! -f "$SWINGMARK_DIR/dist/SwingMark.jar" ]; then
+ echo "Cannot build SwingMark. You may use SWINGMARK env variable instead pointing to the SwingMark.jar."
+ exit 1
+ fi
+ SWINGMARK=$SWINGMARK_DIR/dist/SwingMark.jar
+fi
+
+if [ $# -eq 1 -a "$1" == "--help" ] ; then
+ shift
+ echo "Usage: run_sm [rendering_options]"
+ echo ""
+ echo "$RENDER_OPS_DOC"
+ exit 0
+fi
+
+for i in `seq $N` ; do
+ if [ $i -eq 1 ]; then
+ echo x
+ fi
+
+ # SwingMark gives 1 global 'Score: '
+ echo `$JAVA $J2D_OPTS -jar $BASE_DIR/../../../../test/jdk/performance/client/SwingMark/dist/SwingMark.jar \
+ -r $R -q -lf javax.swing.plaf.metal.MetalLookAndFeel | awk '/Score/{print $2}'`
+
+ if [ $i -ne $N ]; then
+ sleep $ST
+ fi
+done | $DATAMASH_CMD | expand -t12
diff --git a/jb/project/tools/test/check_jbr_size.sh b/jb/project/tools/test/check_jbr_size.sh
new file mode 100644
index 000000000000..3a9ef2f5a7ad
--- /dev/null
+++ b/jb/project/tools/test/check_jbr_size.sh
@@ -0,0 +1,162 @@
+#!/bin/bash
+
+set -euo pipefail
+
+TC_PRINT=0
+# Always print TeamCity service messages if running under TeamCity
+[[ -n "${TEAMCITY_VERSION:-}" ]] && TC_PRINT=1
+
+while getopts ":t" o; do
+ case "${o}" in
+ t) TC_PRINT=1 ;;
+ *);;
+ esac
+done
+shift $((OPTIND-1))
+
+NEWFILEPATH="$1"
+CONFIGID="$2"
+BUILDID="$3"
+TOKEN="$4"
+
+if [ ! -f "$NEWFILEPATH" ]; then
+ echo "File not found: $NEWFILEPATH"
+ exit 1
+fi
+#
+# Get the size of new artifact
+#
+
+unameOut="$(uname -s)"
+case "${unameOut}" in
+ Linux*)
+ NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
+ ;;
+ Darwin*)
+ NEWFILESIZE=$(stat -f%z "$NEWFILEPATH")
+ ;;
+ CYGWIN*)
+ NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
+ ;;
+ MINGW*)
+ NEWFILESIZE=$(stat -c%s "$NEWFILEPATH")
+ ;;
+ *)
+ echo "Unknown machine: ${unameOut}"
+ exit 1
+esac
+FILENAME=$(basename "${NEWFILEPATH}")
+
+#
+# Get pattern of artifact name
+# Base filename pattern: ----b.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
+# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
+# OS_ARCH_PATTERN - : osx-x64, linux-aarch64, linux-musl-x64, windows-x64 etc.
+
+BUNDLE_TYPE=jbrsdk
+OS_ARCH_PATTERN=""
+FILE_EXTENSION=tar.gz
+
+re='(jbr[a-z_]*).*-[0-9_\.]+-(.+)-b[0-9]+(.+)'
+if [[ $FILENAME =~ $re ]]; then
+ BUNDLE_TYPE=${BASH_REMATCH[1]}
+ OS_ARCH_PATTERN=${BASH_REMATCH[2]}
+ FILE_EXTENSION=${BASH_REMATCH[3]}
+else
+ echo "File name $FILENAME does not match regex $re"
+ exit 1
+fi
+
+function test_started_msg() {
+ if [ $TC_PRINT -eq 1 ]; then
+ echo "##teamcity[testStarted name='$1']"
+ fi
+}
+
+function test_failed_msg() {
+ if [ $TC_PRINT -eq 1 ]; then
+ echo "##teamcity[testFailed name='$1' message='$2']"
+ fi
+}
+
+function test_finished_msg() {
+ if [ $TC_PRINT -eq 1 ]; then
+ echo "##teamcity[testFinished name='$1']"
+ fi
+}
+
+test_name="${BUNDLE_TYPE}_${OS_ARCH_PATTERN//\-/_}${FILE_EXTENSION//\./_}"
+test_started_msg "$test_name"
+
+echo "BUNDLE_TYPE: $BUNDLE_TYPE"
+echo "OS_ARCH_PATTERN: $OS_ARCH_PATTERN"
+echo "FILE_EXTENSION: $FILE_EXTENSION"
+echo "Size of $FILENAME is $NEWFILESIZE bytes"
+
+#
+# Get previous successful build ID
+# Example:
+# CONFIGID=IntellijCustomJdk_Jdk17_Master_LinuxX64jcef
+# BUILDID=12345678
+#
+# expected return value
+# id="123".number="567"
+#
+CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
+re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
+
+# ID: Previous successful build id
+ID=0
+if [[ $CURL_RESPONSE =~ $re ]]; then
+ ID=${BASH_REMATCH[1]}
+ echo "Previous build ID: $ID"
+ echo "Previous build number: ${BASH_REMATCH[2]}"
+else
+ msg="ERROR: cannot find previous build"
+ echo "$msg"
+ echo "$CURL_RESPONSE"
+ test_failed_msg "$test_name" "$msg"
+ test_finished_msg "$test_name"
+ exit 1
+fi
+
+#
+# Get artifacts from previous successful build
+#
+# expected return value
+# name="jbrsdk_jcef*.tar.gz size="123'
+#
+CURL_RESPONSE=$(curl -sSL --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
+echo "Artifacts of the previous build:"
+echo "$CURL_RESPONSE"
+
+# Find binary size (in response) with reg exp
+re="name=\"(${BUNDLE_TYPE}[^\"]+${OS_ARCH_PATTERN}[^\"]+${FILE_EXTENSION})\" size=\"([0-9]+)\""
+
+if [[ $CURL_RESPONSE =~ $re ]]; then
+ prevFileName=${BASH_REMATCH[1]}
+ echo "Previous artifact name: $prevFileName"
+ prevFileSize=${BASH_REMATCH[2]}
+ echo "Previous artifact size: $prevFileSize"
+
+ ((allowedSize=prevFileSize+prevFileSize/20)) # use 5% threshold
+ echo "Allowed size: $allowedSize"
+ if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
+ msg="ERROR: new size is significantly greater than previous size (need to investigate)"
+ echo "$msg"
+ test_failed_msg "$test_name" "$msg"
+ test_finished_msg "$test_name"
+ exit 1
+ else
+ echo "PASSED"
+ test_finished_msg "$test_name"
+ fi
+else
+ msg="ERROR: cannot find string with size in xml response:"
+ echo "Regex: $re"
+ echo "$msg"
+ echo "$CURL_RESPONSE"
+ test_failed_msg "$test_name" "$msg"
+ test_finished_msg "$test_name"
+ exit 1
+fi
diff --git a/jb/project/tools/test/perfcmp.sh b/jb/project/tools/test/perfcmp.sh
new file mode 100755
index 000000000000..f8c0970c6b3e
--- /dev/null
+++ b/jb/project/tools/test/perfcmp.sh
@@ -0,0 +1,93 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+usage ()
+{
+echo "Usage: perfcmp.sh [options] "
+echo "Options:"
+echo -e " -h, --help\tdisplay this help"
+echo -e " -tc\tprint teacmity statistic"
+echo -e "test_results_cur - the file with metrics values for the current measuring"
+echo -e "test_results_ref - the file with metrics values for the reference measuring"
+echo -e "results - results of comaprison"
+echo -e "test_prefix - specifys measuring type, makes sense for enabled -tc, by default no prefixes"
+echo -e "noHeaders - by default 1-st line contains headers"
+echo -e ""
+echo -e "test_results_* files content should be in csv format with header and tab separator:"
+echo -e "The 1-st column is the test name"
+echo -e "The 2-st column is the test value"
+echo -e ""
+echo -e "Example:"
+echo -e "Test Value"
+echo -e "Testname 51.54"
+}
+
+while [ -n "$1" ]
+do
+case "$1" in
+-h | --help) usage
+exit 1 ;;
+-tc) tc=1
+ shift
+ break ;;
+*) break;;
+esac
+done
+
+if [[ "$#" < "3" ]]; then
+ echo "Error: Invalid arguments"
+ usage
+ exit 1
+fi
+
+curFile=$1
+refFile=$2
+resFile=$3
+testNamePrefix=$4
+noHeaders=$5
+echo $curFile
+echo $refFile
+echo $resFile
+
+curValues=`cat "$curFile" | cut -f 2 | tr -d '\t'`
+if [ -z $noHeaders ]; then
+ curValuesHeader=`echo "$curValues" | head -n +1`_cur
+ header=`cat "$refFile" | head -n +1 | awk -F'\t' -v x=$curValuesHeader '{print " "$1"\t"$2"_ref\t"x"\tratio"}'`
+ testContent=`paste -d '\t' $refFile <(echo "$curValues") | tail -n +2`
+else
+ testContent=`paste -d '\t' $refFile <(echo "$curValues") | tail -n +1`
+fi
+
+testContent=`echo "$testContent" | tr "," "." | awk -F'\t' '{
+ if ($3>$2+$2*0.1) {
+ print "* "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
+ } else {
+ print " "$1"\t"$2"\t"$3"\t"(($2>0)?$3/$2:"-")
+ }
+}'`
+if [ -z $noHeaders ]; then
+ echo "$header" > $resFile
+fi
+echo "$testContent" >> $resFile
+cat "$resFile" | tr '\t' ';' | column -t -s ';' | tee $resFile
+
+if [ -z $tc ]; then
+exit 0
+fi
+
+failed=0
+echo "$testContent" 2>&1 | (
+ while read -r s; do
+ testname=`echo "$s" | cut -f 1 | tr -d "[:space:]" | tr -d "*"`
+ duration=`echo "$s" | cut -f 3`
+ echo "$s" | cut -c1 | grep -c "*" && failed=1
+ echo \#\#teamcity[testStarted name=\'$testNamePrefix$testname\']
+ echo "===>$s"
+ echo \#\#teamcity[buildStatisticValue key=\'$testNamePrefix$testname\' value=\'$duration\']
+ [ $failed -eq 1 ] && echo \#\#teamcity[testFailed name=\'$testNamePrefix$testname\' message=\'$s\']
+ echo \#\#teamcity[testFinished name=\'$testNamePrefix$testname\' duration=\'$duration\']
+ failed=0
+ done
+)
\ No newline at end of file
diff --git a/jb/project/tools/windows/scripts/mkimages_aarch64.sh b/jb/project/tools/windows/scripts/mkimages_aarch64.sh
new file mode 100644
index 000000000000..580f9d20dc66
--- /dev/null
+++ b/jb/project/tools/windows/scripts/mkimages_aarch64.sh
@@ -0,0 +1,153 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script makes test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+# Environment variables:
+# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
+# to configure
+# By default JDK_BUILD_NUMBER is set zero
+# JCEF_PATH - specifies the path to the directory with JCEF binaries.
+# By default JCEF binaries should be located in ./jcef_win_aarch64
+
+if [ -z "$BUILD_JDK" ]; then
+ echo "BUILD_JDK environment variable must be specified and point to a JDK built from the current sources" \
+ " and is able to run on the build system. See OpenJDK documentation for --with-build-jdk for more info."
+ exit 1
+fi
+
+source jb/project/tools/common/scripts/common.sh
+
+WORK_DIR=$(pwd)
+JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_aarch64}
+NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
+
+function do_configure {
+ sh ./configure \
+ --enable-option-checking=fatal \
+ --openjdk-target=aarch64-unknown-cygwin \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build=$JDK_BUILD_NUMBER \
+ --with-version-opt=b${build_number} \
+ --with-toolchain-version=$TOOLCHAIN_VERSION \
+ --with-boot-jdk=$BOOT_JDK \
+ --with-build-jdk=$BUILD_JDK \
+ --with-nvdacontrollerclient=$NVDA_PATH \
+ --disable-ccache \
+ --enable-cds=yes \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ || do_exit $?
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ fastdebug_infix=''
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
+
+ echo Running jlink ...
+ ${BUILD_JDK}/bin/jlink \
+ --module-path $__modules_path --no-man-pages --compress=2 \
+ --add-modules $__modules --output $__root_dir || do_exit $?
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' $__root_dir/release > release
+ mv release $__root_dir/release
+ cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
+ for dir in $(ls -d $IMAGES_DIR/jdk/*); do
+ rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
+ done
+ copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
+ fi
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=windows-aarch64-server-release
+
+case "$bundle_type" in
+ "jcef")
+ do_reset_changes=0
+ do_maketest=1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "fd")
+ do_reset_changes=0
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=windows-aarch64-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
+ fi
+else
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME images || do_exit $?
+ fi
+fi
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+where cygpath
+if [ $? -eq 0 ]; then
+ JCEF_PATH="$(cygpath -w $JCEF_PATH | sed 's/\\/\//g')"
+fi
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
+ if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module_aarch64.patch || do_exit $?
+ update_jsdk_mods "$BUILD_JDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
+ cp $JCEF_PATH/jmods/* $JSDK_MODS_DIR # $JSDK/jmods is not unchanged
+ cat $JCEF_PATH/jcef.version >> $JSDK/release
+ fi
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+# create runtime image bundle
+modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
+modules+=",jdk.crypto.mscapi"
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+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 $?
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
+
+do_exit 0
diff --git a/jb/project/tools/windows/scripts/mkimages_x64.sh b/jb/project/tools/windows/scripts/mkimages_x64.sh
new file mode 100755
index 000000000000..15eb07929d81
--- /dev/null
+++ b/jb/project/tools/windows/scripts/mkimages_x64.sh
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script makes test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+# Environment variables:
+# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument
+# to configure
+# By default JDK_BUILD_NUMBER is set zero
+# JCEF_PATH - specifies the path to the directory with JCEF binaries.
+# By default JCEF binaries should be located in ./jcef_win_x64
+
+source jb/project/tools/common/scripts/common.sh
+
+WORK_DIR=$(pwd)
+JCEF_PATH=${JCEF_PATH:=$WORK_DIR/jcef_win_x64}
+NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
+
+function do_configure {
+ sh ./configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build=$JDK_BUILD_NUMBER \
+ --with-version-opt=b${build_number} \
+ --with-toolchain-version=$TOOLCHAIN_VERSION \
+ --with-boot-jdk=$BOOT_JDK \
+ --with-nvdacontrollerclient=$NVDA_PATH \
+ --disable-ccache \
+ --enable-cds=yes \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ || do_exit $?
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ fastdebug_infix=''
+ __cds_opt=''
+ __cds_opt="--generate-cds-archive"
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
+
+ echo Running jlink ...
+ ${JSDK}/bin/jlink \
+ --module-path $__modules_path --no-man-pages --compress=2 \
+ $__cds_opt --add-modules $__modules --output $__root_dir || do_exit $?
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' $__root_dir/release > release
+ mv release $__root_dir/release
+ cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
+ for dir in $(ls -d $IMAGES_DIR/jdk/*); do
+ rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
+ done
+ copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
+ fi
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=windows-x86_64-server-release
+
+case "$bundle_type" in
+ "jcef")
+ do_reset_changes=0
+ do_maketest=1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "fd")
+ do_reset_changes=0
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=windows-x86_64-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
+ fi
+else
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME images || do_exit $?
+ fi
+fi
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+where cygpath
+if [ $? -eq 0 ]; then
+ JCEF_PATH="$(cygpath -w $JCEF_PATH | sed 's/\\/\//g')"
+fi
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
+ if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
+ update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
+ cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
+ cat $JCEF_PATH/jcef.version >> $JSDK/release
+ fi
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+# create runtime image bundle
+modules=$(xargs < jb/project/tools/common/modules.list | sed s/" "//g) || do_exit $?
+modules+=",jdk.crypto.mscapi"
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g)
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
+
+do_exit 0
diff --git a/jb/project/tools/windows/scripts/mkimages_x86.sh b/jb/project/tools/windows/scripts/mkimages_x86.sh
new file mode 100755
index 000000000000..bf877c97a0bd
--- /dev/null
+++ b/jb/project/tools/windows/scripts/mkimages_x86.sh
@@ -0,0 +1,136 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# $ ./java --version
+# openjdk 11.0.6 2020-01-14
+# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
+# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
+#
+
+source jb/project/tools/common/scripts/common.sh
+
+WORK_DIR=$(pwd)
+NVDA_PATH=${NVDA_PATH:=$WORK_DIR/nvda_controllerClient}
+
+
+function do_configure {
+ sh ./configure \
+ $WITH_DEBUG_LEVEL \
+ --with-vendor-name="$VENDOR_NAME" \
+ --with-vendor-version-string="$VENDOR_VERSION_STRING" \
+ --with-jvm-features=shenandoahgc \
+ --with-version-pre= \
+ --with-version-build=$JDK_BUILD_NUMBER \
+ --with-version-opt=b${build_number} \
+ --with-toolchain-version=$TOOLCHAIN_VERSION \
+ --with-boot-jdk=$BOOT_JDK \
+ --with-nvdacontrollerclient=$NVDA_PATH \
+ --disable-ccache \
+ --enable-cds=yes \
+ $DISABLE_WARNINGS_AS_ERRORS \
+ $STATIC_CONF_ARGS \
+ $REPRODUCIBLE_BUILD_OPTS \
+ || do_exit $?
+}
+
+function create_image_bundle {
+ __bundle_name=$1
+ __arch_name=$2
+ __modules_path=$3
+ __modules=$4
+
+ fastdebug_infix=''
+ __cds_opt=''
+ __cds_opt="--generate-cds-archive"
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
+
+ echo Running jlink ...
+ ${JSDK}/bin/jlink \
+ --module-path $__modules_path --no-man-pages --compress=2 \
+ $__cds_opt --add-modules $__modules --output $__root_dir || do_exit $?
+
+ grep -v "^JAVA_VERSION" "$JSDK"/release | grep -v "^MODULES" >> $__root_dir/release
+ if [ "$__arch_name" == "$JBRSDK_BUNDLE" ]; then
+ sed 's/JBR/JBRSDK/g' $__root_dir/release > release
+ mv release $__root_dir/release
+ cp $IMAGES_DIR/jdk/lib/src.zip $__root_dir/lib
+ for dir in $(ls -d $IMAGES_DIR/jdk/*); do
+ rsync -amv --include="*/" --include="*.pdb" --exclude="*" $dir $__root_dir
+ done
+ copy_jmods "$__modules" "$__modules_path" "$__root_dir"/jmods
+ fi
+}
+
+WITH_DEBUG_LEVEL="--with-debug-level=release"
+RELEASE_NAME=windows-x86_64-server-release
+
+case "$bundle_type" in
+ "jcef")
+ echo "not implemented" && do_exit 1
+ ;;
+ "nomod" | "")
+ bundle_type=""
+ ;;
+ "fd")
+ do_reset_changes=0
+ WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
+ RELEASE_NAME=windows-x86_64-server-fastdebug
+ ;;
+esac
+
+if [ -z "${INC_BUILD:-}" ]; then
+ do_configure || do_exit $?
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME clean images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME clean images || do_exit $?
+ fi
+else
+ if [ $do_maketest -eq 1 ]; then
+ make LOG=info CONF=$RELEASE_NAME images test-image JBR_API_JBR_VERSION=TEST || do_exit $?
+ else
+ make LOG=info CONF=$RELEASE_NAME images || do_exit $?
+ fi
+fi
+
+IMAGES_DIR=build/$RELEASE_NAME/images
+JSDK=$IMAGES_DIR/jdk
+JSDK_MODS_DIR=$IMAGES_DIR/jmods
+JBRSDK_BUNDLE=jbrsdk
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ]; then
+ if [ "$bundle_type" == "jcef" ]; then
+ git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
+ update_jsdk_mods "$JSDK" "$JCEF_PATH"/jmods "$JSDK"/jmods "$JSDK_MODS_DIR" || do_exit $?
+ cp $JCEF_PATH/jmods/* ${JSDK_MODS_DIR} # $JSDK/jmods is not unchanged
+ fi
+
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+# create runtime image bundle
+modules=$(grep -v "jdk.internal.vm" jb/project/tools/common/modules.list | xargs | sed s/" "//g) || do_exit $?
+modules+=",jdk.crypto.mscapi"
+create_image_bundle "jbr${jbr_name_postfix}" "jbr" $JSDK_MODS_DIR "$modules" || do_exit $?
+
+# create sdk image bundle
+modules=$(cat ${JSDK}/release | grep MODULES | sed s/MODULES=//g | sed s/' '/','/g | sed s/\"//g | sed s/\\r//g | sed s/\\n//g)
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "fd" ] || [ "$bundle_type" == "$JBRSDK_BUNDLE" ]; then
+ modules=${modules},$(get_mods_list "$JCEF_PATH"/jmods)
+fi
+create_image_bundle "$JBRSDK_BUNDLE${jbr_name_postfix}" "$JBRSDK_BUNDLE" "$JSDK_MODS_DIR" "$modules" || do_exit $?
+
+do_exit 0
diff --git a/jb/project/tools/windows/scripts/pack_aarch64.sh b/jb/project/tools/windows/scripts/pack_aarch64.sh
new file mode 100644
index 000000000000..605c435bf3e2
--- /dev/null
+++ b/jb/project/tools/windows/scripts/pack_aarch64.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script packs test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+
+source jb/project/tools/common/scripts/common.sh
+
+[ "$bundle_type" == "jcef" ] && do_maketest=1
+
+function pack_jbr {
+ __bundle_name=$1
+ __arch_name=$2
+
+ fastdebug_infix=''
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-aarch64-${fastdebug_infix}b${build_number}
+
+ echo Creating $JBR.tar.gz ...
+ chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
+ /usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
+
+ echo Creating $JBR.zip ...
+ /usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
+}
+
+[ "$bundle_type" == "nomod" ] && bundle_type=""
+
+JBRSDK_BUNDLE=jbrsdk
+RELEASE_NAME=windows-aarch64-server-release
+IMAGES_DIR=build/$RELEASE_NAME/images
+BASE_DIR=.
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+pack_jbr jbr${jbr_name_postfix} jbr
+pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-aarch64-b$build_number
+ echo Creating $JBRSDK_TEST.tar.gz ...
+ /usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+fi
\ No newline at end of file
diff --git a/jb/project/tools/windows/scripts/pack_x64.sh b/jb/project/tools/windows/scripts/pack_x64.sh
new file mode 100755
index 000000000000..66dbf66f41cd
--- /dev/null
+++ b/jb/project/tools/windows/scripts/pack_x64.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# jcef - the release bundles with jcef
+# fd - the fastdebug bundles which also include the jcef module
+#
+# This script packs test-image along with JDK images when bundle_type is set to "jcef".
+# If the character 't' is added at the end of bundle_type then it also makes test-image along with JDK images.
+#
+
+source jb/project/tools/common/scripts/common.sh
+
+[ "$bundle_type" == "jcef" ] && do_maketest=1
+
+function pack_jbr {
+ __bundle_name=$1
+ __arch_name=$2
+
+ fastdebug_infix=''
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x64-${fastdebug_infix}b${build_number}
+
+ echo Creating $JBR.tar.gz ...
+ chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
+ /usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
+
+ echo Creating $JBR.zip ...
+ /usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
+}
+
+[ "$bundle_type" == "nomod" ] && bundle_type=""
+
+JBRSDK_BUNDLE=jbrsdk
+RELEASE_NAME=windows-x86_64-server-release
+IMAGES_DIR=build/$RELEASE_NAME/images
+BASE_DIR=.
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+pack_jbr jbr${jbr_name_postfix} jbr
+pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x64-b$build_number
+ echo Creating $JBRSDK_TEST.tar.gz ...
+ /usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
+fi
\ No newline at end of file
diff --git a/jb/project/tools/windows/scripts/pack_x86.sh b/jb/project/tools/windows/scripts/pack_x86.sh
new file mode 100755
index 000000000000..7132a0d3de17
--- /dev/null
+++ b/jb/project/tools/windows/scripts/pack_x86.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+set -euo pipefail
+set -x
+
+# The following parameters must be specified:
+# build_number - specifies the number of JetBrainsRuntime build
+# bundle_type - specifies bundle to be built;possible values:
+# or nomod - the release bundles without any additional modules (jcef)
+# fd - the fastdebug bundles which also include the jcef module
+#
+
+source jb/project/tools/common/scripts/common.sh
+
+[ "$bundle_type" == "jcef" ] && echo "not implemented" && do_exit 1
+
+function pack_jbr {
+ __bundle_name=$1
+ __arch_name=$2
+
+ fastdebug_infix=''
+
+ [ "$bundle_type" == "fd" ] && [ "$__arch_name" == "$JBRSDK_BUNDLE" ] && __bundle_name=$__arch_name && fastdebug_infix="fastdebug-"
+ JBR=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
+ __root_dir=${__bundle_name}-${JBSDK_VERSION}-windows-x86-${fastdebug_infix}b${build_number}
+
+ echo Creating $JBR.tar.gz ...
+ chmod -R ug+rwx,o+rx ${BASE_DIR}/$__root_dir
+ /usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR $__root_dir || do_exit $?
+
+ echo Creating $JBR.zip ...
+ /usr/bin/zip -r $JBR.zip $__root_dir || do_exit $?
+}
+
+[ "$bundle_type" == "nomod" ] && bundle_type=""
+
+JBRSDK_BUNDLE=jbrsdk
+RELEASE_NAME=windows-x86_64-server-release
+IMAGES_DIR=build/$RELEASE_NAME/images
+BASE_DIR=.
+
+if [ "$bundle_type" == "jcef" ] || [ "$bundle_type" == "dcevm" ] || [ "$bundle_type" == "fd" ]; then
+ jbr_name_postfix="_${bundle_type}"
+else
+ jbr_name_postfix=""
+fi
+
+pack_jbr jbr${jbr_name_postfix} jbr
+pack_jbr jbrsdk${jbr_name_postfix} jbrsdk
+
+if [ $do_maketest -eq 1 ]; then
+ JBRSDK_TEST=$JBRSDK_BUNDLE-$JBSDK_VERSION-windows-test-x86-b$build_number
+ echo Creating $JBRSDK_TEST.tar.gz ...
+ /usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $BASE_DIR --exclude='test/jdk/demos' test || do_exit $?
+fi
\ No newline at end of file
diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk
index 62c91ee5f78e..bb136c0eeac8 100644
--- a/make/CompileJavaModules.gmk
+++ b/make/CompileJavaModules.gmk
@@ -100,6 +100,7 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
CREATE_API_DIGEST := true, \
+ PROCESS_JBR_API := true, \
CLEAN := $(CLEAN), \
CLEAN_FILES := $(CLEAN_FILES), \
COPY := $(COPY), \
diff --git a/make/CompileToolsJdk.gmk b/make/CompileToolsJdk.gmk
index 41a19f90ace7..a897931370d6 100644
--- a/make/CompileToolsJdk.gmk
+++ b/make/CompileToolsJdk.gmk
@@ -87,7 +87,7 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
SRC := $(TOPDIR)/make/jdk/src/classes, \
INCLUDES := build/tools/depend, \
- BIN := $(BUILDTOOLS_OUTPUTDIR)/depend, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
DISABLED_WARNINGS := options, \
JAVAC_FLAGS := \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
@@ -100,13 +100,21 @@ $(eval $(call SetupJavaCompilation, COMPILE_DEPEND, \
--add-exports jdk.internal.opt/jdk.internal.opt=jdk.javadoc.interim, \
))
-DEPEND_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services/com.sun.source.util.Plugin
+$(eval $(call SetupJavaCompilation, COMPILE_JBR_API_PLUGIN, \
+ TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
+ SRC := $(TOPDIR)/make/jdk/src/classes, \
+ INCLUDES := build/tools/jbrapi, \
+ BIN := $(BUILDTOOLS_OUTPUTDIR)/plugins, \
+))
+
+PLUGINS_SERVICE_PROVIDER := $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services/com.sun.source.util.Plugin
-$(DEPEND_SERVICE_PROVIDER):
- $(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/depend/META-INF/services)
+$(PLUGINS_SERVICE_PROVIDER):
+ $(call MakeDir, $(BUILDTOOLS_OUTPUTDIR)/plugins/META-INF/services)
$(ECHO) build.tools.depend.Depend > $@
+ $(ECHO) build.tools.jbrapi.JBRApiPlugin >> $@
-TARGETS += $(COMPILE_DEPEND) $(DEPEND_SERVICE_PROVIDER)
+TARGETS += $(COMPILE_DEPEND) $(COMPILE_JBR_API_PLUGIN) $(PLUGINS_SERVICE_PROVIDER)
################################################################################
diff --git a/make/JBRApi.gmk b/make/JBRApi.gmk
new file mode 100644
index 000000000000..e6be9bb41e38
--- /dev/null
+++ b/make/JBRApi.gmk
@@ -0,0 +1,73 @@
+#
+# Copyright 2000-2023 JetBrains s.r.o.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+include $(SPEC)
+include MakeBase.gmk
+include Utils.gmk
+
+JBR_API_ORIGIN := https://github.com/JetBrains/JetBrainsRuntimeApi.git
+JBR_API_DIR := $(TOPDIR)/jbr-api
+
+ARTIFACT_NAME := jbr-api-SNAPSHOT
+ifeq ($(call isBuildOsEnv, windows.cygwin windows.msys2), true)
+ HOME := $$USERPROFILE
+ M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
+else ifeq ($(call isBuildOsEnv, windows.wsl1 windows.wsl2), true)
+ HOME := `cmd.exe /C "echo %USERPROFILE%" 2> /dev/null`
+ M2_REPO := $(shell $(PATHTOOL) $(HOME))/.m2/repository
+else
+ M2_REPO := $(HOME)/.m2/repository
+endif
+M2_ARTIFACT := $(M2_REPO)/com/jetbrains/jbr-api/SNAPSHOT
+M2_POM_CONTENT := \
+ \
+ \
+ 4.0.0 \
+ com.jetbrains \
+ jbr-api \
+ SNAPSHOT \
+ \
+
+jbr-api:
+ if [ -d "$(JBR_API_DIR)" ]; then \
+ $(GIT) -C "$(JBR_API_DIR)" fetch; \
+ $(GIT) -C "$(JBR_API_DIR)" merge-base --is-ancestor origin/main HEAD || \
+ $(ECHO) "!!! Current JBR API revision is outdated, update the branch in $(JBR_API_DIR) !!!"; \
+ else \
+ $(ECHO) "JBR API directory does not exist. Initializing..."; \
+ $(GIT) clone "$(JBR_API_ORIGIN)" "$(JBR_API_DIR)" --config core.autocrlf=false; \
+ fi
+ $(BASH) "$(JBR_API_DIR)/tools/build.sh" dev "$(BOOT_JDK)"
+ if [ -d "$(M2_REPO)" ]; then \
+ $(MKDIR) -p $(M2_ARTIFACT); \
+ $(ECHO) "$(M2_POM_CONTENT)" > $(M2_ARTIFACT)/$(ARTIFACT_NAME).pom; \
+ $(CP) "$(JBR_API_DIR)/out/$(ARTIFACT_NAME).jar" "$(M2_ARTIFACT)"; \
+ $(ECHO) "Installed into local Maven repository as com.jetbrains:jbr-api:SNAPSHOT"; \
+ else \
+ $(ECHO) "No Maven repository found at $(M2_REPO) - skipping local installation"; \
+ fi
+
+.PHONY: jbr-api
diff --git a/make/Main.gmk b/make/Main.gmk
index ddcc0c7f6741..75908df5e268 100644
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -1475,6 +1475,14 @@ create-main-targets-include:
@$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
$(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
+################################################################################
+# JBR API
+
+$(eval $(call SetupTarget, jbr-api, \
+ MAKEFILE := JBRApi, \
+ TARGET := jbr-api \
+))
+
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Main-post.gmk))
diff --git a/make/autoconf/basic_windows.m4 b/make/autoconf/basic_windows.m4
index fb6fc526bfa2..c7fb88976d60 100644
--- a/make/autoconf/basic_windows.m4
+++ b/make/autoconf/basic_windows.m4
@@ -89,8 +89,8 @@ AC_DEFUN([BASIC_SETUP_PATHS_WINDOWS],
WINENV_TEMP_DIR=$($PATHTOOL -u $($CMD /q /c echo %TEMP% 2> /dev/null) | $TR -d '\r\n')
AC_MSG_RESULT([$WINENV_TEMP_DIR])
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
- # Don't trust the current directory for WSL2, but change to an OK temp dir
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1" || test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
+ # Don't trust the current directory for WSL, but change to an OK temp dir
cd "$WINENV_TEMP_DIR"
# Bring along confdefs.h or autoconf gets all confused
cp "$CONFIGURE_START_DIR/confdefs.h" "$WINENV_TEMP_DIR"
@@ -228,7 +228,7 @@ AC_DEFUN([BASIC_WINDOWS_FINALIZE_FIXPATH],
# Platform-specific finalization
AC_DEFUN([BASIC_WINDOWS_FINALIZE],
[
- if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
+ if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl1" || test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.wsl2"; then
# Change back from temp dir
cd $CONFIGURE_START_DIR
fi
diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4
index 61638ce5a2c7..79fe4e4878dd 100644
--- a/make/autoconf/jdk-options.m4
+++ b/make/autoconf/jdk-options.m4
@@ -244,6 +244,31 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
fi
AC_SUBST(HOTSPOT_OVERRIDE_LIBPATH)
+ # Should we build the client for the JAWS screen reader?
+ if test "x$OPENJDK_TARGET_OS" = xwindows; then
+ AC_MSG_CHECKING([if JAWS client support is enabled])
+
+ A11Y_JAWS_ANNOUNCING_ENABLED=true
+ AC_ARG_ENABLE(
+ [jaws-client],
+ [AS_HELP_STRING([--disable-jaws-client], [Set to disable to exclude the client for the JAWS screen reader from the build])],
+ [
+ if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
+ AC_MSG_WARN([--[enable|disable]-jaws-client[=*] flags are ignored for headless builds])
+ elif test "x$enableval" != xyes; then
+ A11Y_JAWS_ANNOUNCING_ENABLED=false
+ fi
+ ]
+ )
+ if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
+ A11Y_JAWS_ANNOUNCING_ENABLED=false
+ fi
+
+ AC_MSG_RESULT([$A11Y_JAWS_ANNOUNCING_ENABLED])
+ else
+ A11Y_JAWS_ANNOUNCING_ENABLED=false
+ fi
+ AC_SUBST(A11Y_JAWS_ANNOUNCING_ENABLED)
])
################################################################################
diff --git a/make/autoconf/lib-dbus.m4 b/make/autoconf/lib-dbus.m4
new file mode 100644
index 000000000000..be6332da3a00
--- /dev/null
+++ b/make/autoconf/lib-dbus.m4
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2024, JetBrains s.r.o.. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Check if a potential dbus library match is correct and usable
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_DBUS],
+[
+ AC_ARG_WITH(dbus-includes, [AS_HELP_STRING([--with-dbus-includes],
+ [specify include directories for the dbus files as list separated by space])])
+
+ if test "x$NEEDS_LIB_DBUS" = xfalse; then
+ DBUS_CFLAGS=
+ DBUS_FOUND=false
+ else
+ if test "x${with_dbus_includes}" != x; then
+ DBUS_FOUND=true
+ DBUS_CFLAGS=""
+ for include in $with_dbus_includes; do
+ DBUS_CFLAGS="${DBUS_CFLAGS}-I${include} "
+ done
+ else
+ PKG_CHECK_MODULES(DBUS, dbus-1, [DBUS_FOUND=true], [
+ DBUS_FOUND=false
+ AC_MSG_NOTICE([Can't find dbus-1 library. This library is needed to use some features. You can install dbus-1 library or specify include directories manually by giving --with-dbus-includes option.])
+ ])
+ fi
+ fi
+
+ AC_SUBST(DBUS_CFLAGS)
+ AC_SUBST(DBUS_FOUND)
+])
\ No newline at end of file
diff --git a/make/autoconf/lib-nvdacontrollerclient.m4 b/make/autoconf/lib-nvdacontrollerclient.m4
new file mode 100644
index 000000000000..08bf245596ac
--- /dev/null
+++ b/make/autoconf/lib-nvdacontrollerclient.m4
@@ -0,0 +1,121 @@
+#
+# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2022, JetBrains s.r.o.. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup nvdacontrollerclient (The library for communication with
+# NVDA - a screen reader for Microsoft Windows)
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_NVDACONTROLLERCLIENT], [
+ # To enable NVDA, user specifies neither --with-nvdacontrollerclient or
+ # a pair (--with-nvdacontrollerclient-include, --with-nvdacontrollerclient-lib)
+ AC_ARG_WITH(nvdacontrollerclient, [AS_HELP_STRING([--with-nvdacontrollerclient],
+ [specify prefix directory for the NVDA Controller Client library package
+ (expecting headers and libs under PATH//)])])
+ AC_ARG_WITH(nvdacontrollerclient-include, [AS_HELP_STRING([--with-nvdacontrollerclient-include],
+ [specify directory for the NVDA Controller Client include files])])
+ AC_ARG_WITH(nvdacontrollerclient-lib, [AS_HELP_STRING([--with-nvdacontrollerclient-lib],
+ [specify directory for the NVDA Controller Client library])])
+
+ NVDACONTROLLERCLIENT_FOUND=no
+ NVDACONTROLLERCLIENT_LIB=
+ NVDACONTROLLERCLIENT_DLL=
+ NVDACONTROLLERCLIENT_CFLAGS=
+
+ if test "x${NEEDS_LIB_NVDACONTROLLERCLIENT}" = "xtrue" ; then
+ if (test "x${with_nvdacontrollerclient_include}" = "x" && test "x${with_nvdacontrollerclient_lib}" != "x") || \
+ (test "x${with_nvdacontrollerclient_include}" != "x" && test "x${with_nvdacontrollerclient_lib}" = "x") ; then
+ AC_MSG_ERROR([Must specify both or neither of --with-nvdacontrollerclient-include and --with-nvdacontrollerclient-lib])
+ elif (test "x${with_nvdacontrollerclient}" != "x" && test "x${with_nvdacontrollerclient_include}" != "x") ; then
+ AC_MSG_ERROR([Must specify either --with-nvdacontrollerclient or a pair (--with-nvdacontrollerclient-include, --with-nvdacontrollerclient-lib)])
+ fi
+
+ if (test "x${with_nvdacontrollerclient}" != "x") || \
+ (test "x${with_nvdacontrollerclient_include}" != "x" && test "x${with_nvdacontrollerclient_lib}" != "x") ; then
+
+ AC_MSG_CHECKING([for nvdacontrollerclient])
+
+ if test "x${OPENJDK_TARGET_OS}" != "xwindows" ; then
+ AC_MSG_ERROR([--with-nvdacontrollerclient[-*] flags are applicable only to Windows builds])
+ fi
+
+ if test "x${OPENJDK_TARGET_CPU_ARCH}" = "xaarch64" ; then
+ NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient32"
+ NVDACONTROLLERCLIENT_ARCHDIR="arm64"
+ elif test "x${OPENJDK_TARGET_CPU_ARCH}" = "xx86" && test "x${OPENJDK_TARGET_CPU_BITS}" = "x64" ; then
+ NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient64"
+ NVDACONTROLLERCLIENT_ARCHDIR="x64"
+ elif test "x${OPENJDK_TARGET_CPU_ARCH}" = "xx86" && test "x${OPENJDK_TARGET_CPU_BITS}" = "x32" ; then
+ NVDACONTROLLERCLIENT_BIN_BASENAME="nvdaControllerClient32"
+ NVDACONTROLLERCLIENT_ARCHDIR="x86"
+ else
+ AC_MSG_ERROR([The nvdacontrollerclient library exists only for x86_32, x86_64, AArch64 architectures])
+ fi
+
+ if test "x${with_nvdacontrollerclient}" != "x" ; then
+ # NVDACONTROLLERCLIENT_ARCHDIR is used only here
+ NVDACONTROLLERCLIENT_INC_PATH="${with_nvdacontrollerclient}/${NVDACONTROLLERCLIENT_ARCHDIR}"
+ NVDACONTROLLERCLIENT_BIN_PATH="${with_nvdacontrollerclient}/${NVDACONTROLLERCLIENT_ARCHDIR}"
+ else
+ NVDACONTROLLERCLIENT_INC_PATH="${with_nvdacontrollerclient_include}"
+ NVDACONTROLLERCLIENT_BIN_PATH="${with_nvdacontrollerclient_lib}"
+ fi
+
+ POTENTIAL_NVDACONTROLLERCLIENT_DLL="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.dll"
+ POTENTIAL_NVDACONTROLLERCLIENT_LIB="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.lib"
+ POTENTIAL_NVDACONTROLLERCLIENT_EXP="${NVDACONTROLLERCLIENT_BIN_PATH}/${NVDACONTROLLERCLIENT_BIN_BASENAME}.exp"
+
+ if ! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_DLL}" || \
+ ! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_LIB}" || \
+ ! test -s "${POTENTIAL_NVDACONTROLLERCLIENT_EXP}" ; then
+ AC_MSG_ERROR([Could not find ${NVDACONTROLLERCLIENT_BIN_BASENAME}.dll and/or ${NVDACONTROLLERCLIENT_BIN_BASENAME}.lib and/or ${NVDACONTROLLERCLIENT_BIN_BASENAME}.exp inside ${NVDACONTROLLERCLIENT_BIN_PATH}])
+ fi
+ if ! test -s "${NVDACONTROLLERCLIENT_INC_PATH}/nvdaController.h" ; then
+ AC_MSG_ERROR([Could not find the header file nvdaController.h inside ${NVDACONTROLLERCLIENT_INC_PATH}])
+ fi
+
+ NVDACONTROLLERCLIENT_CFLAGS="-I${NVDACONTROLLERCLIENT_INC_PATH}"
+ NVDACONTROLLERCLIENT_DLL="${POTENTIAL_NVDACONTROLLERCLIENT_DLL}"
+ NVDACONTROLLERCLIENT_LIB="${POTENTIAL_NVDACONTROLLERCLIENT_LIB}"
+ NVDACONTROLLERCLIENT_FOUND=yes
+
+ AC_MSG_RESULT([includes at ${NVDACONTROLLERCLIENT_INC_PATH} ; binaries at ${NVDACONTROLLERCLIENT_BIN_PATH}])
+ fi
+ elif test "x${with_nvdacontrollerclient}" != "x" || \
+ test "x${with_nvdacontrollerclient_include}" != "x" || test "x${with_nvdacontrollerclient_lib}" != "x" ; then
+ AC_MSG_WARN([[nvdacontrollerclient is not used, so --with-nvdacontrollerclient[-*] is ignored]])
+ fi
+
+ if test "x${NVDACONTROLLERCLIENT_FOUND}" = "xyes" ; then
+ A11Y_NVDA_ANNOUNCING_ENABLED=true
+ else
+ A11Y_NVDA_ANNOUNCING_ENABLED=false
+ fi
+
+ AC_SUBST(A11Y_NVDA_ANNOUNCING_ENABLED)
+ AC_SUBST(NVDACONTROLLERCLIENT_CFLAGS)
+ AC_SUBST(NVDACONTROLLERCLIENT_DLL)
+ AC_SUBST(NVDACONTROLLERCLIENT_LIB)
+])
\ No newline at end of file
diff --git a/make/autoconf/lib-speechd.m4 b/make/autoconf/lib-speechd.m4
new file mode 100644
index 000000000000..0be30dc7db6d
--- /dev/null
+++ b/make/autoconf/lib-speechd.m4
@@ -0,0 +1,92 @@
+#
+# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2022, JetBrains s.r.o.. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup speechd
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_SPEECHD],
+[
+ AC_ARG_WITH(speechd, [AS_HELP_STRING([--with-speechd],
+ [specify prefix directory for the libspeechd package
+ (expecting the headers under PATH/include); required for AccessibleAnnouncer to work])])
+ AC_ARG_WITH(speechd-include, [AS_HELP_STRING([--with-speechd-include],
+ [specify directory for the speechd include files])])
+
+ if test "x$NEEDS_LIB_SPEECHD" = xfalse || test "x${with_speechd}" = xno || \
+ test "x${with_speechd_include}" = xno; then
+ if (test "x${with_speechd}" != x && test "x${with_speechd}" != xno) || \
+ (test "x${with_speechd_include}" != x && test "x${with_speechd_include}" != xno); then
+ AC_MSG_WARN([[speechd not used, so --with-speechd[-*] is ignored]])
+ fi
+ A11Y_SPEECHD_ANNOUNCING_ENABLED=false
+ SPEECHD_CFLAGS=
+ SPEECHD_LIBS=
+ else
+ SPEECHD_FOUND=no
+
+ if test "x${with_speechd}" != x && test "x${with_speechd}" != xyes; then
+ AC_MSG_CHECKING([for speechd header and library])
+ if test -s "${with_speechd}/include/libspeechd.h"; then
+ SPEECHD_CFLAGS="-I${with_speechd}/include"
+ SPEECHD_LIBS="-L${with_speechd}/lib -lspeechd"
+ SPEECHD_FOUND=yes
+ AC_MSG_RESULT([$SPEECHD_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'include/libspeechd.h' under ${with_speechd} given with the --with-speechd option.])
+ fi
+ fi
+ if test "x${with_speechd_include}" != x; then
+ AC_MSG_CHECKING([for speechd headers])
+ if test -s "${with_speechd_include}/libspeechd.h"; then
+ SPEECHD_CFLAGS="-I${with_speechd_include}"
+ SPEECHD_FOUND=yes
+ AC_MSG_RESULT([$SPEECHD_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'include/libspeechd.h' under ${with_speechd} given with the --with-speechd-include option.])
+ fi
+ fi
+ if test "x$SPEECHD_FOUND" = xno; then
+ # Are the libspeechd headers installed in the default /usr/include location?
+ AC_CHECK_HEADERS([libspeechd.h],
+ [ SPEECHD_FOUND=yes ],
+ [ SPEECHD_FOUND=no; break ]
+ )
+ if test "x$SPEECHD_FOUND" = xyes; then
+ SPEECHD_CFLAGS=
+ SPEECHD_LIBS="-lspeechd"
+ fi
+ fi
+ if test "x$SPEECHD_FOUND" = xno; then
+ A11Y_SPEECHD_ANNOUNCING_ENABLED=false
+ else
+ A11Y_SPEECHD_ANNOUNCING_ENABLED=true
+ fi
+ fi
+
+ AC_SUBST(A11Y_SPEECHD_ANNOUNCING_ENABLED)
+ AC_SUBST(SPEECHD_CFLAGS)
+ AC_SUBST(SPEECHD_LIBS)
+])
diff --git a/make/autoconf/lib-wayland.m4 b/make/autoconf/lib-wayland.m4
new file mode 100644
index 000000000000..b58c92736c9b
--- /dev/null
+++ b/make/autoconf/lib-wayland.m4
@@ -0,0 +1,216 @@
+#
+# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+################################################################################
+# Setup wayland
+################################################################################
+AC_DEFUN_ONCE([LIB_SETUP_WAYLAND],
+[
+ AC_ARG_WITH(wayland, [AS_HELP_STRING([--with-wayland],
+ [specify prefix directory for the wayland package
+ (expecting the headers under PATH/include)])])
+ AC_ARG_WITH(wayland-include, [AS_HELP_STRING([--with-wayland-include],
+ [specify directory for the wayland include files])])
+ AC_ARG_WITH(wayland-lib, [AS_HELP_STRING([--with-wayland-lib],
+ [specify directory for the wayland library files])])
+ AC_ARG_WITH(wayland-protocols, [AS_HELP_STRING([--with-wayland-protocols],
+ [specify the root directory for the wayland protocols xml files])])
+ AC_ARG_WITH(gtk-shell1-protocol, [AS_HELP_STRING([--with-gtk-shell1-protocol],
+ [specify the path to the gtk-shell1 Wayland protocol xml file])])
+
+ if test "x$NEEDS_LIB_WAYLAND" = xfalse; then
+ if (test "x${with_wayland}" != x && test "x${with_wayland}" != xno) || \
+ (test "x${with_wayland_include}" != x && test "x${with_wayland_include}" != xno); then
+ AC_MSG_WARN([[wayland not used, so --with-wayland[-*] is ignored]])
+ fi
+ WAYLAND_CFLAGS=
+ WAYLAND_LIBS=
+ VULKAN_FLAGS=
+ VULKAN_ENABLED=false
+ else
+ WAYLAND_FOUND=no
+ WAYLAND_INCLUDES=
+ WAYLAND_DEFINES=
+ if test "x${with_wayland}" = xno || test "x${with_wayland_include}" = xno; then
+ AC_MSG_ERROR([It is not possible to disable the use of wayland. Remove the --without-wayland option.])
+ fi
+
+ if test "x${with_wayland}" != x; then
+ AC_MSG_CHECKING([for wayland headers])
+ if test -s "${with_wayland}/include/wayland-client.h" && test -s "${with_wayland}/include/wayland-cursor.h"; then
+ WAYLAND_INCLUDES="-I${with_wayland}/include"
+ WAYLAND_LIBS="-L${with_wayland}/lib -lwayland-client -lwayland-cursor"
+
+ WAYLAND_FOUND=yes
+ AC_MSG_RESULT([$WAYLAND_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'include/wayland-client.h' and 'include/wayland-cursor.h' under ${with_wayland} given with the --with-wayland option.])
+ fi
+ fi
+ if test "x${with_wayland_include}" != x; then
+ AC_MSG_CHECKING([for wayland headers])
+ if test -s "${with_wayland_include}/wayland-client.h" && test -s "${with_wayland_include}/wayland-cursor.h"; then
+ WAYLAND_INCLUDES="-I${with_wayland_include}"
+ WAYLAND_FOUND=yes
+ AC_MSG_RESULT([$WAYLAND_FOUND])
+ else
+ AC_MSG_ERROR([Can't find 'wayland-client.h' and 'wayland-cursor.h' under ${with_wayland_include} given with the --with-wayland-include option.])
+ fi
+ fi
+ UTIL_REQUIRE_PROGS(WAYLAND_SCANNER, wayland-scanner)
+ if test "x${with_wayland_protocols}" != x; then
+ WAYLAND_PROTOCOLS_ROOT=${with_wayland_protocols}
+ else
+ WAYLAND_PROTOCOLS_ROOT=/usr/share/wayland-protocols/
+ fi
+ GTK_SHELL1_PROTOCOL_PATH=
+ if test "x${with_gtk_shell1_protocol}" != x && test "x${with_gtk_shell1_protocol}" != xno; then
+ AC_MSG_CHECKING([for the gtk-shell1 Wayland protocol])
+ if test -s "${with_gtk_shell1_protocol}"; then
+ WAYLAND_DEFINES="${WAYLAND_DEFINES} -DHAVE_GTK_SHELL1"
+ GTK_SHELL1_PROTOCOL_PATH="${with_gtk_shell1_protocol}"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR([Can't find gtk-shell1 protocol in ${with_gtk_shell1_protocol} given with the --with-gtk-shell1-protocol option.])
+ fi
+ fi
+ if test "x${with_wayland_lib}" != x; then
+ WAYLAND_LIBS="-L${with_wayland_lib} -lwayland-client -lwayland-cursor"
+ fi
+
+ if test "x$WAYLAND_FOUND" = xno; then
+ # Are the wayland headers installed in the default /usr/include location?
+ AC_CHECK_HEADERS([wayland-client.h wayland-cursor.h],
+ [ WAYLAND_FOUND=yes ],
+ [ WAYLAND_FOUND=no; break ]
+ )
+ if test "x$WAYLAND_FOUND" = xyes; then
+ WAYLAND_INCLUDES=
+ WAYLAND_LIBS="-lwayland-client -lwayland-cursor"
+ DEFAULT_WAYLAND=yes
+ fi
+ fi
+ if test "x$WAYLAND_FOUND" = xno; then
+ HELP_MSG_MISSING_DEPENDENCY([wayland])
+ AC_MSG_ERROR([Could not find wayland! $HELP_MSG ])
+ fi
+ WAYLAND_CFLAGS="${WAYLAND_INCLUDES} ${WAYLAND_DEFINES}"
+
+ # Checking for vulkan sdk
+
+ AC_ARG_WITH(vulkan, [AS_HELP_STRING([--with-vulkan],
+ [specify whether we use vulkan])])
+
+ AC_ARG_WITH(vulkan-include, [AS_HELP_STRING([--with-vulkan-include],
+ [specify directory for the vulkan include files ({with-vulkan-include}/vulkan/vulkan.h)])])
+
+ AC_ARG_WITH(vulkan-shader-compiler, [AS_HELP_STRING([--with-vulkan-shader-compiler],
+ [specify which shader compiler to use: glslc/glslangValidator])])
+
+ if test "x$SUPPORTS_LIB_VULKAN" = xfalse; then
+
+ if (test "x${with_vulkan}" != x && test "x${with_vulkan}" != xno) || \
+ (test "x${with_vulkan_include}" != x && test "x${with_vulkan_include}" != xno); then
+ AC_MSG_WARN([[vulkan not used, so --with-vulkan-include is ignored]])
+ fi
+ VULKAN_FLAGS=
+ VULKAN_ENABLED=false
+ else
+ # Do not build vulkan rendering pipeline by default
+ if (test "x${with_vulkan}" = x && test "x${with_vulkan_include}" = x) || \
+ test "x${with_vulkan}" = xno || test "x${with_vulkan_include}" = xno ; then
+ VULKAN_FLAGS=
+ VULKAN_ENABLED=false
+ else
+ VULKAN_FOUND=no
+
+ if test "x${with_vulkan_include}" != x; then
+ AC_MSG_CHECKING([for vulkan.h])
+ if test -s "${with_vulkan_include}/vulkan/vulkan.h"; then
+ VULKAN_FOUND=yes
+ VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -I${with_vulkan_include} -DVULKAN_ENABLED"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Can't find 'vulkan/vulkan.h' under '${with_vulkan_include}'])
+ fi
+ fi
+
+ if test "x$VULKAN_FOUND" = xno; then
+ # Check vulkan sdk location
+ AC_CHECK_HEADERS([$VULKAN_SDK/include/vulkan/vulkan.h],
+ [ VULKAN_FOUND=yes
+ VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -I${VULKAN_SDK}/include -DVULKAN_ENABLED"
+ ],
+ [ VULKAN_FOUND=no; break ]
+ )
+ fi
+
+ if test "x$VULKAN_FOUND" = xno; then
+ # Check default /usr/include location
+ AC_CHECK_HEADERS([vulkan/vulkan.h],
+ [ VULKAN_FOUND=yes
+ VULKAN_FLAGS="-DVK_USE_PLATFORM_WAYLAND_KHR -DVULKAN_ENABLED"
+ ],
+ [ VULKAN_FOUND=no; break ]
+ )
+ fi
+
+ if test "x$VULKAN_FOUND" = xno; then
+ HELP_MSG_MISSING_DEPENDENCY([vulkan])
+ AC_MSG_ERROR([Could not find vulkan! $HELP_MSG ])
+ else
+ # Find shader compiler - glslc or glslangValidator
+ if (test "x${with_vulkan_shader_compiler}" = x || test "x${with_vulkan_shader_compiler}" = xglslc); then
+ UTIL_LOOKUP_PROGS(GLSLC, glslc)
+ SHADER_COMPILER="$GLSLC"
+ VULKAN_SHADER_COMPILER="glslc --target-env=vulkan1.2 -mfmt=num -o"
+ fi
+
+ if (test "x${with_vulkan_shader_compiler}" = x || test "x${with_vulkan_shader_compiler}" = xglslangValidator) && \
+ test "x$SHADER_COMPILER" = x; then
+ UTIL_LOOKUP_PROGS(GLSLANG, glslangValidator)
+ SHADER_COMPILER="$GLSLANG"
+ VULKAN_SHADER_COMPILER="glslangValidator --target-env vulkan1.2 -x -o"
+ fi
+
+ if test "x$SHADER_COMPILER" != x; then
+ VULKAN_ENABLED=true
+ else
+ AC_MSG_ERROR([Can't find shader compiler])
+ fi
+ fi
+ fi
+ fi
+ fi
+ AC_SUBST(VULKAN_FLAGS)
+ AC_SUBST(VULKAN_SHADER_COMPILER)
+ AC_SUBST(VULKAN_ENABLED)
+ AC_SUBST(WAYLAND_CFLAGS)
+ AC_SUBST(WAYLAND_LIBS)
+ AC_SUBST(WAYLAND_PROTOCOLS_ROOT)
+ AC_SUBST(GTK_SHELL1_PROTOCOL_PATH)
+])
diff --git a/make/autoconf/libraries.m4 b/make/autoconf/libraries.m4
index b68fef7bbba9..5aadde668b03 100644
--- a/make/autoconf/libraries.m4
+++ b/make/autoconf/libraries.m4
@@ -33,7 +33,10 @@ m4_include([lib-freetype.m4])
m4_include([lib-hsdis.m4])
m4_include([lib-std.m4])
m4_include([lib-x11.m4])
-
+m4_include([lib-speechd.m4])
+m4_include([lib-nvdacontrollerclient.m4])
+m4_include([lib-dbus.m4])
+m4_include([lib-wayland.m4])
m4_include([lib-tests.m4])
################################################################################
@@ -41,14 +44,27 @@ m4_include([lib-tests.m4])
################################################################################
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
[
- # Check if X11 is needed
+ # Check if X11, wayland and vulkan is needed
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
- # No X11 support on windows or macosx
+ # No X11 and wayland support on windows or macosx
NEEDS_LIB_X11=false
+ NEEDS_LIB_SPEECHD=false
+ NEEDS_LIB_WAYLAND=false
+ SUPPORTS_LIB_VULKAN=false
else
# All other instances need X11, even if building headless only, libawt still
# needs X11 headers.
NEEDS_LIB_X11=true
+
+ if test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
+ NEEDS_LIB_SPEECHD=false
+ NEEDS_LIB_WAYLAND=false
+ SUPPORTS_LIB_VULKAN=false
+ else
+ NEEDS_LIB_SPEECHD=true
+ NEEDS_LIB_WAYLAND=true
+ SUPPORTS_LIB_VULKAN=true
+ fi
fi
# Check if fontconfig is needed
@@ -74,11 +90,13 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
NEEDS_LIB_FREETYPE=true
fi
- # Check if alsa is needed
+ # Check if alsa and dbus is needed
if test "x$OPENJDK_TARGET_OS" = xlinux; then
NEEDS_LIB_ALSA=true
+ NEEDS_LIB_DBUS=true
else
NEEDS_LIB_ALSA=false
+ NEEDS_LIB_DBUS=false
fi
# Check if ffi is needed
@@ -87,6 +105,13 @@ AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
else
NEEDS_LIB_FFI=false
fi
+
+ # Check if nvdacontrollerclient is needed
+ if test "x$OPENJDK_TARGET_OS" = xwindows && test "x$ENABLE_HEADLESS_ONLY" != xtrue; then
+ NEEDS_LIB_NVDACONTROLLERCLIENT=true
+ else
+ NEEDS_LIB_NVDACONTROLLERCLIENT=false
+ fi
])
################################################################################
@@ -126,7 +151,10 @@ AC_DEFUN_ONCE([LIB_SETUP_LIBRARIES],
LIB_SETUP_LIBFFI
LIB_SETUP_MISC_LIBS
LIB_SETUP_X11
-
+ LIB_SETUP_SPEECHD
+ LIB_SETUP_NVDACONTROLLERCLIENT
+ LIB_SETUP_DBUS
+ LIB_SETUP_WAYLAND
LIB_TESTS_SETUP_GTEST
# Math library
diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template
index 18770c6d3603..6d17e3595a23 100644
--- a/make/autoconf/spec.gmk.template
+++ b/make/autoconf/spec.gmk.template
@@ -468,6 +468,33 @@ UBSAN_LDFLAGS := @UBSAN_LDFLAGS@
X_CFLAGS := @X_CFLAGS@
X_LIBS := @X_LIBS@
+# Necessary additional compiler flags to compile dbus
+DBUS_CFLAGS := @DBUS_CFLAGS@
+DBUS_FOUND := @DBUS_FOUND@
+
+# Linux speechd a11y announcer
+A11Y_SPEECHD_ANNOUNCING_ENABLED:=@A11Y_SPEECHD_ANNOUNCING_ENABLED@
+SPEECHD_CFLAGS:=@SPEECHD_CFLAGS@
+SPEECHD_LIBS:=@SPEECHD_LIBS@
+
+# Windows NVDA a11y announcer
+A11Y_NVDA_ANNOUNCING_ENABLED:=@A11Y_NVDA_ANNOUNCING_ENABLED@
+NVDACONTROLLERCLIENT_CFLAGS:=@NVDACONTROLLERCLIENT_CFLAGS@
+NVDACONTROLLERCLIENT_DLL:=@NVDACONTROLLERCLIENT_DLL@
+NVDACONTROLLERCLIENT_LIB:=@NVDACONTROLLERCLIENT_LIB@
+
+# Windows the client for the JAWS screen reader
+A11Y_JAWS_ANNOUNCING_ENABLED:=@A11Y_JAWS_ANNOUNCING_ENABLED@
+
+WAYLAND_CFLAGS:=@WAYLAND_CFLAGS@
+WAYLAND_LIBS:=@WAYLAND_LIBS@
+WAYLAND_PROTOCOLS_ROOT:=@WAYLAND_PROTOCOLS_ROOT@
+WAYLAND_SCANNER:=@WAYLAND_SCANNER@
+GTK_SHELL1_PROTOCOL_PATH:=@GTK_SHELL1_PROTOCOL_PATH@
+VULKAN_FLAGS:=@VULKAN_FLAGS@
+VULKAN_SHADER_COMPILER:=@VULKAN_SHADER_COMPILER@
+VULKAN_ENABLED:=@VULKAN_ENABLED@
+
# The lowest required version of macosx
MACOSX_VERSION_MIN := @MACOSX_VERSION_MIN@
# The highest allowed version of macosx
diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk
index 59ea23d359b6..d8612983be3f 100644
--- a/make/common/JavaCompilation.gmk
+++ b/make/common/JavaCompilation.gmk
@@ -170,6 +170,7 @@ endef
# CREATE_API_DIGEST Set to true to use a javac plugin to generate a public API
# hash which can be used for down stream dependencies to only rebuild
# when the API changes.
+# PROCESS_JBR_API Set to true to use an annotation processor to generate JBR API bindings.
# KEEP_ALL_TRANSLATIONS Set to true to skip translation filtering
SetupJavaCompilation = $(NamedParamsMacroTemplate)
define SetupJavaCompilationBody
@@ -293,11 +294,20 @@ define SetupJavaCompilationBody
"-XDLOG_LEVEL=$(LOG_LEVEL)" \
#
- $1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/depend/_the.COMPILE_DEPEND_batch
+ $1_EXTRA_DEPS := $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_DEPEND_batch
+ endif
+
+ ifeq ($$($1_PROCESS_JBR_API), true)
+ # Automatic path conversion doesn't work for two arguments, so call fixpath manually
+ $1_JBR_API_FLAGS := -Xplugin:"jbr-api $$(call FixPath, $$($1_BIN)/java.base/META-INF/jbrapi.registry) $$(call FixPath, $(TOPDIR)/jb/jbr-api.version)"
+ $1_EXTRA_DEPS := $$($1_EXTRA_DEPS) $$(BUILDTOOLS_OUTPUTDIR)/plugins/_the.COMPILE_JBR_API_PLUGIN_batch
+ endif
+
+ ifeq ($$(call Or, $$($1_CREATE_API_DIGEST) $$($1_PROCESS_JBR_API)), true)
# including the compilation output on the classpath, so that incremental
# compilations in unnamed module can refer to other classes from the same
# source root, which are not being recompiled in this compilation:
- $1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/depend $$($1_BIN)
+ $1_AUGMENTED_CLASSPATH += $$(BUILDTOOLS_OUTPUTDIR)/plugins $$($1_BIN)
endif
ifneq ($$($1_AUGMENTED_CLASSPATH), )
@@ -493,7 +503,7 @@ define SetupJavaCompilationBody
$$(call MakeDir, $$(@D))
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JAVAC_CMD) $$($1_FLAGS) \
- $$($1_API_DIGEST_FLAGS) \
+ $$($1_API_DIGEST_FLAGS) $$($1_JBR_API_FLAGS) \
-XDmodifiedInputs=$$($1_MODFILELIST_FIXED) \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$($1_FILELIST)) && \
$(TOUCH) $$@
diff --git a/make/ide/idea/jdk/build.xml b/make/ide/idea/jdk/build.xml
deleted file mode 100644
index 0292f0f5d359..000000000000
--- a/make/ide/idea/jdk/build.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/make/ide/idea/jdk/idea.gmk b/make/ide/idea/jdk/idea.gmk
index cc4d0a174cd4..9d1673237458 100644
--- a/make/ide/idea/jdk/idea.gmk
+++ b/make/ide/idea/jdk/idea.gmk
@@ -46,13 +46,20 @@ else #with SPEC
endif
idea:
+ $(ECHO) "MODULES=\"$(foreach mod, $(SEL_MODULES), \
+ module='$(mod)' \
+ moduleSrcDirs='$(foreach m,$(call FindModuleSrcDirs,$(mod)),$(call RelativePath,$m,$(topdir)))' \
+ moduleDependencies='$(call FindTransitiveDepsForModule,$(mod))' \
+ #)\"" > $(OUT)
$(ECHO) "SUPPORT=$(SUPPORT_OUTPUTDIR)" >> $(OUT)
$(ECHO) "MODULE_ROOTS=\"$(foreach mod, $(SEL_MODULES), $(call FindModuleSrcDirs, $(mod)))\"" >> $(OUT)
$(ECHO) "MODULE_NAMES=\"$(strip $(foreach mod, $(SEL_MODULES), $(mod)))\"" >> $(OUT)
- $(ECHO) "SEL_MODULES=\"$(SEL_MODULES)\"" >> $(OUT)
- $(ECHO) "BOOT_JDK=\"$(BOOT_JDK)\"" >> $(OUT)
- $(ECHO) "CYGPATH=\"$(PATHTOOL)\"" >> $(OUT)
- $(ECHO) "SPEC=\"$(SPEC)\"" >> $(OUT)
+ $(ECHO) "RELATIVE_TOPLEVEL_PROJECT_DIR=\"$(call RelativePath,$(TOPLEVEL_DIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
+ $(ECHO) "RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
+ $(ECHO) "RELATIVE_BUILD_DIR=\"$(call RelativePath,$(OUTPUTDIR),$(IDEA_OUTPUT_PARENT))\"" >> $(OUT)
+ $(ECHO) "CLION_RELATIVE_PROJECT_DIR=\"$(call RelativePath,$(topdir),$(IDEA_OUTPUT_PARENT)/.idea/jdk-clion)\"" >> $(OUT)
+ $(ECHO) "PATHTOOL=\"$(PATHTOOL)\"" >> $(OUT)
$(ECHO) "JT_HOME=\"$(JT_HOME)\"" >> $(OUT)
+ $(ECHO) "WINENV_ROOT=\"$(WINENV_ROOT)\"" >> $(OUT)
endif
diff --git a/make/ide/idea/jdk/template/ant.xml b/make/ide/idea/jdk/template/ant.xml
deleted file mode 100644
index 9cb90246ea04..000000000000
--- a/make/ide/idea/jdk/template/ant.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/make/ide/idea/jdk/template/compiler.xml b/make/ide/idea/jdk/template/compiler.xml
index eef129e7b871..9281fa10db72 100644
--- a/make/ide/idea/jdk/template/compiler.xml
+++ b/make/ide/idea/jdk/template/compiler.xml
@@ -3,10 +3,10 @@
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/copyright/JetBrainsCE.xml b/make/ide/idea/jdk/template/copyright/JetBrainsCE.xml
new file mode 100644
index 000000000000..abd9a37522ac
--- /dev/null
+++ b/make/ide/idea/jdk/template/copyright/JetBrainsCE.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/copyright/profiles_settings.xml b/make/ide/idea/jdk/template/copyright/profiles_settings.xml
index 7d61b5cdf1fd..641bfc1076d2 100644
--- a/make/ide/idea/jdk/template/copyright/profiles_settings.xml
+++ b/make/ide/idea/jdk/template/copyright/profiles_settings.xml
@@ -1,3 +1,7 @@
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/.name b/make/ide/idea/jdk/template/jdk-clion/.idea/.name
similarity index 100%
rename from make/ide/idea/jdk/template/.name
rename to make/ide/idea/jdk/template/jdk-clion/.idea/.name
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrains.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrains.xml
new file mode 100644
index 000000000000..d4b6973ca964
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrains.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrainsCE.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrainsCE.xml
new file mode 100644
index 000000000000..abd9a37522ac
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/JetBrainsCE.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/profiles_settings.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/profiles_settings.xml
new file mode 100644
index 000000000000..641bfc1076d2
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/misc.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/misc.xml
new file mode 100644
index 000000000000..787e31971f49
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/misc.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/TestFiles.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/TestFiles.xml
new file mode 100644
index 000000000000..6b6961cf7074
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/TestFiles.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/scope_settings.xml b/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/scope_settings.xml
new file mode 100644
index 000000000000..db1b8ba4462a
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/jdk-clion/update-project.sh b/make/ide/idea/jdk/template/jdk-clion/update-project.sh
new file mode 100644
index 000000000000..571145aabdf9
--- /dev/null
+++ b/make/ide/idea/jdk/template/jdk-clion/update-project.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+TOPDIR="###CLION_SCRIPT_TOPDIR###"
+BUILD_DIR="###RELATIVE_BUILD_DIR###"
+PATHTOOL="###PATHTOOL###"
+
+
+
+cd "`dirname $0`"
+SCRIPT_DIR="`pwd`"
+cd "$TOPDIR"
+
+echo "Updating Clion project files in \"$SCRIPT_DIR\" for project \"`pwd`\""
+
+set -o pipefail
+make compile-commands SPEC="$BUILD_DIR/spec.gmk" | sed 's/^/ /' || exit 1
+
+if [ "x$PATHTOOL" != "x" ]; then
+ CLION_PROJECT_DIR="`$PATHTOOL -am $SCRIPT_DIR`"
+ sed "s/\\\\\\\\\\\\\\\\/\\\\\\\\/g" "$BUILD_DIR/compile_commands.json" > "$SCRIPT_DIR/compile_commands.json"
+else
+ CLION_PROJECT_DIR="$SCRIPT_DIR"
+ cp "$BUILD_DIR/compile_commands.json" "$SCRIPT_DIR"
+fi
+
+echo "
+Now you can open \"$CLION_PROJECT_DIR\" as Clion project
+If Clion complains about missing files when loading a project, building it may help:
+ cd \"`pwd`\" && make SPEC=\"$BUILD_DIR/spec.gmk\""
diff --git a/make/ide/idea/jdk/template/jdk.iml b/make/ide/idea/jdk/template/jdk.iml
index c7482e6212e0..3586d58c0aaa 100644
--- a/make/ide/idea/jdk/template/jdk.iml
+++ b/make/ide/idea/jdk/template/jdk.iml
@@ -2,10 +2,9 @@
-
- ###SOURCE_ROOTS###
-
-
+
+
+
diff --git a/make/ide/idea/jdk/template/misc.xml b/make/ide/idea/jdk/template/misc.xml
index 486001253483..acf28bc820e7 100644
--- a/make/ide/idea/jdk/template/misc.xml
+++ b/make/ide/idea/jdk/template/misc.xml
@@ -6,11 +6,8 @@
###JTREG_HOME######BUILD_DIR###
-
+
-
-
-
diff --git a/make/ide/idea/jdk/template/module.iml b/make/ide/idea/jdk/template/module.iml
new file mode 100644
index 000000000000..bd0e65301c72
--- /dev/null
+++ b/make/ide/idea/jdk/template/module.iml
@@ -0,0 +1,11 @@
+
+
+
+
+ ###MODULE_CONTENT_ROOTS###
+
+ ###DEPENDENCIES###
+
+
+
+
diff --git a/make/ide/idea/jdk/template/modules.xml b/make/ide/idea/jdk/template/modules.xml
index 2d8401d0398a..a87145139038 100644
--- a/make/ide/idea/jdk/template/modules.xml
+++ b/make/ide/idea/jdk/template/modules.xml
@@ -3,6 +3,8 @@
+ ###MODULE_IMLS###
+
diff --git a/make/ide/idea/jdk/template/scopes/TestFiles.xml b/make/ide/idea/jdk/template/scopes/TestFiles.xml
new file mode 100644
index 000000000000..6b6961cf7074
--- /dev/null
+++ b/make/ide/idea/jdk/template/scopes/TestFiles.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/make/ide/idea/jdk/template/src/idea/IdeaLoggerWrapper.java b/make/ide/idea/jdk/template/src/idea/IdeaLoggerWrapper.java
deleted file mode 100644
index 0071669815a5..000000000000
--- a/make/ide/idea/jdk/template/src/idea/IdeaLoggerWrapper.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package idea;
-
-import org.apache.tools.ant.Task;
-
-/**
- * This class implements a custom Ant task which replaces the standard Intellij IDEA Ant logger
- * with a custom one which generates tighter output.
- */
-public class IdeaLoggerWrapper extends Task {
- public void execute() {
- new JdkIdeaAntLogger(getProject());
- }
-}
diff --git a/make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java b/make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java
deleted file mode 100644
index dd640bd95a09..000000000000
--- a/make/ide/idea/jdk/template/src/idea/JdkIdeaAntLogger.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package idea;
-
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.DefaultLogger;
-import org.apache.tools.ant.Project;
-
-import java.util.EnumSet;
-import java.util.Stack;
-
-import static org.apache.tools.ant.Project.*;
-
-/**
- * This class is used to wrap the IntelliJ ant logger in order to provide more meaningful
- * output when building langtools. The basic ant output in IntelliJ can be quite cumbersome to
- * work with, as it provides two separate views: (i) a tree view, which is good to display build task
- * in a hierarchical fashion as they are processed; and a (ii) plain text view, which gives you
- * the full ant output. The main problem is that javac-related messages are buried into the
- * ant output (which is made very verbose by IntelliJ in order to support the tree view). It is
- * not easy to figure out which node to expand in order to see the error message; switching
- * to plain text doesn't help either, as now the output is totally flat.
- *
- * This logger class removes a lot of verbosity from the IntelliJ ant logger by not propagating
- * all the events to the IntelliJ's logger. In addition, certain events are handled in a custom
- * fashion, to generate better output during the build.
- */
-public final class JdkIdeaAntLogger extends DefaultLogger {
-
- /**
- * This is just a way to pass in customized binary string predicates;
- *
- * TODO: replace with {@code BiPredicate} and method reference when moving to 8
- */
- enum StringBinaryPredicate {
- CONTAINS() {
- @Override
- boolean apply(String s1, String s2) {
- return s1.contains(s2);
- }
- },
- STARTS_WITH {
- @Override
- boolean apply(String s1, String s2) {
- return s1.startsWith(s2);
- }
- },
- MATCHES {
- @Override
- boolean apply(String s1, String s2) {
- return s1.matches(s2);
- }
- };
-
- abstract boolean apply(String s1, String s2);
- }
-
- /**
- * Various kinds of ant messages that we shall intercept
- */
- enum MessageKind {
-
- /** a make error */
- MAKE_ERROR(StringBinaryPredicate.CONTAINS, MSG_ERR, "error:", "compiler.err"),
- /** a make warning */
- MAKE_WARNING(StringBinaryPredicate.CONTAINS, MSG_WARN, "warning:", "compiler.warn"),
- /** a make note */
- MAKE_NOTE(StringBinaryPredicate.CONTAINS, MSG_INFO, "note:", "compiler.note"),
- /** std make output */
- MAKE_OTHER(StringBinaryPredicate.MATCHES, MSG_INFO, ".*"),
- /** a javac crash */
- JAVAC_CRASH(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "An exception has occurred in the compiler"),
- /** jtreg test success */
- JTREG_TEST_PASSED(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Passed: "),
- /** jtreg test failure */
- JTREG_TEST_FAILED(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "FAILED: "),
- /** jtreg test error */
- JTREG_TEST_ERROR(StringBinaryPredicate.STARTS_WITH, MSG_ERR, "Error: "),
- /** jtreg report */
- JTREG_TEST_REPORT(StringBinaryPredicate.STARTS_WITH, MSG_INFO, "Report written");
-
- StringBinaryPredicate sbp;
- int priority;
- String[] keys;
-
- MessageKind(StringBinaryPredicate sbp, int priority, String... keys) {
- this.sbp = sbp;
- this.priority = priority;
- this.keys = keys;
- }
-
- /**
- * Does a given message string matches this kind?
- */
- boolean matches(String s) {
- for (String key : keys) {
- if (sbp.apply(s, key)) {
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * This enum is used to represent the list of tasks we need to keep track of during logging.
- */
- enum Task {
- /** javac task - invoked during compilation */
- MAKE("exec", MessageKind.MAKE_ERROR, MessageKind.MAKE_WARNING, MessageKind.MAKE_NOTE,
- MessageKind.MAKE_OTHER, MessageKind.JAVAC_CRASH),
- /** jtreg task - invoked during test execution */
- JTREG("jtreg", MessageKind.JTREG_TEST_PASSED, MessageKind.JTREG_TEST_FAILED, MessageKind.JTREG_TEST_ERROR, MessageKind.JTREG_TEST_REPORT),
- /** initial synthetic task when the logger is created */
- ROOT("") {
- @Override
- boolean matches(String s) {
- return false;
- }
- },
- /** synthetic task catching any other tasks not in this list */
- ANY("") {
- @Override
- boolean matches(String s) {
- return true;
- }
- };
-
- String taskName;
- MessageKind[] msgs;
-
- Task(String taskName, MessageKind... msgs) {
- this.taskName = taskName;
- this.msgs = msgs;
- }
-
- boolean matches(String s) {
- return s.equals(taskName);
- }
- }
-
- /**
- * This enum is used to represent the list of targets we need to keep track of during logging.
- * A regular expression is used to match a given target name.
- */
- enum Target {
- /** jtreg target - executed when launching tests */
- JTREG("jtreg") {
- @Override
- String getDisplayMessage(BuildEvent e) {
- return "Running jtreg tests: " + e.getProject().getProperty("jtreg.tests");
- }
- },
- /** build selected modules */
- BUILD_MODULE("build-module") {
- @Override
- String getDisplayMessage(BuildEvent e) {
- return "Building modules: " + e.getProject().getProperty("module.name") + "...";
- }
- },
- /** build images */
- BUILD_IMAGES("images") {
- @Override
- String getDisplayMessage(BuildEvent e) {
- return "Building images...";
- }
- },
- /** build images */
- CONFIGURE("-do-configure") {
- @Override
- String getDisplayMessage(BuildEvent e) {
- return "Configuring build...";
- }
- },
- /** synthetic target catching any other target not in this list */
- ANY("") {
- @Override
- String getDisplayMessage(BuildEvent e) {
- return "Executing Ant target(s): " + e.getProject().getProperty("ant.project.invoked-targets");
- }
- @Override
- boolean matches(String msg) {
- return true;
- }
- };
-
- String targetRegex;
-
- Target(String targetRegex) {
- this.targetRegex = targetRegex;
- }
-
- boolean matches(String msg) {
- return msg.matches(targetRegex);
- }
-
- abstract String getDisplayMessage(BuildEvent e);
- }
-
- /**
- * A custom build event used to represent status changes which should be notified inside
- * Intellij
- */
- static class StatusEvent extends BuildEvent {
-
- /** the target to which the status update refers */
- Target target;
-
- StatusEvent(BuildEvent e, Target target) {
- super(new StatusTask(e, target.getDisplayMessage(e)));
- this.target = target;
- setMessage(getTask().getTaskName(), 2);
- }
-
- /**
- * A custom task used to channel info regarding a status change
- */
- static class StatusTask extends org.apache.tools.ant.Task {
- StatusTask(BuildEvent event, String msg) {
- setProject(event.getProject());
- setOwningTarget(event.getTarget());
- setTaskName(msg);
- }
- }
- }
-
- /** wrapped ant logger (IntelliJ's own logger) */
- DefaultLogger logger;
-
- /** flag - is this the first target we encounter? */
- boolean firstTarget = true;
-
- /** flag - should subsequent failures be suppressed ? */
- boolean suppressTaskFailures = false;
-
- /** flag - have we ran into a javac crash ? */
- boolean crashFound = false;
-
- /** stack of status changes associated with pending targets */
- Stack statusEvents = new Stack<>();
-
- /** stack of pending tasks */
- Stack tasks = new Stack<>();
-
- public JdkIdeaAntLogger(Project project) {
- for (Object o : project.getBuildListeners()) {
- if (o instanceof DefaultLogger) {
- this.logger = (DefaultLogger)o;
- project.removeBuildListener((BuildListener)o);
- project.addBuildListener(this);
- }
- }
- tasks.push(Task.ROOT);
- }
-
- @Override
- public void buildStarted(BuildEvent event) {
- //do nothing
- }
-
- @Override
- public void buildFinished(BuildEvent event) {
- //do nothing
- }
-
- @Override
- public void targetStarted(BuildEvent event) {
- EnumSet statusKinds = firstTarget ?
- EnumSet.allOf(Target.class) :
- EnumSet.complementOf(EnumSet.of(Target.ANY));
-
- String targetName = event.getTarget().getName();
-
- for (Target statusKind : statusKinds) {
- if (statusKind.matches(targetName)) {
- StatusEvent statusEvent = new StatusEvent(event, statusKind);
- statusEvents.push(statusEvent);
- logger.taskStarted(statusEvent);
- firstTarget = false;
- return;
- }
- }
- }
-
- @Override
- public void targetFinished(BuildEvent event) {
- if (!statusEvents.isEmpty()) {
- StatusEvent lastEvent = statusEvents.pop();
- if (lastEvent.target.matches(event.getTarget().getName())) {
- logger.taskFinished(lastEvent);
- }
- }
- }
-
- @Override
- public void taskStarted(BuildEvent event) {
- String taskName = event.getTask().getTaskName();
- System.err.println("task started " + taskName);
- for (Task task : Task.values()) {
- if (task.matches(taskName)) {
- tasks.push(task);
- return;
- }
- }
- }
-
- @Override
- public void taskFinished(BuildEvent event) {
- if (tasks.peek() == Task.ROOT) {
- //we need to 'close' the root task to get nicer output
- logger.taskFinished(event);
- } else if (!suppressTaskFailures && event.getException() != null) {
- //the first (innermost) task failure should always be logged
- event.setMessage(event.getException().toString(), 0);
- event.setException(null);
- //note: we turn this into a plain message to avoid stack trace being logged by Idea
- logger.messageLogged(event);
- suppressTaskFailures = true;
- }
- tasks.pop();
- }
-
- @Override
- public void messageLogged(BuildEvent event) {
- String msg = event.getMessage();
-
- boolean processed = false;
-
- if (!tasks.isEmpty()) {
- Task task = tasks.peek();
- for (MessageKind messageKind : task.msgs) {
- if (messageKind.matches(msg)) {
- event.setMessage(msg, messageKind.priority);
- processed = true;
- if (messageKind == MessageKind.JAVAC_CRASH) {
- crashFound = true;
- }
- break;
- }
- }
- }
-
- if (event.getPriority() == MSG_ERR || crashFound) {
- //we log errors regardless of owning task
- logger.messageLogged(event);
- suppressTaskFailures = true;
- } else if (processed) {
- logger.messageLogged(event);
- }
- }
-}
diff --git a/make/ide/idea/jdk/template/test.iml b/make/ide/idea/jdk/template/test.iml
new file mode 100644
index 000000000000..a72758f3edca
--- /dev/null
+++ b/make/ide/idea/jdk/template/test.iml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+ ###TEST_MODULE_DEPENDENCIES###
+
+
+
diff --git a/make/ide/idea/jdk/template/vcs.xml b/make/ide/idea/jdk/template/vcs.xml
index 3fddb2616b9b..31bda57fe54a 100644
--- a/make/ide/idea/jdk/template/vcs.xml
+++ b/make/ide/idea/jdk/template/vcs.xml
@@ -4,13 +4,13 @@