Skip to content

Commit 8e9c223

Browse files
committed
Fix and document native build commands for all platforms
Replace broken antrun:run@build-native-binaries command with the correct mvn clean install invocation, quote the -Dnative parameter, and add concise per-platform examples to both AGENTS.md and README.md.
1 parent 9099f6c commit 8e9c223

File tree

2 files changed

+31
-13
lines changed

2 files changed

+31
-13
lines changed

AGENTS.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,30 +33,32 @@ SWT consists of two main parts:
3333
### Build Commands
3434
```bash
3535
# Build the entire project
36-
mvn clean verify
36+
mvn clean install
3737

3838
# Build (and include) specific platform native binaries
39-
mvn clean verify -Dnative=${target.ws}.<os>.<arch>
39+
mvn clean install '-Dnative=<ws>.<os>.<arch>'
4040

4141
# Skip tests
42-
mvn clean verify -DskipTests
42+
mvn clean install -DskipTests
4343
```
4444

4545
### Building native binaries
4646

47-
In this section,
48-
the placeholder `<os>` has one of the values `macosx`, `linux` or `win32`,
49-
the placeholder `<ws>` has one of the values `cocoa` (for Mac), `gtk` (for Linux) or `win32` (for Windows),
50-
the placeholder `<arch>` has one of the values `x86_64`, `aarch64`, `ppc64le` or `riscv64`,
47+
Run from the repository root, specifying the target platform:
5148

52-
To build only the native binaries, run
53-
```
54-
cd binaries/org.eclipse.swt.<ws>.<os>.<arch>
55-
mvn clean antrun:run@build-native-binaries -Dnative=<ws>.<os>.<arch>
49+
```bash
50+
# Windows (x86_64)
51+
mvn clean install '-Dnative=win32.win32.x86_64' -DskipTests
52+
53+
# Linux (x86_64)
54+
mvn clean install '-Dnative=gtk.linux.x86_64' -DskipTests
55+
56+
# macOS (x86_64 / aarch64)
57+
mvn clean install '-Dnative=cocoa.macosx.x86_64' -DskipTests
58+
mvn clean install '-Dnative=cocoa.macosx.aarch64' -DskipTests
5659
```
5760

58-
For Linux, to build only the GTK3 binaries, set the environment variable `GTK_VERSION` to value `3.0`.
59-
Or to build only the GTK4, set the environment variable `GTK_VERSION` to `4.0`.
61+
For Linux GTK3-only or GTK4-only builds, set `GTK_VERSION=3.0` or `GTK_VERSION=4.0` in the environment before running.
6062

6163
**CRITICAL**: Files like `os.c`, `os_stats.c`, `os_stats.h` are **auto-generated**. Never edit them directly!
6264
Instead: modify Java source (e.g., `OS.java`), clean/rebuild the project, then run the native build command above.

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@ The `while`-loop processes all GUI related events until the shell is disposed wh
8181
Before exiting, any claimed GUI resources needs to be freed.
8282

8383

84+
## Building Native Binaries
85+
86+
Run from the repository root:
87+
88+
```bash
89+
# Windows (x86_64)
90+
mvn clean install '-Dnative=win32.win32.x86_64' -DskipTests
91+
92+
# Linux (x86_64)
93+
mvn clean install '-Dnative=gtk.linux.x86_64' -DskipTests
94+
95+
# macOS (x86_64 / aarch64)
96+
mvn clean install '-Dnative=cocoa.macosx.x86_64' -DskipTests
97+
mvn clean install '-Dnative=cocoa.macosx.aarch64' -DskipTests
98+
```
99+
84100
# Contributing to SWT
85101

86102
Thanks for your interest in this project.

0 commit comments

Comments
 (0)