Skip to content

Commit b8c0857

Browse files
authored
Merge pull request #1165 from processing/update-CLI-build-instructions
Update BUILD.md with cleaned up CLI build instructions
2 parents b27f50f + bb794e7 commit b8c0857

File tree

1 file changed

+72
-34
lines changed

1 file changed

+72
-34
lines changed

BUILD.md

Lines changed: 72 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
Great to see you are interested in contributing to Processing. To get started you will need to have an IDE to build and develop Processing. Our recommendation and what we use ourselves is Intellij IDEA.
44

5-
## IntelliJ IDEA
5+
## IntelliJ IDEA (recommended)
66

7-
First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/). Make sure to select the "Community Edition", not "Ultimate". The Community Edition is free and built on open-source software. You may need to scroll down to find the download link. Then:
7+
First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/). Make sure to select the "Community Edition", not "Ultimate". The Community Edition is free and built on open-source software. You may need to scroll down to find the download link.
8+
9+
> [!TIP]
10+
> If you encounter any issues with this process, Read the [Troubleshooting and Setup Tips for IntelliJ IDEA](#troubleshooting-and-setup-tips-intellij-idea)
811
912
1. Clone the Processing4 repository to your machine locally
1013
1. Open the cloned repository in IntelliJ IDEA CE
@@ -25,6 +28,73 @@ First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/
2528

2629
Instructions for other editors are welcome and feel free to contribute the documentation for those [here](#other-editors)
2730

31+
## Other Editors
32+
33+
TBD
34+
35+
## Command Line
36+
37+
If you prefer not to use an IDE, you can also build Processing directly from the command line.
38+
39+
### Set Up the Environment
40+
41+
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:
42+
43+
1. **Clone the repository:**
44+
```bash
45+
git clone https://github.com/processing/processing4.git
46+
cd processing4
47+
```
48+
49+
2. **Install Temurin JDK 17:**
50+
51+
Download and install the appropriate version for your platform:
52+
53+
- [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)
54+
- [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)
55+
- [Other platforms](https://adoptium.net/temurin/releases/?package=jdk&version=17&os=any&arch=any)
56+
57+
3. **Set the `JAVA_HOME` environment variable:**
58+
59+
```bash
60+
export JAVA_HOME=/path/to/temurin/jdk-17.0.15+6/
61+
```
62+
63+
### Build, Run, and Package Processing
64+
65+
#### Build the Project (Required First Step)
66+
67+
This compiles the source code and prepares everything needed to run or test Processing:
68+
69+
```bash
70+
./gradlew build
71+
```
72+
73+
#### Run Tests
74+
75+
Run unit tests and verify your build:
76+
77+
```bash
78+
./gradlew test
79+
```
80+
81+
#### Launch Processing
82+
83+
Start the Processing Development Environment (PDE):
84+
85+
```bash
86+
./gradlew run
87+
```
88+
89+
#### Create a Distributable Package (Optional)
90+
91+
Generate a packaged version of Processing, ready for distribution:
92+
93+
```bash
94+
./gradlew package
95+
```
96+
97+
The packaged files will be available in the `app/build/compose/binaries` directory.
2898

2999
## Architecture
30100
Processing consists of three main components: `Core`, `Java`, and `App`. The `Core` is independent, while `Java` and `App` depend on it. Currently, `Java` and `App` are interdependent, but efforts are underway to decouple them.
@@ -60,36 +130,6 @@ The main task to run or debug the PDE is `run`. That means you just need to run
60130
61131
If your main concern is with the `Core` you don't need to build and start the whole PDE to test your changes. In IntelliJ IDEA you can select any of the sketches in `core/examples/src/.../` to run by click on the green arrow next to their main functions. This will just compile core and the example sketch. Feel free to create additional examples for your new functionality.
62132

63-
## Other editors
64-
65-
### No editor, Linux or macOS
66-
67-
The first step is to install Temurin JDB 17 - LTS.
68-
For Linux on x86, download:
69-
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz
70-
71-
For macOS users on Apple Silicon, download:
72-
https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.15_6.pkg
73-
74-
For everyone else, visit:
75-
https://adoptium.net/temurin/releases/?package=jdk&version=17&os=any&arch=any
76-
77-
78-
```
79-
export JAVA_HOME=/path/to/temurin/jdk-17.0.15+6/
80-
./gradlew build
81-
./gradlew test
82-
```
83-
84-
Then either:
85-
```
86-
./gradlew package
87-
```
88-
which will result in the package being placed in `app/build/compose/binaries`, or
89-
```
90-
./gradlew run
91-
```
92-
93133
## Troubleshooting and Setup Tips (IntelliJ IDEA)
94134

95135
If you’re building Processing using IntelliJ IDEA and something’s not working, here are a few things that might help:
@@ -121,5 +161,3 @@ You may see this warning in IntelliJ:
121161
> `Duplicate content roots detected: '.../processing4/java/src'`
122162

123163
This happens because multiple modules reference the same source folder. It’s safe to ignore.
124-
125-

0 commit comments

Comments
 (0)