Skip to content

Commit bae6533

Browse files
committed
Squashed commit of the following:
commit b2f79f6 Author: Stef Tervelde <[email protected]> Date: Mon Sep 22 14:21:27 2025 +0200 Include root-level Java files in source set Uncommented and updated the configuration to include all .java files at the project root in the source set. This ensures that Java files located directly in the project directory are recognized and compiled. commit 4aeff01 Merge: 046a216 72db9b7 Author: Stef Tervelde <[email protected]> Date: Mon Sep 22 14:07:25 2025 +0200 Merge branch 'main' into gradle-runner commit 72db9b7 Merge: 0c43ebf aa9fd93 Author: Moon <[email protected]> Date: Fri Sep 19 08:24:30 2025 -0400 Merge pull request processing#1251 from Stefterv/lsp-libraries-fix Make sure LSP recognises contributed libraries commit aa9fd93 Author: Stef Tervelde <[email protected]> Date: Fri Sep 19 11:19:37 2025 +0200 Make sure contributions are loaded in the lsp Trigger locating the sketchbook folder so contributed libraries are loaded commit 0c43ebf Merge: 9ca92bc 5a108da Author: Moon <[email protected]> Date: Thu Sep 18 09:01:09 2025 -0400 Merge pull request processing#1248 from processing/all-contributors/add-SuganthiThomas docs: add SuganthiThomas as a contributor for code commit 5a108da Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu Sep 18 13:00:49 2025 +0000 docs: update .all-contributorsrc [skip ci] commit f3198d7 Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu Sep 18 13:00:48 2025 +0000 docs: update README.md [skip ci] commit 9ca92bc Merge: 13e6977 88b9e04 Author: Moon <[email protected]> Date: Thu Sep 18 08:54:28 2025 -0400 Default DEBUG env value to false, or read actual value instead of only checking for existence commit 88b9e04 Author: Suganthi Thomas <[email protected]> Date: Wed Sep 17 22:12:07 2025 -0500 Removed commented lines commit 014fd93 Author: Suganthi Thomas <[email protected]> Date: Tue Sep 16 17:43:01 2025 -0500 DEBUG should be set to the actual value. commit 13e6977 Merge: bdbd025 a741775 Author: Stef Tervelde <[email protected]> Date: Tue Sep 16 09:12:10 2025 +0200 Merge pull request processing#1239 from Stefterv/develop-menu Add 'Develop' menu for debug mode with update check commit a741775 Author: Stef Tervelde <[email protected]> Date: Fri Sep 12 21:51:13 2025 +0200 Added Language key for `menu.develop.check_for_updates` commit bdbd025 Merge: 354e560 9b44035 Author: Moon <[email protected]> Date: Fri Sep 12 14:30:06 2025 -0400 Merge pull request processing#1242 from processing/all-contributors/add-npNSU docs: add npNSU as a contributor for code commit 9b44035 Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri Sep 12 18:26:32 2025 +0000 docs: update .all-contributorsrc [skip ci] commit 2800725 Author: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri Sep 12 18:26:31 2025 +0000 docs: update README.md [skip ci] commit c3b2c6b Merge: d3f3611 354e560 Author: Stef Tervelde <[email protected]> Date: Fri Sep 12 17:54:13 2025 +0200 Merge branch 'processing:main' into develop-menu commit 354e560 Merge: 2c94b38 9507241 Author: Moon <[email protected]> Date: Fri Sep 12 11:50:16 2025 -0400 Merge pull request processing#1236 from Stefterv/main Fix the issue with the pre-processor test commit 2c94b38 Merge: 34a85df 4495cc5 Author: Moon <[email protected]> Date: Fri Sep 12 10:54:55 2025 -0400 Merge pull request processing#1192 from npNSU/dxfMigration Migration of the `dxf` library from Ant to Gradle commit 4495cc5 Merge: 20425fd 34a85df Author: Moon <[email protected]> Date: Fri Sep 12 10:39:45 2025 -0400 Merge branch 'main' into dxfMigration commit 34a85df Merge: 2e855a1 3fbfddb Author: Stef Tervelde <[email protected]> Date: Fri Sep 12 15:34:22 2025 +0200 Merge pull request processing#1222 from hamoid/addDependencyUpdates Add Gradle task to check for dependency updates commit 2e855a1 Merge: 275d789 3814307 Author: Raphaël de Courville <[email protected]> Date: Fri Sep 12 14:43:31 2025 +0200 Merge pull request processing#1226 from Stefterv/pixel-density-warning Add warning for default pixelDensity behavior commit 3814307 Author: Raphaël de Courville <[email protected]> Date: Fri Sep 12 14:42:36 2025 +0200 Update the warning message for pixelDensity Made the warning message more helpful commit 9507241 Author: Stef Tervelde <[email protected]> Date: Fri Sep 12 07:46:40 2025 +0200 Update bug1532 test and resource file Adjusted expected exception position in ParserTests for bug1532 and removed QuickTime session initialization from bug1532.pde to reflect updated test requirements. commit 3fbfddb Merge: 0e18502 275d789 Author: Stef Tervelde <[email protected]> Date: Thu Sep 11 16:09:43 2025 +0200 Merge branch 'main' into addDependencyUpdates commit d3f3611 Author: Stef Tervelde <[email protected]> Date: Thu Sep 11 16:02:49 2025 +0200 Add 'Develop' menu for debug mode with update check Introduces a new 'Develop' menu that appears when debug mode is enabled. commit 0e18502 Author: Abe Pazos <[email protected]> Date: Thu Sep 11 14:09:19 2025 +0200 Gradle libs.versions.toml: inline "versions" version commit 275d789 Merge: 11ba3b4 faf5997 Author: Moon <[email protected]> Date: Tue Sep 9 15:03:41 2025 -0400 Merge pull request processing#1189 from Stefterv/fix-pdf-library Migration of the `pdf` library to Gradle commit 11ba3b4 Merge: 43ba46b 00e4243 Author: Moon <[email protected]> Date: Tue Sep 9 15:02:51 2025 -0400 Merge pull request processing#1232 from Stefterv/gradle-runner-preproc Moving the `java:preprocessor` to be fully Gradle native commit 43ba46b Merge: c570b6d 7e109bd Author: Moon <[email protected]> Date: Tue Sep 9 15:01:52 2025 -0400 Merge pull request processing#1228 from Stefterv/format-cli Adding the sketch format command commit c570b6d Merge: e56e281 8f418a2 Author: Moon <[email protected]> Date: Mon Sep 8 14:41:47 2025 -0400 Merge pull request processing#1227 from awood0727/debugFixUpdate Updated fix for the debugger issue commit 8f418a2 Author: Amante' Woodley <[email protected]> Date: Fri Sep 5 09:53:39 2025 -0400 Updated fix for the dubugger issue Signed-off-by: Amante' Woodley <[email protected]> Co-authored-by: Nia Perez <[email protected]> Co-authored-by: Kayla Bobo <[email protected]> Co-authored-by: Silas Morgan <[email protected]> commit 7e109bd Author: Stef Tervelde <[email protected]> Date: Fri Sep 5 14:28:03 2025 +0200 Adding the sketch format command commit 906ab17 Author: Stef Tervelde <[email protected]> Date: Thu Sep 4 10:34:45 2025 +0200 Add warning for default pixelDensity behavior Introduces a warning message when pixelDensity defaults to 2x to match the display's pixel density. The warning prompts users to explicitly set pixelDensity in settings() to avoid the message. commit 452fbce Author: Abe Pazos <[email protected]> Date: Sat Aug 30 00:15:17 2025 +0200 Add Gradle task to check for dependency updates commit 20425fd Author: [Nia Perez] <[email protected]> Date: Mon Jul 28 14:30:12 2025 -0400 Worked on migration of the dxf library from Ant to Gradle Signed-off-by: [Nia Perez] <[email protected]> Co-authored-by: Amante' Woodley <[email protected]> Co-authored-by: Kayla Bobo <[email protected]> Co-authored-by: Silas Morgan <[email protected]> commit faf5997 Author: Stef Tervelde <[email protected]> Date: Wed Jul 23 06:58:14 2025 +0200 Migration of the `pdf` library to Gradle
1 parent 6812454 commit bae6533

