jnr-fuse icon indicating copy to clipboard operation
jnr-fuse copied to clipboard

Add automatic module name

Open overheadhunter opened this issue 4 years ago • 2 comments

When using jnr-fuse in projects using the JPMS, the module name is derived from the jar file, which doesn't exactly lead to reliable builds.

Even without migrating to JPMS, libraries can easily become somewhat JPMS-compatible (at least if not sharing packages with other modules, see #102) by adding an automatic module name to the jar file:

With Gradle, you can configure the jar plugin as follows:

ext.moduleName = "com.acme.mylibrary"

jar {
    inputs.property("moduleName", moduleName)

    manifest {
       attributes  'Automatic-Module-Name': moduleName
   }
}```

Source: http://branchandbound.net/blog/java/2017/12/automatic-module-name/

overheadhunter avatar Jul 01 '20 14:07 overheadhunter

Hey, @overheadhunter! I believe for JPMS to work correctly, we'll need to find an alternative for this class, https://github.com/SerCeMan/jnr-fuse/blob/master/src/main/java/jnr/ffi/provider/jffi/ClosureHelper.java, as it's currently, iirc, requires to be in the jnr package.

SerCeMan avatar Jul 05 '20 01:07 SerCeMan

requires to be in the jnr package

Due to package-private access to classes in upstream dependency? Maybe, if it is a good idea to extend those classes, the jffi-people should then widen the scope? Or maybe this utility can be added upstream?

Anyway it seems like this blocks any short-term solution.

overheadhunter avatar Jul 06 '20 06:07 overheadhunter