Skip to content

SketchException refactor #1164

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

Draft
wants to merge 123 commits into
base: main
Choose a base branch
from

Conversation

joshgiesbrecht
Copy link
Contributor

Created an :app:utils module, moved SketchException to a processing.utils package within :app:utils, changed all references to SketchException in both java and app to use processing.utils.SketchException, removed the two duplicate SketchException classes in app and java.preproc.

This currently seems to work (tested only on Linux so far, but I don't think there's anything platform-specific involved), and does solve the bug of highlighting the first error on running a sketch. Non-Java modes will not yet be using the correct SketchException class; I suspect this will be a 'soft' fail that has a similar problem to the existing bug, but I haven't tested this much yet. (Shader mode seems to be broken already?)

Since the draft PR for #1104 also creates :app:utils and is more complex than this PR, I'm fine with waiting until the other PR is merged, and then I can make sure this one merges cleanly before it's added in.

What's the right thing to do re: the impact on non-Java modes? Should I submit PRs for those projects as well, maybe once this one's actually merged into main?

Copy link
Collaborator

@Stefterv Stefterv left a comment

Choose a reason for hiding this comment

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

Hi @joshgiesbrecht Sorry it took me so long to take a good look at this. Thank you for taking this on and fixing this issue!

Looks good to me, I added a few comments that are mostly about style.

id("java")
}

group = "org.example"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

by "these" you meant the group and version lines, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep

app/.gitignore Outdated
@@ -1,2 +1,3 @@
bin
pde.jar
/utils/build/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use the top level .gitignore

@joshgiesbrecht
Copy link
Contributor Author

Ok, my git skills are weak, and I can't figure out why this PR is dumping so many excess commits in after I rebased the actual changes to an up-to-date main. The branch on my fork of the repo looks reasonable: main...joshgiesbrecht:processing4:SketchException-refactor

Should I resubmit the PR? Or do you know of some way to make it smarten up?

(I'm also not sure how this has ended up failing tests, which is not a great sign. It's building here when I checkout the refactor branch.)

@Stefterv
Copy link
Collaborator

My git knowledge is also not good enough to tell you exactly what you need to do. Feel free to cherry pick your changes onto a new branch and open a new PR.

As for the failing tests, I checked and it makes sense that they are failing, the SketchException class is taken out of a context that Ant (our legacy build system) has access to. One of our next steps is to do away with the Ant based build system. For now I could start disabling the Ant based workflows, what do you think @SableRaf ?

@SableRaf
Copy link
Collaborator

For now I could start disabling the Ant based workflows, what do you think @SableRaf ?

That sounds reasonable :)

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.