SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)
MIT License
363 stars 86 forks source link

Add automatic module name #103

Open overheadhunter opened 4 years ago

overheadhunter commented 4 years ago

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/

SerCeMan commented 4 years ago

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.

overheadhunter commented 4 years ago

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.