Skip to content

Commit c2e7cb6

Browse files
authored
Build updates for v5 (#1587)
* update github actions to use JVM25, and to get submodules * Update documentation * Specify JVM 25 for gradle daemon * remove conditionals around enableWebGPU * Update github actions to install required linux packages
1 parent c9408ac commit c2e7cb6

12 files changed

Lines changed: 208 additions & 220 deletions

File tree

‎.github/actions/setup/action.yml‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,41 @@ inputs:
77
runs:
88
using: "composite"
99
steps:
10+
# Mirrors libprocessing/.github/actions/setup, needed to build the Rust core on Linux
11+
- name: Install Linux system dependencies
12+
if: runner.os == 'Linux'
13+
shell: bash
14+
run: |
15+
if ! command -v apt-get >/dev/null; then
16+
echo "apt-get not available, skipping system dependencies"
17+
exit 0
18+
fi
19+
sudo apt-get update
20+
sudo apt-get install -y g++ cmake pkg-config libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev libwayland-bin libxkbcommon-dev wayland-protocols libdecor-0-dev libegl1-mesa-dev libwayland-egl1-mesa libfontconfig1-dev
21+
22+
- name: Build and install GLFW 3.4
23+
if: runner.os == 'Linux'
24+
shell: bash
25+
run: |
26+
if ! command -v apt-get >/dev/null; then
27+
exit 0
28+
fi
29+
git clone --depth 1 --branch 3.4 https://github.com/glfw/glfw.git /tmp/glfw
30+
cd /tmp/glfw
31+
cmake -B build -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_WAYLAND=ON -DGLFW_BUILD_X11=ON
32+
cmake --build build
33+
sudo cmake --install build
34+
sudo ldconfig
35+
1036
- name: Install Java
1137
uses: actions/setup-java@v4
1238
with:
13-
java-version: '17'
39+
java-version: '25'
1440
distribution: 'temurin'
1541
architecture: ${{ inputs.arch }}
1642

43+
- name: Install Rust
44+
uses: dtolnay/rust-toolchain@stable
45+
1746
- name: Setup Gradle
1847
uses: gradle/actions/setup-gradle@v4

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
steps:
1919
- name: Checkout Repository
2020
uses: actions/checkout@v4
21+
with:
22+
submodules: recursive
2123

2224
- name: Setup Processing
2325
uses: ./.github/actions/setup
@@ -70,6 +72,8 @@ jobs:
7072
steps:
7173
- name: Checkout Repository
7274
uses: actions/checkout@v4
75+
with:
76+
submodules: recursive
7377

7478
- name: Setup Processing
7579
uses: ./.github/actions/setup

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ jobs:
109109
steps:
110110
- name: Checkout Repository
111111
uses: actions/checkout@v4
112+
with:
113+
submodules: recursive
112114

113115
- name: Setup Processing
114116
uses: ./.github/actions/setup
@@ -137,6 +139,8 @@ jobs:
137139
steps:
138140
- name: Checkout Repository
139141
uses: actions/checkout@v4
142+
with:
143+
submodules: recursive
140144

141145
- name: Setup Processing
142146
uses: ./.github/actions/setup
@@ -183,6 +187,8 @@ jobs:
183187
steps:
184188
- name: Checkout Repository
185189
uses: actions/checkout@v4
190+
with:
191+
submodules: recursive
186192

187193
- name: Setup Processing
188194
uses: ./.github/actions/setup
@@ -249,6 +255,8 @@ jobs:
249255

250256
- name: Checkout Repository
251257
uses: actions/checkout@v4
258+
with:
259+
submodules: recursive
252260

253261
- name: Setup Processing
254262
uses: ./.github/actions/setup
@@ -304,6 +312,8 @@ jobs:
304312
steps:
305313
- name: Checkout Repository
306314
uses: actions/checkout@v4
315+
with:
316+
submodules: recursive
307317

308318
- name: Setup Processing
309319
uses: ./.github/actions/setup

‎BUILD.md‎

Lines changed: 34 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,24 @@ Great to see you are interested in contributing to Processing. To get started yo
77
_**Note:** A paid subscription is **not** required. Everything needed to build and work on Processing is available for free in IntelliJ IDEA._
88

99
1. [Download IntelliJ IDEA](https://www.jetbrains.com/idea/download/) and install it.
10-
1. Clone the `Processing4` repository locally.
10+
1. Install [Rust](https://rustup.rs/). It is needed to build `libprocessing`, the native library behind the WebGPU renderer.
11+
1. Clone the `processing4` repository locally, including its submodules (`git clone --recursive`, or `git submodule update --init --recursive` in an existing clone).
1112
1. Open the cloned repository in **IntelliJ IDEA**.
1213
1. When prompted, select **Trust Project**. (You can preview the project in Safe Mode, but you will not be able to build Processing.)
1314
1. If IntelliJ asks whether to import the Gradle project, select **Load Gradle Project**.
14-
1. Make sure IntelliJ and Gradle are both using **JDK 17**:
15+
1. Make sure IntelliJ and Gradle are both using **JDK 25**:
1516
* Go to **`File > Project Structure > Project`**
16-
* Set **Project SDK** to **JDK 17** (we recommend **Eclipse Temurin**)
17-
* If needed, choose **Download JDK…** and install **Version 17**
17+
* Set **Project SDK** to **JDK 25** (we recommend **Eclipse Temurin**)
18+
* If needed, choose **Download JDK…** and install **Version 25**
1819
* Then go to **`Settings > Build, Execution, Deployment > Build Tools > Gradle`**
19-
* Set **Gradle JVM** to the same **JDK 17**
20+
* Set **Gradle JVM** to the same **JDK 25** (the project requests 25 in `gradle/gradle-daemon-jvm.properties`, so this is usually picked automatically)
2021
1. Wait for Gradle sync to finish.
2122
1. Click the green **Run** button in the top right to build and launch Processing. You can also use this menu to start a debug session.
2223

2324
> [!TIP]
2425
> If you encounter any issues with this process, Read the [Troubleshooting and Setup Tips for IntelliJ IDEA](#troubleshooting-and-setup-tips-intellij-idea)
2526
26-
1. Clone the Processing4 repository to your machine locally
27-
1. Open the cloned repository in IntelliJ IDEA CE
28-
1. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing.
29-
1. IntelliJ may ask if you want to load Gradle project. If you allow this, make sure you are using JDK version 17.
30-
1. In the main menu, go to File > Project Structure > Project Settings > Project.
31-
1. In the SDK Dropdown option, select a JDK version 17 or Download the jdk
32-
1. Click the green Run Icon in the top right of the window. This is also where you can find the option to debug Processing.
33-
1. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window
27+
Logs can be found in the `Build` or `Debug` pane on the bottom left of the window.
3428

3529

3630
## VSCode
@@ -52,69 +46,37 @@ If you prefer not to use an IDE, you can also build Processing directly from the
5246

5347
### Set Up the Environment
5448

55-
If you don't have them installed, you will need to install [Git](https://git-scm.com/downloads) and [Gradle](https://gradle.org/install/) first. Then follow these steps:
49+
If you don't have them installed, you will need to install [Git](https://git-scm.com/downloads), [Gradle](https://gradle.org/install/) and [Rust](https://rustup.rs/) first. Then follow these steps:
5650

5751
1. **Clone the repository:**
5852
```bash
5953
git clone --recursive https://github.com/processing/processing4.git
6054
cd processing4
6155
```
6256

63-
2. **Install Temurin JDK 17:**
57+
2. **Install Temurin JDK 25:**
6458

65-
Download and install the appropriate version for your platform:
66-
67-
- [Linux (x86)](https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz)
68-
- [macOS (Apple Silicon)](https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.15_6.pkg)
69-
- [Other platforms](https://adoptium.net/temurin/releases/?package=jdk&version=17&os=any&arch=any)
70-
71-
### macOS:
72-
```bash
73-
brew install --cask temurin@17
74-
````
75-
76-
### Windows (using winget):
77-
```bash
78-
winget install --id=EclipseAdoptium.Temurin.17.JDK -e
79-
```
80-
81-
### SDKMAN!
82-
83-
[SDKMAN!](https://sdkman.io/) is a useful tool for developers working on multiple versions of the JVM.
84-
85-
## WebGPU Support (Optional)
86-
87-
To build Processing with the experimental WebGPU renderer, you need JDK 25, Rust, and jextract.
88-
89-
### Install Temurin JDK 25
90-
91-
```bash
92-
brew install --cask temurin@25 # macOS
93-
```
94-
95-
### Install `jextract`
59+
Download and install the appropriate version for your platform from [Adoptium](https://adoptium.net/temurin/releases/?package=jdk&version=25&os=any&arch=any), or use a package manager:
9660

97-
`jextract` generates Java bindings from C header files.
98-
You can download it [here](https://jdk.java.net/jextract/) or install it using SDKMAN!:
99-
100-
```bash
101-
sdk install jextract
102-
````
103-
104-
### Build with WebGPU
61+
```bash
62+
brew install --cask temurin@25 # macOS
63+
winget install --id=EclipseAdoptium.Temurin.25.JDK -e # Windows
64+
```
10565

106-
```bash
107-
./gradlew build -PenableWebGPU=true
108-
```
66+
[SDKMAN!](https://sdkman.io/) is also a useful tool for developers working on multiple versions of the JVM.
10967

11068
3. **Set the `JAVA_HOME` environment variable:**
11169

112-
It may be necessary to set the `JAVA_HOME` environment variable to point to your Temurin JDK installation.
70+
It may be necessary to set the `JAVA_HOME` environment variable to point to your Temurin JDK installation.
11371

11472
```bash
115-
export JAVA_HOME=/path/to/temurin/jdk-17.0.15+6/
73+
export JAVA_HOME=/path/to/temurin/jdk-25/
11674
```
11775

76+
4. **(Optional) Install `jextract`:**
77+
78+
`jextract` generates the Java bindings for `libprocessing`. The build downloads it automatically, but if you already have it installed (for example with `sdk install jextract`), that copy will be used instead.
79+
11880
### Build, Run, and Package Processing
11981

12082
#### Build the Project (Required First Step)
@@ -191,18 +153,18 @@ If you are specifically trying to run the `Processing CLI`, you can test command
191153
192154
If you’re building Processing using IntelliJ IDEA and something’s not working, here are a few things that might help:
193155
194-
### Use the Correct JDK (temurin-17)
156+
### Use the Correct JDK (temurin-25)
195157
196-
Make sure IntelliJ is using **temurin-17**, not another version. If building with WebGPU (`-PenableWebGPU=true`), use **temurin-25** instead.
158+
Make sure IntelliJ is using **temurin-25**, not another version.
197159
198160
1. Go to **File > Project Structure > Project**
199-
2. Set the **Project SDK** to: `temurin-17 java version "17.0.15"`
161+
2. Set the **Project SDK** to: `temurin-25 java version "25"`
200162
201163
![JDK Selection](.github/media/troubleshooting-Intellij-setting-djk-version-manually.png)
202164
203165
If it is not already installed, you can download it by:
204166
1. Clicking the SDK input field and then selecting the `Download JDK...` option from the menu
205-
2. Select Version: `17`, Vendor: `Eclipse Temurin (AdoptOpenJDK HotSpot)`
167+
2. Select Version: `25`, Vendor: `Eclipse Temurin (AdoptOpenJDK HotSpot)`
206168
207169
<img width="400" alt="JDK Download" src="https://github.com/user-attachments/assets/503a03a4-3e53-4406-9641-2c93e4b45d51" />
208170
@@ -212,6 +174,15 @@ Now go back to your main window and
212174
1. Click the green Run Icon in the top right of the window.
213175
214176
177+
### “libprocessing submodule directory not found”
178+
179+
The `libprocessing` submodule hasn't been checked out. Run:
180+
181+
```bash
182+
git submodule update --init --recursive
183+
```
184+
185+
215186
### “Duplicate content roots detected”
216187

217188
You may see this warning in IntelliJ:

‎app/build.gradle.kts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ dependencies {
142142
@OptIn(ExperimentalComposeLibrary::class)
143143
testImplementation(compose.uiTest)
144144
testImplementation(kotlin("test"))
145+
testImplementation(libs.mockito)
145146
testImplementation(libs.mockitoKotlin)
146147
testImplementation(libs.junitJupiter)
147148
testImplementation(libs.junitJupiterParams)
@@ -442,10 +443,8 @@ tasks.register<Copy>("includeJavaMode") {
442443
into(composeResources("modes/java/mode"))
443444
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
444445
}
445-
val enableWebGPU = findProperty("enableWebGPU")?.toString()?.toBoolean() ?: false
446-
447446
tasks.register<Copy>("includeJdk") {
448-
val jdkVersion = if (enableWebGPU) 25 else 17
447+
val jdkVersion = 25
449448
val jdkHome = project.the<JavaToolchainService>().launcherFor {
450449
languageVersion.set(JavaLanguageVersion.of(jdkVersion))
451450
}.map { it.metadata.installationPath.asFile }

‎build.gradle.kts‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@ plugins {
1212
// Can be deleted after the migration to Gradle is complete
1313
layout.buildDirectory = file(".build")
1414

15-
val enableWebGPU = findProperty("enableWebGPU")?.toString()?.toBoolean() ?: false
16-
val javaVersion = if (enableWebGPU) "25" else "17"
17-
val kotlinJvmTarget = if (enableWebGPU) {
18-
org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_25
19-
} else {
20-
org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
21-
}
15+
val javaVersion = "25"
16+
val kotlinJvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_25
2217

2318
allprojects {
2419
tasks.withType<JavaCompile>().configureEach {

0 commit comments

Comments
 (0)