Import JRuby extension
This follows the model of the Psych library, but keeps all JRuby-specific code under ext/java including the lib/zlib.rb loading stub and lib/zlib/versions.rb which contains the version string for the jzlib library we use.
The jzlib library is installed and loaded via jar_dependencies in the same way that snakeyaml-engine is installed and loaded for Psych.
This is based on the JRuby 10 version of code and as such only supports JRuby 10+ and Java 21+. JRuby 9.4 would not be able to use this gem, but it does not support loading zlib from a gem in any case.
Because of the odd way the build matrix is set up, I added a separate job to test on JRuby. It is not green, but the failures reflect the same zlib test excludes we have in the JRuby repository.
Fixes #38.
This turned out to be easier than expected. There's a couple open questions:
- How to handle the failures?
These failures are known and excluded in JRuby's suite. I can make an effort to fix some of them, but others may be hard-to-fix incompatibilities with the jzlib library we use and maintain. Anything we can't or won't fix will need an exclude of some kind, which could perhaps just be a skip in the test?
- Is this CI ok?
I introduced a new job for the JRuby build since it can be tested once and it won't matter what platform it is run on. The other job has multiple combinations of platform and Ruby implementation.
How to handle the failures? which could perhaps just be a skip in the test?
I'm +1 to that.
Is this CI ok?
It's okay at the initial step. we can add CI like windows + jruby + build artifact in the future.