Skip to content

Commit 58765bc

Browse files
committed
Add Processing Gradle plugin README
Introduce java/gradle/README.md documenting the Processing Gradle plugin. Explains how to turn a Processing sketch into a Gradle project using the org.processing.java plugin (build.gradle.kts examples), available tasks (gradle sketch, export, present), dependency and sketchbook configuration, and how to compose multi-sketch projects. Includes examples for using other Gradle plugins and switching Processing versions.
1 parent 177b691 commit 58765bc

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

java/gradle/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Processing Gradle Plugin
2+
3+
This folder contains the source for the Processing Gradle plugin.
4+
The plugin will transform any Processing sketch into a Gradle project for easy compilation and advanced features.
5+
6+
## Usage
7+
8+
Add the following files to any Processing sketch alongside the `.pde` files
9+
10+
```kotlin
11+
// build.gradle.kts
12+
plugins {
13+
id("org.processing.java") version "4.5.3" // version of Processing you would like to use.
14+
}
15+
16+
// settings.gradle.kts - create the file but leave blank
17+
```
18+
19+
This will make the Processing sketch a fully fledges Gradle project, usable with any editor that supports gradle.
20+
Including the `gradle` command if installed.
21+
22+
The plugin will add the `sketch` command to the Gradle tasks lists, so run the sketch with `gradle sketch`, this will
23+
build and launch your sketch.
24+
25+
The sketch can also be bundled into a standalone app by using the `gradle export` command.
26+
Or run in fullscreen with `gradle present`
27+
28+
To include libraries into your sketch add `processing.sketchbook=/path/to/sketchbook` to a `gradle.properties` file in
29+
the same folder.
30+
31+
To use any kind of dependency add as a normal gradle dependency, the plugin has already automatically added the Maven
32+
Central repository.
33+
34+
```kotlin
35+
// build.gradle.kts
36+
plugins {
37+
id("org.processing.java") version "4.5.3"
38+
}
39+
40+
dependencies {
41+
implementation("com.lowagie:itext:2.1.7")
42+
}
43+
```
44+
45+
To use an older version of Processing just change the plugin version:
46+
47+
```kotlin
48+
// build.gradle.kts
49+
plugins {
50+
id("org.processing.java") version "4.5.0"
51+
}
52+
```
53+
54+
Other gradle plugins are also supported
55+
56+
```kotlin
57+
// build.gradle.kts
58+
plugins {
59+
id("org.processing.java") version "4.5.3"
60+
id("com.gradleup.shadow") version "<version>"
61+
}
62+
```
63+
64+
If you want to combine multiple sketches into a single project
65+
66+
```kotlin
67+
// sketch-a/build.gradle.kts
68+
plugins {
69+
id("org.processing.java") version "4.5.3"
70+
}
71+
72+
// sketch-b/build.gradle.kts
73+
plugins {
74+
id("org.processing.java") version "4.5.3"
75+
}
76+
77+
// build.gradle.kts
78+
plugins {
79+
id("org.processing.java") version "4.5.3" apply false
80+
}
81+
// settings.gradle.kts - create the file but leave blank
82+
```
83+
84+
Then run all sketches at once with `gradle sketch`

0 commit comments

Comments
 (0)