NeuronRobotics / nrjavaserial

A Java Serial Port system. This is a fork of the RXTX project that uses in jar loading of the native code.
Other
345 stars 143 forks source link

Update OSGi manifest generation (#158) #162

Closed fwolter closed 4 years ago

fwolter commented 4 years ago

The manifest looks more complete, now. @wborn can you test it with OpenHAB?

madhephaestus commented 4 years ago

i just pushed the latest binaries, you should be able to pull and try this locally with just a java build

madhephaestus commented 4 years ago

It looks like you will need to drop the Java 7 build in order to add OSGI

madhephaestus commented 4 years ago

I ran this and it produce a manafest with some strange line breaks in the manifest:

Manifest-Version: 1.0
Bnd-LastModified: 1586370308540
Bundle-ManifestVersion: 2
Bundle-Name: nrjavaserial
Bundle-SymbolicName: nrjavaserial
Bundle-Version: 3.18.0
Created-By: 11.0.6 (Ubuntu)
Implementation-Title: nrjavaserial
Implementation-Vendor: Commonwealth Robotics Cooperative
Implementation-Version: 3.18.0
Import-Package: com.sun.jna.platform.win32;resolution:=optional,org.ap
 ache.commons.net.telnet;resolution:=optional;version="[3.3,4)"
Private-Package: com.neuronrobotics.nrjavaserial,gnu.io,gnu.io.factory
 ,gnu.io.rfc2217,native.freebsd.x86_32,native.freebsd.x86_64,native.li
 nux.ARM_32,native.linux.ARM_64,native.linux.PPC,native.linux.x86_32,n
 ative.linux.x86_64,native.osx,native.windows.x86_32,native.windows.x8
 6_64
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))"
Specification-Title: nrjavaserial
Specification-Vendor: Commonwealth Robotics Cooperative
Specification-Version: 3.18.0
Tool: Bnd-5.0.1.202003231327
wborn commented 4 years ago

Thanks for working on this! I'll give it a test with openHAB.

According to the spec lines in manifests should be wrapped at 72 bytes:

https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html

No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).

madhephaestus commented 4 years ago

Here is a snapshot to test. I wonder is that funky looking manifest is even a problem at all...

nrjavaserial-3.18.0.zip

wborn commented 4 years ago

It didn't work, but after adding an Export-Package line it does work! :+1: See these changes: https://github.com/fwolter/nrjavaserial/pull/1