Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need to run deployToProcessingSketchbook twice #74

Closed
vincentsijben opened this issue Mar 22, 2025 · 1 comment · Fixed by #75
Closed

need to run deployToProcessingSketchbook twice #74

vincentsijben opened this issue Mar 22, 2025 · 1 comment · Fixed by #75
Labels
bug Something isn't working

Comments

@vincentsijben
Copy link
Contributor

Describe the bug

When I change something in the example template, lets say add parent.println("version 1") to the Grid class, and run the task deployToProcessingSketchbook, then the jar files inside build/libs and release/myLibrary/library are changed correctly. But somehow the jar file inside my Processing Libraries folder isnt.
I went back and forth with chatGPT (as I am a total newbie at using the gradle approach), finally I've found something that worked. I needed to change the task to this inside build.gradle.kts:

tasks.register("deployToProcessingSketchbook") {
    group = "processing"
    dependsOn("buildReleaseArtifacts")

    doLast {
        val installDirectory = file("$sketchbookLocation/libraries/$libName")

        println("Removing old install from: $installDirectory")
        delete(installDirectory)

        println("Copying fresh build to sketchbook...")
        project.copy {
            from(releaseDirectory) {
                include(
                    "library.properties",
                    "examples/**",
                    "library/**",
                    "reference/**",
                    "src/**"
                )
            }
            into(installDirectory)
            duplicatesStrategy = DuplicatesStrategy.INCLUDE
        }

        println("✅ Deployment complete.")
    }
}

Am I getting this problem due to a user error (me :) ) ? Or have I indeed found a bug?

I've tested this thouroughly by renaming all the jar files to zip, and use https://www.decompiler.com/ to upload Grid.class and check its contents...

Steps to reproduce

  • add parent.println("version 1"); to Grid.java inside public Grid(PApplet theParent, int[] palette) {
  • run the task deployToProcessingSketchbook

Expected behavior

I should only be running the task once instead of twice.

Actual behavior

I need to run it twice

@vincentsijben vincentsijben added the bug Something isn't working label Mar 22, 2025
@mingness
Copy link
Collaborator

Thanks @vincentsijben , it is indeed a bug! Thanks for finding a solution. Would you be willing to create a PR with your solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants