GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): support sketches with custom main file names by avinxshKD · Pull Request #1329 · processing/processing4

Conversation

@avinxshKD

@avinxshKD avinxshKD commented Nov 18, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Problem

CLI rejected sketches with custom main file names (e.g., sketch/main.pde) even though the IDE supports them via sketch.properties.

Solution

Updated CLI to check sketch.properties for a main property before falling back to default naming, matching IDE behavior from Sketch.findMain().

Changes

  • Commander.java: Added Settings import and custom main file detection logic
  • CommanderTest.java: Added unit tests for default and custom main file handling

Fixes #1219

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@avinxshKD
fix(cli): support sketches with custom main file names
8a4ea97
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 processing#1219
@avinxshKD

avinxshKD commented Nov 19, 2025

Copy link
Copy Markdown
Contributor Author

@Stefterv, kindly review this too when you get a chance

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Stefterv

Stefterv commented Nov 27, 2025

Copy link
Copy Markdown
Member

Hi @avinxshKD the code looks great to me, the tests however could use some work. Could you please create a test that tests the actual issue? See https://github.com/processing/processing4/blob/main/app/test/processing/app/CLITest.kt on how to write tests for the Command Line Interface!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@avinxshKD
test: add CLI test for custom main file support
62e5c20
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.
@avinxshKD

avinxshKD commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

Hi @avinxshKD the code looks great to me, the tests however could use some work. Could you please create a test that tests the actual issue? See https://github.com/processing/processing4/blob/main/app/test/processing/app/CLITest.kt on how to write tests for the Command Line Interface!

Hi @Stefterv, thank you for the feedback! I've made the following updates:

  1. Added CLI test to CLITest.kt as requested - testSketchWithCustomMainFile() follows the same pattern as existing tests and provides instructions for manual testing in IntelliJ IDEA.

The CLI test is ready for manual verification once you have a chance to test with a sketch that has a custom main file in sketch.properties.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Stefterv

Stefterv commented Dec 3, 2025

Copy link
Copy Markdown
Member

Hi @avinxshKD please see here on how to create a temporary directory and temporary sketch so this does not need to be a manual test. We do not do any manual testing unfortunately

processing4/app/test/processing/app/SketchbookTest.kt

Lines 16 to 23 in ef226c9

val directory = createTempDirectory("scaffolding")
val sketchbook = directory.resolve("sketchbook")
sketchbook.toFile().mkdirs()
val sketchbookAbs = sketchbook.toAbsolutePath().toString()
System.setProperty("processing.sketchbook.folder", sketchbookAbs)
val result = Base.getSketchbookFolder()
assertEquals(sketchbookAbs, result.absolutePath)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@avinxshKD
test: convert to automated CLI test with temp directory
0ae4789
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.
@avinxshKD

avinxshKD commented Dec 7, 2025

Copy link
Copy Markdown
Contributor Author

Hi @Stefterv, thank you for the guidance I've updated the test to be fully automated as requested

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@avinxshKD

avinxshKD commented Dec 16, 2025

Copy link
Copy Markdown
Contributor Author

@Stefterv Hey, pls review and is there anything you think I should add or improve? If yes, I’ll work on it after my exams. Thanks

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@catilac
catilac self-requested a review January 28, 2026 00:42
catilac
catilac approved these changes Jan 28, 2026
View reviewed changes
@catilac
catilac merged commit fa85cd4 into processing:main Jan 28, 2026
@SableRaf

SableRaf commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator

@all-contributors please add @avinxshKD for code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@allcontributors allcontributors Bot mentioned this pull request Jan 28, 2026
docs: add avinxshKD as a contributor for code #1390
Merged
@allcontributors

allcontributors Bot commented Jan 28, 2026

Copy link
Copy Markdown
Contributor

@SableRaf

I've put up a pull request to add @avinxshKD! 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@SableRaf

SableRaf commented Jan 28, 2026

Copy link
Copy Markdown
Collaborator

@catilac should I open a new issue for the following review item?

#1329 (comment)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@catilac catilac catilac approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

processing cli does not support sketches with a different main.pde file

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@avinxshKD @Stefterv @SableRaf @catilac
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.