radicaled / dart-tools

Various tools for Dart in Atom
MIT License
23 stars 3 forks source link

automatically locate the SDK #60

Closed devoncarew closed 9 years ago

devoncarew commented 9 years ago

This would be nice to have. Many people installing dart-tools will already have an SDK installed. It'll mean they have one fewer setup steps to do dart development.

Here's a technique I've used for other tooling. locating the VM:

Once you have the vm, you want to find the sdk. Tools like brew install the vm in a symlinked dir, so you want to resolve the vm if it's a symlink, and then go up one dir.

@radicaled @lukechurch

devoncarew commented 9 years ago

This package might simplify things: https://www.npmjs.com/package/which.

radicaled commented 9 years ago

This is what the package originally did. There was a problem with it at the time, which is why I switched to an explicit directory setting, but I'm not sure what the problem was now. I think it had something to do with locating SDK-related files.

Let me look through the git logs and see what the issue was and if it's still a problem.

radicaled commented 9 years ago

Looks like I wasn't able to determine symlinkyness in order to find the SDK in the old code.

I don't think it's impossible, I just didn't care that much at the time, I think.

devoncarew commented 9 years ago

which is why I switched to an explicit directory setting

I think an explicit setting is a great idea - it lets the user override or correct an auto-discovered SDK. Auto-discovery will help smooth over the initial setup / getting started process.

tosh commented 9 years ago

This would really rock. It was a challenge for me to set up in IntelliJ, Atom and Sublime as I was not sure what path was expected for the 'sdk' and in all cases the error messages weren't very helpful. Auto-discovery could avoid unnecessary frustration.

sethladd commented 9 years ago

FWIW the sublime plugin continues to ask the user for an explicit SDK directory. auto-discovery was challenging. If you come up with a good auto-discovery scheme, we'd like to use it in the Sublime plugin, too.