diff --git a/.github/instructions/GTK.instructions.md b/.github/instructions/GTK.instructions.md index 91b7b907fca..241d5d30dd5 100644 --- a/.github/instructions/GTK.instructions.md +++ b/.github/instructions/GTK.instructions.md @@ -7,4 +7,4 @@ applyTo: "bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/*.c,bundles/org.ecl - The GTK docs can be found here https://www.gtk.org/docs/ - Be carefull between the difference of GTK3 and GTK4 we need to check for specific versions in some places already - The GTK3 > GTK4 migration guide can be found here https://docs.gtk.org/gtk4/migrating-3to4.html -- You will find a shell script ./build_gtk.sh that must be used to compile the code for testing changes +- Use the native build instructions in the AGENTS.md file to compile the code for testing changes diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index ec2225562e7..6f853888297 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -11,34 +11,35 @@ on: jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + config: + - { os: 'linux' , runner: ubuntu-latest } + - { os: 'macosx', runner: macos-latest } + - { os: 'win32' , runner: windows-latest } + runs-on: ${{ matrix.config.runner }} permissions: contents: read steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: lfs: false - name: Set up JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: java-version: '21' distribution: 'temurin' cache: 'maven' - name: Set up Maven - uses: stCarolas/setup-maven@v5 + uses: stCarolas/setup-maven@12eb41b233df95d49b0c11fc1b5bc8312e5d4ce0 # v5.1 with: maven-version: '3.9.14' - name: Prepare Linux Build + if: ${{ matrix.config.os == 'linux' }} run: | sudo apt-get update -qq sudo apt-get install -qq -y libgtk-3-dev libgtk-4-dev freeglut3-dev webkit2gtk-driver - mkdir -p /home/runner/build/gtk && mkdir -p /home/runner/build/tmp - - echo "cd $GITHUB_WORKSPACE/bundles/org.eclipse.swt && java -Dws=gtk -Darch=x86_64 build-scripts/CollectSources.java -nativeSources '/home/runner/build/gtk'" >> $GITHUB_WORKSPACE/build_gtk.sh - echo "cd /home/runner/build/gtk && SWT_JAVA_HOME=${JAVA_HOME} MODEL=x86_64 OUTPUT_DIR=/home/runner/build/tmp ./build.sh install clean" >> $GITHUB_WORKSPACE/build_gtk.sh - echo "cd $GITHUB_WORKSPACE" >> $GITHUB_WORKSPACE/build_gtk.sh - chmod +x $GITHUB_WORKSPACE/build_gtk.sh - diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b4b09c174e5..f9f49cc3bc9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -128,6 +128,6 @@ jobs: with: runner: ${{ matrix.arch == 'x86_64' && 'macos-15-intel' || 'macos-latest' }} java: ${{ matrix.java }} - native: ${{ matrix.arch == 'x86_64' && 'cocoa.macosx.x86_64' || 'cocoa.macosx.aarch64' }} + native: cocoa.macosx.${{ matrix.arch }} performance: ${{ contains(github.event.pull_request.labels.*.name, 'performance') }} runtodotests: ${{ contains(github.event.pull_request.labels.*.name, 'runtodotests') }} diff --git a/.gitignore b/.gitignore index 89497bab5ac..f9cd93e81ea 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,3 @@ pom.tycho /xdg-runtime-* /binaries/org.eclipse.swt.*/src/ tmpdir/ -# temp build script used by copilot instructions: https://github.com/eclipse-platform/eclipse.platform.swt/blob/c3318b8e7ebc9e34de80afc4f3e5ec15cc7ca112/.github/workflows/copilot-setup-steps.yml#L43 -/build_gtk.sh diff --git a/AGENTS.md b/AGENTS.md index 8b3c17a474a..30a9e6b8c63 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,33 +35,35 @@ SWT consists of two main parts: # Build the entire project mvn clean verify -# Build specific platform binary -mvn clean verify -Dnative=gtk.linux.x86_64 +# Build (and include) specific platform native binaries +mvn clean verify -Dnative=${target.ws}.. # Skip tests mvn clean verify -DskipTests ``` -### Building Natives +### Building native binaries -**GTK (Linux):** -```bash -cd bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library -./build.sh -gtk-all install # Build both GTK3 and GTK4 - -# Build only GTK3 -export GTK_VERSION=3.0 -./build.sh install +In this section, +the placeholder `` has one of the values `macosx`, `linux` or `win32`, +the placeholder `` has one of the values `cocoa` (for Mac), `gtk` (for Linux) or `win32` (for Windows), +the placeholder `` has one of the values `x86_64`, `aarch64`, `ppc64le` or `riscv64`, -# Build only GTK4 -export GTK_VERSION=4.0 -./build.sh install +To build only the native binaries, run +``` +cd binaries/org.eclipse.swt... +mvn clean antrun:run@build-native-binaries -Dnative=.. ``` +For Linux, to build only the GTK3 binaries, set the environment variable `GTK_VERSION` to value `3.0`. +Or to build only the GTK4, set the environment variable `GTK_VERSION` to `4.0`. + **CRITICAL**: Files like `os.c`, `os_stats.c`, `os_stats.h` are **auto-generated**. Never edit them directly! -Instead: modify Java source (e.g., `OS.java`), clean/rebuild the project, then run `./build.sh`. +Instead: modify Java source (e.g., `OS.java`), clean/rebuild the project, then run the native build command above. + +**CRITICAL**: Never commit any built native binary files to git, i.e. files like `libswt-*.so`, `libswt-*.jnilib` or `swt-*.dll`. -See `docs/gtk-dev-guide.md` for detailed instructions. +See `docs/*.md` and `bundles/org.eclipse.swt/Readme*.md` files for detailed instructions. ## Coding Standards diff --git a/docs/GTK4_DEPRECATION_STATUS.md b/docs/GTK4_DEPRECATION_STATUS.md index 564e662785f..39336b5b2b4 100644 --- a/docs/GTK4_DEPRECATION_STATUS.md +++ b/docs/GTK4_DEPRECATION_STATUS.md @@ -1,7 +1,7 @@ # GTK4 Deprecation Status Report **Generated:** 2025-10-31 11:26:36 UTC -**Build Command:** `./build_gtk.sh` +**Build Command:** See the native build instructions in AGENTS.md ## Executive Summary @@ -738,4 +738,4 @@ This is the largest and most complex migration. --- -*This document was generated automatically by analyzing build output from `./build_gtk.sh` on 2025-10-31.* \ No newline at end of file +*This document was generated automatically on 2025-10-31.* \ No newline at end of file