Skip to content

Clarify the Comment on Code for Determining the Sketchbook Folder Location in build.gradle.kts #40

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

Closed
SableRaf opened this issue Aug 22, 2024 · 3 comments · Fixed by #45

Comments

@SableRaf
Copy link
Collaborator

While reading through the build.gradle.kts file, I noticed that the comment explaining the code for determining the sketchbook folder location doesn’t fully clarify its purpose or how users should interact with it. Looking at this from the perspective of a library creator, I feel a bit uncertain about what role this step plays in the build and what actions, if any, I might need to take.

Here’s the code in question:

// The location of your sketchbook folder. The sketchbook folder holds your installed libraries, tools, and modes
// Depending on your OS, it should set the correct location.
// You can check the sketchbook location in your Processing application preferences.
var sketchbookLocation = ""
val userHome = System.getProperty("user.home")
val currentOS = OperatingSystem.current()
if(currentOS.isMacOsX) {
    sketchbookLocation = "$userHome/Documents/Processing/sketchbook"
} else if(currentOS.isWindows) {
    sketchbookLocation = "$userHome/My Documents/Processing/sketchbook"
} else {
    sketchbookLocation = "$userHome/sketchbook"
}

Here are a few questions that come to mind:

  1. Could the comment provide more context on why determining the sketchbook location is important?
  2. What are potential edge cases or scenarios where this might not work as expected? In such a case, how will a user know if the sketchbook location could not be determined? How should they fix it?
  3. Is this code part of the internal configuration, or might there be situations where a user would need to adjust the sketchbook location manually? In that case should this be moved to the USER BUILD CONFIGURATIONS section?
@Stefterv
Copy link
Collaborator

This section is included after the
// END USER BUILD CONFIGURATIONS

Maybe that is not clear to the user and we could instead move this to a second file and include it from here

@mingness
Copy link
Collaborator

I did have more comments which I feared was too much. I will review.

@SableRaf
Copy link
Collaborator Author

SableRaf commented Aug 26, 2024

Yes I believe // END USER BUILD CONFIGURATIONS is not clear enough and I would recommend spelling things out more explicitly and in full sentences :) I have addressed that in a separate issue.

As for the comments above, the facts that they use "you" and "should set the correct location" makes it sound like something I might have to be concerned with as a user.

@mingness mingness linked a pull request Aug 28, 2024 that will close this issue
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 a pull request may close this issue.

3 participants