File tree

19 files changed

+302
-77
lines changed

19 files changed

+302
-77
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,24 @@
16511651
"contributions": [
16521652
"code"
16531653
]
1654+
},
1655+
{
1656+
"login": "npNSU",
1657+
"name": "Nia Perez",
1658+
"avatar_url": "https://avatars.githubusercontent.com/u/179620963?v=4",
1659+
"profile": "https://github.com/npNSU",
1660+
"contributions": [
1661+
"code"
1662+
]
1663+
},
1664+
{
1665+
"login": "SuganthiThomas",
1666+
"name": "SuganthiThomas",
1667+
"avatar_url": "https://avatars.githubusercontent.com/u/150956406?v=4",
1668+
"profile": "https://github.com/SuganthiThomas",
1669+
"contributions": [
1670+
"code"
1671+
]
16541672
}
16551673
],
16561674
"repoType": "github",

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,10 @@ _Note: due to GitHub's limitations, this repository's [Contributors](https://git
315315
<td align="center" valign="top" width="16.66%"><a href="https://github.com/manoellribeiro"><img src="https://avatars.githubusercontent.com/u/59377764?v=4?s=120" width="120px;" alt="Manoel Ribeiro"/><br /><sub><b>Manoel Ribeiro</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=manoellribeiro" title="Documentation">📖</a></td>
316316
<td align="center" valign="top" width="16.66%"><a href="https://softmoon.world"><img src="https://avatars.githubusercontent.com/u/15107?v=4?s=120" width="120px;" alt="Moon"/><br /><sub><b>Moon</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=catilac" title="Code">💻</a></td>
317317
</tr>
318+
<tr>
319+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/npNSU"><img src="https://avatars.githubusercontent.com/u/179620963?v=4?s=120" width="120px;" alt="Nia Perez"/><br /><sub><b>Nia Perez</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=npNSU" title="Code">💻</a></td>
320+
<td align="center" valign="top" width="16.66%"><a href="https://github.com/SuganthiThomas"><img src="https://avatars.githubusercontent.com/u/150956406?v=4?s=120" width="120px;" alt="SuganthiThomas"/><br /><sub><b>SuganthiThomas</b></sub></a><br /><a href="https://github.com/processing/processing4/commits?author=SuganthiThomas" title="Code">💻</a></td>
321+
</tr>
318322
</tbody>
319323
</table>
320324

app/src/processing/app/Base.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ public class Base {
6565
* if an empty file named 'debug' is found in the settings folder.
6666
* See implementation in createAndShowGUI().
6767
*/
68-
static public boolean DEBUG = System.getenv().containsKey("DEBUG");
68+
69+
static public boolean DEBUG = Boolean.parseBoolean(System.getenv().getOrDefault("DEBUG", "false"));
70+
6971

7072
/** True if running via Commander. */
7173
static private boolean commandLine;

app/src/processing/app/Processing.kt

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,28 @@ import com.github.ajalt.clikt.parameters.options.help
1212
import com.github.ajalt.clikt.parameters.options.option
1313
import processing.app.gradle.api.Sketch
1414
import processing.app.api.Contributions
15+
import processing.app.api.SketchCommand
1516
import processing.app.api.Sketchbook
1617
import processing.app.ui.Start
1718
import java.io.File
1819
import java.util.prefs.Preferences
1920
import kotlin.concurrent.thread
2021

21-
class Processing: SuspendingCliktCommand("processing"){
22-
val version by option("-v","--version")
22+
23+
suspend fun main(args: Array<String>) {
24+
Processing()
25+
.subcommands(
26+
LSP(),
27+
LegacyCLI(args),
28+
Contributions(),
29+
Sketchbook(),
30+
SketchCommand()
31+
)
32+
.main(args)
33+
}
34+
35+
class Processing : SuspendingCliktCommand("processing") {
36+
val version by option("-v", "--version")
2337
.flag()
2438
.help("Print version information")
2539

@@ -30,7 +44,7 @@ class Processing: SuspendingCliktCommand("processing"){
3044
override fun help(context: Context) = "Start the Processing IDE"
3145
override val invokeWithoutSubcommand = true
3246
override suspend fun run() {
33-
if(version){
47+
if (version) {
3448
println("processing-${Base.getVersionName()}-${Base.getRevision()}")
3549
return
3650
}
@@ -47,21 +61,10 @@ class Processing: SuspendingCliktCommand("processing"){
4761
}
4862
}
4963

50-
suspend fun main(args: Array<String>){
51-
Processing()
52-
.subcommands(
53-
LSP(),
54-
LegacyCLI(args),
55-
Sketch(),
56-
Contributions(),
57-
Sketchbook()
58-
)
59-
.main(args)
60-
}
6164

62-
class LSP: SuspendingCliktCommand("lsp"){
65+
class LSP : SuspendingCliktCommand("lsp") {
6366
override fun help(context: Context) = "Start the Processing Language Server"
64-
override suspend fun run(){
67+
override suspend fun run() {
6568
try {
6669
// run in headless mode
6770
System.setProperty("java.awt.headless", "true")
@@ -76,8 +79,7 @@ class LSP: SuspendingCliktCommand("lsp"){
7679
}
7780
}
7881

79-
80-
class LegacyCLI(val args: Array<String>): SuspendingCliktCommand("cli") {
82+
class LegacyCLI(val args: Array<String>) : SuspendingCliktCommand("cli") {
8183
override val treatUnknownOptionsAsArgs = true
8284

8385
val help by option("--help").flag()
@@ -97,35 +99,35 @@ class LegacyCLI(val args: Array<String>): SuspendingCliktCommand("cli") {
9799
}
98100
}
99101

100-
fun updateInstallLocations(){
102+
fun updateInstallLocations() {
101103
val preferences = Preferences.userRoot().node("org/processing/app")
102104
val installLocations = preferences.get("installLocations", "")
103105
.split(",")
104106
.dropLastWhile { it.isEmpty() }
105107
.filter { install ->
106-
try{
108+
try {
107109
val (path, version) = install.split("^")
108110
val file = File(path)
109-
if(!file.exists() || file.isDirectory){
111+
if (!file.exists() || file.isDirectory) {
110112
return@filter false
111113
}
112114
// call the path to check if it is a valid install location
113115
val process = ProcessBuilder(path, "--version")
114116
.redirectErrorStream(true)
115117
.start()
116118
val exitCode = process.waitFor()
117-
if(exitCode != 0){
119+
if (exitCode != 0) {
118120
return@filter false
119121
}
120122
val output = process.inputStream.bufferedReader().readText()
121123
return@filter output.contains(version)
122-
} catch (e: Exception){
124+
} catch (e: Exception) {
123125
false
124126
}
125127
}
126128
.toMutableList()
127129
val command = ProcessHandle.current().info().command()
128-
if(command.isEmpty) {
130+
if (command.isEmpty) {
129131
return
130132
}
131133
val installLocation = "${command.get()}^${Base.getVersionName()}"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package processing.app.api
2+
3+
import com.github.ajalt.clikt.command.SuspendingCliktCommand
4+
import com.github.ajalt.clikt.core.Context
5+
import com.github.ajalt.clikt.core.subcommands
6+
import com.github.ajalt.clikt.parameters.arguments.argument
7+
import com.github.ajalt.clikt.parameters.arguments.help
8+
import com.github.ajalt.clikt.parameters.options.flag
9+
import com.github.ajalt.clikt.parameters.options.help
10+
import com.github.ajalt.clikt.parameters.options.option
11+
import processing.app.Language
12+
import processing.app.Platform
13+
import processing.app.Preferences
14+
import java.io.File
15+
16+
class SketchCommand: SuspendingCliktCommand("sketch"){
17+
override fun help(context: Context) = "Manage a Processing sketch"
18+
override suspend fun run() {
19+
20+
}
21+
init {
22+
subcommands(Format())
23+
}
24+
25+
class Format: SuspendingCliktCommand("format"){
26+
override fun help(context: Context) = "Format a Processing sketch"
27+
val file by argument("file")
28+
.help("Path to the sketch file to format")
29+
val inPlace by option("-i","--inplace")
30+
.flag()
31+
.help("Format the file in place, otherwise prints to stdout")
32+
33+
override suspend fun run(){
34+
try {
35+
Platform.init()
36+
Language.init()
37+
Preferences.init()
38+
39+
// run in headless mode
40+
System.setProperty("java.awt.headless", "true")
41+
42+
val clazz = Class.forName("processing.mode.java.AutoFormat")
43+
// Indirect invocation since app does not depend on java mode
44+
val formatter = clazz
45+
.getDeclaredConstructor()
46+
.newInstance()
47+
48+
val method = clazz.getMethod("format", String::class.java)
49+
val code = File(file).readText()
50+
51+
val formatted = method.invoke(formatter, code) as String
52+
if(inPlace) {
53+
File(file).writeText(formatted)
54+
return
55+
}
56+
println(formatted)
57+
} catch (e: Exception) {
58+
throw InternalError("Failed to invoke main method", e)
59+
}
60+
}
61+
}
62+
}

app/src/processing/app/ui/Editor.java

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,7 @@
4949
import javax.swing.undo.*;
5050

5151
import com.formdev.flatlaf.util.SystemInfo;
52-
import processing.app.Base;
53-
import processing.app.Formatter;
54-
import processing.app.Language;
55-
import processing.app.Messages;
56-
import processing.app.Mode;
57-
import processing.app.Platform;
58-
import processing.app.Preferences;
59-
import processing.app.Problem;
60-
import processing.app.RunnerListener;
61-
import processing.app.Sketch;
62-
import processing.app.SketchCode;
52+
import processing.app.*;
6353
import processing.utils.SketchException;
6454
import processing.app.contrib.ContributionManager;
6555
import processing.app.gradle.GradleService;
@@ -148,6 +138,7 @@ public abstract class Editor extends JFrame implements RunnerListener {
148138
private FindReplace find;
149139
JMenu toolsMenu;
150140
JMenu modePopup;
141+
JMenu developMenu;
151142

152143
protected List<Problem> problems = Collections.emptyList();
153144

@@ -689,6 +680,7 @@ protected void buildMenuBar() {
689680
helpMenu.setText(helpMenu.getText() + " ");
690681
}
691682
menubar.add(helpMenu);
683+
updateDevelopMenu(menubar);
692684

693685
Toolkit.setMenuMnemonics(menubar);
694686
setJMenuBar(menubar);
@@ -1069,6 +1061,37 @@ public JMenu buildModeMenu() {
10691061

10701062
abstract public JMenu buildHelpMenu();
10711063

1064+
public void buildDevelopMenu(){
1065+
developMenu = new JMenu(Language.text("menu.develop"));
1066+
1067+
var updateTrigger = new JMenuItem(Language.text("menu.develop.check_for_updates"));
1068+
updateTrigger.addActionListener(e -> {
1069+
Preferences.unset("update.last");
1070+
new UpdateCheck(base);
1071+
});
1072+
developMenu.add(updateTrigger);
1073+
1074+
}
1075+
1076+
public void updateDevelopMenu(){
1077+
updateDevelopMenu(null);
1078+
}
1079+
1080+
void updateDevelopMenu(JMenuBar menu){
1081+
if(menu == null){
1082+
menu = getJMenuBar();
1083+
}
1084+
if(developMenu == null){
1085+
buildDevelopMenu();
1086+
}
1087+
if(Base.DEBUG){
1088+
menu.add(developMenu);
1089+
}else{
1090+
menu.remove(developMenu);
1091+
}
1092+
1093+
}
1094+
10721095

10731096
public void showReference(String filename) {
10741097
File file = new File(mode.getReferenceFolder(), filename);

app/src/processing/app/ui/EditorFooter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public EditorFooter(Editor eddie) {
116116
public void mousePressed(MouseEvent e) {
117117
if(e.getClickCount() == 5){
118118
Base.DEBUG = !Base.DEBUG;
119+
editor.updateDevelopMenu();
119120
}
120121
var debugInformation = String.join("\n",
121122
"Version: " + Base.getVersionName(),

build.gradle.kts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ plugins {
44

55
alias(libs.plugins.compose.compiler) apply false
66
alias(libs.plugins.jetbrainsCompose) apply false
7+
8+
alias(libs.plugins.versions)
79
}
810

911
// Set the build directory to not /build to prevent accidental deletion through the clean action
@@ -17,4 +19,20 @@ allprojects{
1719
tasks.withType<Javadoc> {
1820
options.encoding = "UTF-8"
1921
}
20-
}
22+
}
23+
// Configure the dependencyUpdates task
24+
tasks {
25+
dependencyUpdates {
26+
gradleReleaseChannel = "current"
27+
28+
val nonStableKeywords = listOf("alpha", "beta", "rc")
29+
30+
fun isNonStable(version: String) = nonStableKeywords.any {
31+
version.lowercase().contains(it)
32+
}
33+
34+
rejectVersionIf {
35+
isNonStable(candidate.version) && !isNonStable(currentVersion)
36+
}
37+
}
38+
}

build/shared/lib/languages/PDE.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ menu.help.visit.url = https://processing.org/
172172
menu.help.report.url = https://github.com/processing/processing4/issues
173173
menu.help.ask.url = https://discourse.processing.org
174174

175+
menu.develop = Develop
176+
menu.develop.check_for_updates = Force Check for updates
175177

176178
# ---------------------------------------
177179
# Basics

core/src/processing/core/PApplet.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ public PSurface getSurface() {
802802
// Unlike the others above, needs to be public to support
803803
// the pixelWidth and pixelHeight fields.
804804
public int pixelDensity = 1;
805+
boolean pixelDensityWarning = false;
805806

806807
boolean present;
807808

@@ -1082,6 +1083,9 @@ public int displayDensity(int display) {
10821083
*/
10831084
public void pixelDensity(int density) {
10841085
//println(density + " " + this.pixelDensity);
1086+
1087+
1088+
this.pixelDensityWarning = false;
10851089
if (density != this.pixelDensity) {
10861090
if (insideSettings("pixelDensity", density)) {
10871091
if (density != 1 && density != 2) {
@@ -2050,6 +2054,10 @@ public void handleDraw() {
20502054
if (frameCount == 0) {
20512055
setup();
20522056

2057+
if(pixelDensityWarning){
2058+
System.err.println("Warning: Processing now sets pixelDensity(2) by default on high-density screens. This may change how your sketch looks. To revert to the old behavior, set pixelDensity(1) in setup().");
2059+
}
2060+
20532061
} else { // frameCount > 0, meaning an actual draw()
20542062
// update the current frameRate
20552063

@@ -10108,6 +10116,7 @@ static public void runSketch(final String[] args,
1010810116
sketch.fullScreen = fullScreen;
1010910117

1011010118
sketch.pixelDensity = sketch.displayDensity();
10119+
sketch.pixelDensityWarning = sketch.pixelDensity > 1;
1011110120

1011210121
// For 3.0.1, moved this above handleSettings() so that loadImage() can be
1011310122
// used inside settings(). Sets a terrible precedent, but the alternative

0 commit comments

Comments
 (0)