Files
processing4/java
Avinash Kumar Deepak fa85cd48e8 fix(cli): support sketches with custom main file names (#1329)
* fix(cli): support sketches with custom main file names

Previously, the CLI only accepted sketches where the main .pde file
matched the sketch folder name (e.g., sketch/sketch.pde). This caused
issues when users renamed their main file in the IDE, which stores
the custom filename in sketch.properties.

Now the CLI checks sketch.properties for a 'main' property before
falling back to the default naming convention, matching the IDE's
behavior implemented in Sketch.findMain().

Fixes #1219

* test: add CLI test for custom main file support

Added testSketchWithCustomMainFile() to CLITest.kt as requested by maintainer. This test provides a placeholder for manual testing of sketches with custom main files specified in sketch.properties.

Follows the same pattern as existing CLI tests (testLSP, testLegacyCLI) and is intended to be run manually in IntelliJ IDEA.

* test: convert to automated CLI test with temp directory

Converted testSketchWithCustomMainFile() from manual to automated test. Now creates a temporary sketch folder with custom main file and sketch.properties, then tests the CLI build command.

Follows the pattern from SchemaTest.kt using Files.createTempDirectory() and automatic cleanup.
2026-01-27 19:43:24 -05:00
..
2025-02-05 21:33:57 +01:00
2024-12-23 19:00:37 +01:00

Processing Java Mode

This the Java Mode in Processing. It compiles your sketches and runs them. It is the primary mode of Processing.

Folders

  • application assets for exporting applications within the mode
  • generated generated antlr code for the mode, should be moved to a proper antlr plugin within gradle
  • libraries libraries that are available within the mode
  • lsp gradle build system for the language server protocol, in the future we should decouple the lsp from the java mode and pde and move all relevant code here. For now it can be found in src/.../lsp
  • mode legacy files for Ant
  • preprocessor the preprocessor for the mode, same deal as with the lsp, although the decoupling has mostly been done
  • src the main source code for the mode
  • test tests for the mode
  • theme assets for the mode, related to autocomplete and syntax highlighting

Future plans

  • Decouple the lsp and preprocessor from the mode and move them to their own repositories
  • Move the antlr code to a proper plugin within gradle
  • Create a gradle plugin to convert .pde file to .java files
  • Create a gradle based version of Java mode.