I started experimenting with Scala, sbt, and Visual Studio + Metals. I’m wondering how to import the JRule classes. Should I clone the JRule source code into my code and import the classes wherever required, or should I somehow add the Jar to my /lib folder?
I don’t see any Jar provided in GitHub.
Connected to the previous doubt, I’m also wondering if when compiling the Uber Jar I should also include the JRule libraries (as if they were part of my code) or if there is no need and the ones installed in OH by the add-on should be used.
The compiler complains that generated is not a member of jrule, even though I deployed jrule-generated.jar to the dependencies folder (/lib), just like jrule.jar and openhab-core.jar.
I can find all the members of the other 2 jars, but not the ones of jrule-generated.jar. The file has 177 KB
I decompiled the jrule-generated.jar and found that the package conformed to org.openhab.automation.jrule.generate.xxxx, so I deleted all the caches in the project, imported the project again into Visual Studio Code, and the jar was recognized.
There are just two minor things left that I think I can sort out by testing:
The from and to arguments expect a String and the compiler complains when I pass the JRuleOnOffValue.ON/OFF values, so I hope they just work by passing “ON” or “OFF”