austinbv/dino

Make auto upload work on Windows and Linux

Closed this issue · 0 comments

There are a some simple fixes that we should make before 0.12. I'm creating a separate issue for each one. If you can solve any of these problems and want to contribute, read the explanation of the problem and submit a pull request (against 0.12.0-wip branch) in response to the relevant issue.

Make auto upload work on Windows and Linux

As of Arduino IDE 1.5.2, you can compile and upload for any type of board using the command line. The dino CLI tries to take advantage of this. You can pass the --upload option to upload the code to after compiling.

It compiles for the last type of board you set in the IDE, and uploads to the last serial port used in the IDE. But right now it only works on Macs

DinoCLI::Uploader#executable is responsible for finding the Java executable to use. It's uncommon for the executable to be anywhere besides under /Applications on a Mac, so that's simple, but it can vary for Windows and Linux.

The "standard" paths for Windows (and if there is one for Linux) should be added in with the appropriate checks on RUBY_PLATFORM. Also, if the CLI can't find the Java executable, or a version lower than 1.5.2 is found, it should fail with an error suggesting you open the sketch in the IDE. Or perhaps we could add an option to the CLI to specify the path to the Java executable?