gs1 / gs1-syntax-engine

GS1 Syntax Engine
Apache License 2.0
27 stars 5 forks source link

Java wrapper: Create multi-architecture JAR distributed via Maven Central #7

Open terryburton opened 4 months ago

terryburton commented 4 months ago

Housekeeping to capture discussion that occurred in PR#4 as a separate issue to allow that PR to be closed...

2024/04/09: @terryburton

The major decision to be made is whether to publish a Java and/or Android library, and where to. My intent so far has been to release a Java library package consisting of a single multi-architecture JAR published on Maven Central. The reasoning is that this benefits all Java developers and if there is no Android app specific helper code in the library then there is little point in also creating and maintaining an Android library — but I'm happy to be educated if this analysis is lacking.

(Because the library is based on native C code, it must be compiled for each of the common target architectures, e.g. x64, x86, arm, arm64. Creating multi-architecture Java library packages is challenging, but there are projects that appear to do this successfully, e.g. https://github.com/OddSource/ifaddrs4u/tree/main/ifaddrs4j)

2024/04/18: @vinaygopinath

... I'm on board with your proposal of publishing a JAR accessible from Maven Central purely to parse the scanned string, leaving the task of scanning codes to the application developer.

2024/04/19: @terryburton

Thank you for taking the time to consider the approach that I outlined concerning the multi-architecture JAR. I conducted some brief testing, but I have had to set things aside for now because of the amount of effort involved. It may be prioritised in the future as a result of community feedback such as what you have provided.

Building the multi-architecture JAR:

How the JAR would work:

Considerations for Android:

That's a lot of steps to put in order and there is still some risk of something critical not working out as intended, so the idea is shelved for now...

Of course if anyone would like to have a go at the above then this will be welcome.