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
28 changes: 15 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,32 @@ SWT consists of two main parts:
### Build Commands
```bash
# Build the entire project
mvn clean verify
mvn clean install
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mvn clean install
mvn clean verify

Installing is IMO not the thing we should recommend by default, since it's modifing the user-wide Maven cache. And that's probably not always wanted.
Whoever wants to to that, can change the command accordingly.

For the AGENTS.md file this might not be that important, but we deficiently shouldn't do that in the README.


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

# Skip tests
mvn clean verify -DskipTests
mvn clean install -DskipTests
```

### Building native binaries

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`,
Run from the repository root, specifying the target platform:

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>
```bash
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following commands are not bash specific, you can also run them in a Windows CMD or Powershell.

# Windows (x86_64)
mvn clean install '-Dnative=win32.win32.x86_64' -DskipTests

# Linux (x86_64)
mvn clean install '-Dnative=gtk.linux.x86_64' -DskipTests

# macOS (x86_64 / aarch64)
mvn clean install '-Dnative=cocoa.macosx.x86_64' -DskipTests
mvn clean install '-Dnative=cocoa.macosx.aarch64' -DskipTests
```
Comment on lines +47 to 59
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commands now do something almost completely different and they don't match the section topic anymore.
Furthermore if the abstract syntax is to hard to understand, I suggest to add one specific example instead of just listing specificly only a subset of the supported/targeted platforms.


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`.
For Linux GTK3-only or GTK4-only builds, set `GTK_VERSION=3.0` or `GTK_VERSION=4.0` in the environment before running.

**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 the native build command above.
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ The `while`-loop processes all GUI related events until the shell is disposed wh
Before exiting, any claimed GUI resources needs to be freed.


## Building Native Binaries

Run from the repository root:

```bash
# Windows (x86_64)
mvn clean install '-Dnative=win32.win32.x86_64' -DskipTests

# Linux (x86_64)
mvn clean install '-Dnative=gtk.linux.x86_64' -DskipTests

# macOS (x86_64 / aarch64)
mvn clean install '-Dnative=cocoa.macosx.x86_64' -DskipTests
mvn clean install '-Dnative=cocoa.macosx.aarch64' -DskipTests
```
Comment on lines +86 to +98
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content should not be here, but instead this paragraph should reference https://github.com/eclipse-platform/eclipse.platform.swt/tree/master/bundles/org.eclipse.swt#building-and-testing-locally.

The commands are implemented in the launch configuration mentioned there.
Therefore I don't know if we should replicate this again, but if you think it should be replicated, there would be the best place.


# Contributing to SWT

Thanks for your interest in this project.
Expand Down
Loading