We have moved at community.getvera.com

Author Topic: What is the best way to iterate on a plugin?  (Read 1617 times)

Offline Richard

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
What is the best way to iterate on a plugin?
« on: July 17, 2011, 12:41:43 pm »
What is the best way to iterate on a plugin?
Right now my process is:

Make changes to plugin files.
Go to vera web page
Select MiOS developers->Luup Files
Upload file
Select restart luup after upload
press GO

I'd like a quicker way to iterate with less button presses.
Does anyone have a better way?

Thanks,
Richard

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
Re: What is the best way to iterate on a plugin?
« Reply #1 on: July 17, 2011, 05:41:49 pm »
What is the best way to iterate on a plugin?

In the end I always end up at the development loop that you describe.  I've got a couple of ways of speeding up the earlier stages, though.

Check the files for validity on a desktop.  Download a Lua interpreter for your Real Computer and run it on your plugin code.  It won't run, but it will show any syntax errors you might have.  Similarly, view the XML files in Firefox or some other XML-aware program, to catch any badly-formed XML.

I've also been known to use a Lua table dumper (http://lua-users.org/wiki/DataDumper is one) and luup.log() to show the values of variables during execution.  I just paste the code into my plugin to do my testing and then take it out again when I'm done.

If you're hoping for some kind of debugging environment, there isn't one.  Lua supposedly has one, but I couldn't even compile it for my desktop, much less cross-compile it to Vera.  Besides, Luup is a bit too real-time to be single-stepping through code.

Offline guessed

  • Community Beta
  • Master Member
  • ******
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: What is the best way to iterate on a plugin?
« Reply #2 on: July 17, 2011, 06:19:20 pm »
Also, you can write scripts on the machine where you're developing that can "copy over" (and then compress) the files you're working on.  This avoids the need to use the UI to upload each file.

I use a Mac, so there are two scripts, the first is a series of SCP commands to copy the stuff over, including copying another script that will compress the files on Vera, the second "executes" the compression script (directly on Vera).

The result is that you only have to force Vera to reload them, and you're done.

Offline Richard

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Re: What is the best way to iterate on a plugin?
« Reply #3 on: July 18, 2011, 12:46:49 am »
Thanks for the tips!