-
Notifications
You must be signed in to change notification settings - Fork 194
Fix and document native build commands for all platforms #3200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,30 +33,32 @@ SWT consists of two main parts: | |
| ### Build Commands | ||
| ```bash | ||
| # Build the entire project | ||
| mvn clean verify | ||
| mvn clean install | ||
|
|
||
| # 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| 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. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| # Contributing to SWT | ||
|
|
||
| Thanks for your interest in this project. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.