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 — Decoupling `Base.getSketchbookFolder()` by Stefterv · Pull Request #1334 · processing/processing4

Conversation

@Stefterv

@Stefterv Stefterv commented Nov 19, 2025 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This PR aims to decouple Base.getSketchbookFolder() from all its dependencies

Previously the following was necessary to set up to be able to read the sketchbook folder:

        val resources = File("../resources-bundled/common")
        if (!resources.exists()) {
            throw IllegalStateException("Resources folder not found at ${resources.absolutePath}")
        }
        System.setProperty("processing.resources.folder", resources.absolutePath)
        System.setProperty("java.awt.headless", "true")
        Base.setCommandLine()

        Preferences.init()
        Base.locateSketchbookFolder()

With this PR, one can freely read Base.getSketchbookFolder() and all of the required initialisation will happen automatically. e.g.

val folder = Base.getSketchbookFolder()

It will also clean up the double reference to Processing's language files by just including them in the resources system.
I would prefer to use java's resources going forward and try to move away from the bundled folder.

In general there would need to be a push towards cleaning up the side-effects of a lot of these files but that is very much out of scope for now and this way I can continue building on top of the existing infrastructure.

Sorry, something went wrong.

Uh oh!

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

All reactions
Stefterv added 6 commits November 19, 2025 15:13
@Stefterv
Decoupling sketchbook
e4db3b9
@Stefterv
Added settings override
387aa8e
@Stefterv
Revert "Added settings override"
8660f0a
This reverts commit 387aa8e.
@Stefterv
Moved sketchbook override
ce4ec3b
@Stefterv
Using assertEquals
dfd26bb
@Stefterv
Stop using the private field internally
907238d
@Stefterv
Stefterv marked this pull request as ready for review November 19, 2025 15:17
@Stefterv
Stefterv requested a review from catilac November 19, 2025 15:17
catilac
catilac approved these changes Nov 26, 2025
View reviewed changes

@catilac catilac left a comment

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must have been satisfying

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread app/test/processing/app/SketchbookTest.kt
Comment on lines +1 to +7
package processing.app

import kotlin.io.path.createTempDirectory
import kotlin.test.Test
import kotlin.test.assertEquals

class SketchbookTest {

@catilac catilac Nov 26, 2025

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a test a test!

Sorry, something went wrong.

Uh oh!

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

SableRaf and Stefterv reacted with laugh emoji
All reactions
  • 😄 2 reactions
@catilac
catilac merged commit 023bfd2 into processing:main Nov 26, 2025
6 checks passed

Uh oh!

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

@Stefterv
Stefterv deleted the decouple-sketchbook branch November 27, 2025 08:01
@Stefterv Stefterv mentioned this pull request Nov 27, 2025
Fix compose Locale #1349
Merged
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.

Uh oh!

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

2 participants

@Stefterv @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.