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
Correct automatic module name of pioneer #251
Comments
Thanks for creating the issue. Just like packages, module names can't contain dashes, so org.junit-pioneer is out of the question. But I wonder whether it should be org.junitpioneer.xp (xp = extension pack). Because otherwise, if Pioneer launches other projects, their module name (e.g. org.junitpioneer.foo) would make it appear as if there's a super/sub relationship between these modules (just like people think of On the other hand, with xp, the module name would no longer be a prefix of the package name (not at all required, but a good practice and nice touch) and the internal moniker xp would leak into the public. Opinions? |
Module and package names are drafted with the same process: Take a domain (example.org) and reverse it (-> org.example for modules, That is not required at all by the module system, but it's aesthetically pleasing and if the module name were markedly different from the "top-level package" (no such thing in real life) than that's odd. Why is one so different from the other? In this case, if the module is called org.junitpioneer.xp, shouldn't then all packages have |
Let's assume pioneer would have been a modularized project, next to others like the site. Then we would need an identifier for the project anyway. Let's take a view from the GitHub page: organisation is "(org.)junit-pioneer" project is "junit-pioneer". So there's some type of duplication, but well you could say because we don't have a name for the extension pack project: Our package-names represent this too: So we are missing that part in my opinion and I'm fine with just calling it |
Pointing to GitHub is a good idea. If we'd go with xp as the project name, it should then also be junit-pioneer/xp on GH, right? Eh... Three options:
All of this seems more hassle than it's worth and I'm arguing for 1. If anybody strongly disagrees and makes a good point, I will reopen. |
This change adds a module descriptor (`module-info.class`) to the extension pack artifact to support modular projects. Because we want to continue building our project against Java 8, `module-info.java` is not placed into `src/main/java` and compiled with the rest of the sources. Instead, it is placed into its own directory `src/main/module`. Because Gradle does not support building on Java 8 and adding a predefined module descriptor (Gradle only supports full modular builds with the module declaration in `src/main/java`, which would require to build with Java 9+), we use [moditect](https://github.com/moditect/moditect). The module name was picked as decided in #251 and (formerly) enshrined as automatic module name in `MANIFEST.MF` - that was removed now. This change also removes JUnit internal classes from some extensions (e.g. the class `Preconditions`) or replaces internal classes with their public counterpart (e.g. `AnnotationUtils`). This ensures that a modular project can use the extension pack without illegal access errors at run time. closes #314 relates to #251 PR: #326
As of now the following entry inside the
MANIFEST
is created:"Automatic-Module-Name" to "org.junitpioneer"
But URL is
https://junit-pioneer.org/
Maybe @nicolaiparlog wants to add further information as in Discord he only asked to open an bishue about the topic :)
The text was updated successfully, but these errors were encountered: