[quote=“lolodomo, post:1, topic:186724”]I strictly followed the wiki page: IDE Setup · openhab/openhab1-addons Wiki · GitHub
and I was able to build openHAB and run it on my Windows 7 PC. 8)[/quote]
Congrats, that can be a significant step on it’s own (seriously, I’m not joking)
A probable stupid question: my Git clone from https://github.com/openhab/openhab gives me what version ? The up-to-date version with all the last commits ?
It’s a 1.7 SNAPSHOT rev. Your commits always go first to your clone’s working-branch, but “openhab/openhab” is presently representing the latest, or 1.7.0. When you commit, submit a PR and have it approved, that’s where it’ll be pulled into. If they need your changes in another of their branches, they’ll [mostly] pull/merge your PR.
Anyhow, you’ll have everything that’s gone through PR and been approved if you use their openhab/openhab line (no branch)
As always, once you clone, create a branch-off-that-clone for each thing you work on. It’s fairly easy to get yourself in a mess otherwise, esp once you need to work on multiple “unrelated” things concurrently (and, for PR’s, it’s best to keep changes small and localized)
Then in Eclipse I exported the mios project to a jar file (I used the default options in Eclipse UI). Then I copied this new jar in my RPI naming the file something like org.openhab.binding.mios-1.7.0-lolodomo.jar. Finally I started openHAB. Mios binding seems to be run (I see traces relative to my Vera devices). Unfortunately, the Mios binding is no more working well (light switch not working).
So what's wrong and what the proper way to build a new JAR file for a binding ?
I’m still building from the CLI, directly with mvn. I use Eclipse only as a fancy editor for search/replace refactor and a few other things that operate at that layer. When using mvn, I just build my Binding’s target (most of the time) to keep the overall process fast. I’ll only rebuild from root if I do a major refresh (which is uncommon)
When building with the CLI, you’ll have the Binding’s “target” directory. In this directory is the built product. In the case of MiOS, it’ll [currently] be [tt]org.openhab.binding.mios-1.7.0-SNAPSHOT.jar[/tt].
Really, it can be any name when you copy it to your Addons folder, but make sure that you’re not running “two” of the same functionality (eg a-mios-x.jar and a-mios-y.jar) since BOTH will be started by the OSGi Container. Don’t even keep them “renamed” in the same folder, or in a Sub-folder, as bad things happen (even without the .jar extension)
To produce a binary zip yourself from your code, you can simply call mvn clean install from the repository root and you will find the results in the folder distribution/target (you will of course need a Maven 3.0 installation as a prerequisite).
Do I have to use Maven ? Is Maven already installed and setup in Eclipse (Yoxos packaging) ? How to run a Maven command line with a Windows PC ? Through a terminal window ?
Kinda. It’s co-ordinating the build, and there are a bunch of items that “depend” upon it in that overall process. At this stage, I can’t imagine not using mvn to do this, since the rework would be extensive.
PS: That Yoxos thing is going to have to change, no idea what that change will actually look like, but they made some announcements about the Yoxos repo recently.
I will rebuild my env for OSH2, and will likely build a VirtualBox to run that, then I’ll have a “host-neutral” install option, which will be handy for a few different things… least of which is a better install (hopefully)