Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automatic module name #103

Open
overheadhunter opened this issue Jul 1, 2020 · 2 comments
Open

Add automatic module name #103

overheadhunter opened this issue Jul 1, 2020 · 2 comments

Comments

@overheadhunter
Copy link
Contributor

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
Copy link
Owner

SerCeMan commented Jul 5, 2020

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants