Skip to content

Conversation

@Stefterv
Copy link
Collaborator

@Stefterv Stefterv commented Nov 19, 2025

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.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant