From 71e1dd030a715db3fefd326ca38e0da4eeab798b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20de=20Courville?= Date: Thu, 3 Jul 2025 20:41:54 +0200 Subject: [PATCH 1/2] Update BUILD.md with cleaned up CLI build instructions --- BUILD.md | 120 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 79 insertions(+), 41 deletions(-) diff --git a/BUILD.md b/BUILD.md index 98d829c9a0..b95d989737 100644 --- a/BUILD.md +++ b/BUILD.md @@ -2,18 +2,21 @@ 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. -## IntelliJ IDEA +## IntelliJ IDEA (recommended) -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: +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. + +> [!TIP] +> If you encounter any issues with this process, Read the [Troubleshooting and Setup Tips for IntelliJ IDEA](#troubleshooting-and-setup-tips-intellij-idea) 1. Clone the Processing4 repository to your machine locally -1. Open the cloned repository in IntelliJ IDEA CE -1. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing. -1. IntelliJ may start loading Gradle dependencies automatically. Wait for this process to complete. -1. In the main menu, go to File > Project Structure > Project Settings > Project. -1. In the SDK Dropdown option, select a JDK version 17 or Download the jdk -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. -1. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window +2. Open the cloned repository in IntelliJ IDEA CE +3. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing. +4. IntelliJ may start loading Gradle dependencies automatically. Wait for this process to complete. +5. In the main menu, go to File > Project Structure > Project Settings > Project. +6. In the SDK Dropdown option, select a JDK version 17 or Download the jdk +7. Click the green Run Icon in the top right of the window. This is also where you can find the option to debug Processing. +8. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window ## VSCode @@ -25,6 +28,73 @@ First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/ Instructions for other editors are welcome and feel free to contribute the documentation for those [here](#other-editors) +## Other Editors + +TBD + +## Command Line + +If you prefer not to use an IDE, you can also build Processing directly from the command line. + +### Set Up the Environment + +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: + +1. **Clone the repository:** + ```bash + git clone https://github.com/processing/processing4.git + cd processing4 + ``` + +2. **Install Temurin JDK 17:** + + Download and install the appropriate version for your platform: + + - [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) + - [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) + - [Other platforms](https://adoptium.net/temurin/releases/?package=jdk&version=17&os=any&arch=any) + +3. **Set the `JAVA_HOME` environment variable:** + + ```bash + export JAVA_HOME=/path/to/temurin/jdk-17.0.15+6/ + ``` + +### Build, Run, and Package Processing + +#### Build the Project (Required First Step) + +This compiles the source code and prepares everything needed to run or test Processing: + +```bash +./gradlew build +``` + +#### Run Tests + +Run unit tests and verify your build: + +```bash +./gradlew test +``` + +#### Launch Processing + +Start the Processing Development Environment (PDE): + +```bash +./gradlew run +``` + +#### Create a Distributable Package (Optional) + +Generate a packaged version of Processing, ready for distribution: + +```bash +./gradlew package +``` + +The packaged files will be available in the `app/build/compose/binaries` directory. ## Architecture 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 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. -## Other editors - -### No editor, Linux or macOS - -The first step is to install Temurin JDB 17 - LTS. -For Linux on x86, download: -https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz - -For macOS users on Apple Silicon, download: -https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.15_6.pkg - -For everyone else, visit: -https://adoptium.net/temurin/releases/?package=jdk&version=17&os=any&arch=any - - -``` -export JAVA_HOME=/path/to/temurin/jdk-17.0.15+6/ -./gradlew build -./gradlew test -``` - -Then either: -``` -./gradlew package -``` -which will result in the package being placed in `app/build/compose/binaries`, or -``` -./gradlew run -``` - ## Troubleshooting and Setup Tips (IntelliJ IDEA) 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: > `Duplicate content roots detected: '.../processing4/java/src'` This happens because multiple modules reference the same source folder. It’s safe to ignore. - - From bb794e794d03ce41a6e98a5b3cc302a91deceacd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20de=20Courville?= Date: Thu, 3 Jul 2025 20:45:12 +0200 Subject: [PATCH 2/2] Rolled back list numbering --- BUILD.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/BUILD.md b/BUILD.md index b95d989737..39691657e6 100644 --- a/BUILD.md +++ b/BUILD.md @@ -10,13 +10,13 @@ First, [download the IntelliJ IDEA Community Edition](https://www.jetbrains.com/ > If you encounter any issues with this process, Read the [Troubleshooting and Setup Tips for IntelliJ IDEA](#troubleshooting-and-setup-tips-intellij-idea) 1. Clone the Processing4 repository to your machine locally -2. Open the cloned repository in IntelliJ IDEA CE -3. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing. -4. IntelliJ may start loading Gradle dependencies automatically. Wait for this process to complete. -5. In the main menu, go to File > Project Structure > Project Settings > Project. -6. In the SDK Dropdown option, select a JDK version 17 or Download the jdk -7. Click the green Run Icon in the top right of the window. This is also where you can find the option to debug Processing. -8. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window +1. Open the cloned repository in IntelliJ IDEA CE +1. When prompted, select **Trust Project**. You can preview the project in Safe Mode but you won't be able to build Processing. +1. IntelliJ may start loading Gradle dependencies automatically. Wait for this process to complete. +1. In the main menu, go to File > Project Structure > Project Settings > Project. +1. In the SDK Dropdown option, select a JDK version 17 or Download the jdk +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. +1. Logs can be found in the `Build` or `Debug` pane on the bottom left of the window ## VSCode