Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/instructions/GTK.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 12 additions & 11 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
34 changes: 18 additions & 16 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}.<os>.<arch>

# 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 `<os>` has one of the values `macosx`, `linux` or `win32`,
the placeholder `<ws>` has one of the values `cocoa` (for Mac), `gtk` (for Linux) or `win32` (for Windows),
the placeholder `<arch>` 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.<ws>.<os>.<arch>
mvn clean antrun:run@build-native-binaries -Dnative=<ws>.<os>.<arch>
```

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

Expand Down
4 changes: 2 additions & 2 deletions docs/GTK4_DEPRECATION_STATUS.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.*
*This document was generated automatically on 2025-10-31.*
Loading