Closed taseenb closed 6 years ago
Good find. I have not looked up recently, but I am not sure how to have the extension detect the current user's OS/platform in order to use the proper pathing.
Ideally, I'd love to be able to do a check, and if Mac do X and if Windows do Y. But I haven't seen how to do that in the documentation so far, so unless I'm missing it I'm not sure how to check it. Meaning, I am not sure how to fix this extension for Mac without breaking it on Windows.
VS Code is based on Electron (I guess?), which is based on Node. I've never used it, but i suppose the Node API should work, so if you can access the Node process
object, you should be able to get the platform: process.platform
It should return strings like darwin
, linux
or win32
https://nodejs.org/api/process.html#process_process_platform
Aha! That sound work. Just need to add the tweak now. I don't know when I'll have time to tackle it myself, but happy to take a PR if somebody wants to do it themselves.
I'd imagine it's simply adding two different Tasks.json template files (one for Windows and one for Mac, this would also help with #7 's enhancement) and then load the correct one based on platform.
Perhaps I'm reading the issue wrong, so I don't know if this is a "real" solution, but I just changed in the tasks.json, "--output=${workspaceRoot}\\out"
to "--output=${workspaceRoot}/out"
and it seems to build ok now.
If this wasn't the problem you're talking about and solves nothing, I apologize for butting in. 😊
I'd suggest putting this in the readme. I stumbled onto this problem as well.
I haven't had time to tackle this due to other work. I'd love to do a proper fix with @taseenb 's suggestion to pick the appropriate task file template based on platform. But I'd also accept a PR that just explains the problem in the readme
Could we also use just node's Path API and build the task.json config dynamically? It handles all native system file structure for us.
This issue should be resolved in #15 , which has been merged
I installed the extension on VS Code 1.15.1 on Mac OS Sierra and i cannot compile the sketches. To reproduce:
processing-java
Error in console:
incorrect classpath: /blabla/sketch\out
java.io.FileNotFoundException:/blabla/sketch/out/source/noise_blur.java (No such file or directory)
Notice that
out
uses the backslash symbol (\
) instead of the normal slash (/
). The .java file is then created in a folder literally calledsketch\out
in mac (and it's not launched from VS Code, since it cannot find it).