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

Correct automatic module name of pioneer #251

Closed
Bukama opened this issue May 1, 2020 · 4 comments
Closed

Correct automatic module name of pioneer #251

Bukama opened this issue May 1, 2020 · 4 comments
Assignees

Comments

@Bukama
Copy link
Member

Bukama commented May 1, 2020

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 :)

nipafx: @matthias / Bukama / bish Can you open a bishue about the automatic module name?

@nipafx
Copy link
Member

nipafx commented May 2, 2020

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 org.junitpioneer.foo as a subpackage of org.junitpioneer.

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?

@nipafx
Copy link
Member

nipafx commented May 2, 2020

Module and package names are drafted with the same process: Take a domain (example.org) and reverse it (-> org.example for modules, org.example for packages). Package names are then often extended to appear as a deeper hierarchy (-> org.example.foo), which makes the module name a prefix of the package name.

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 org.junitpioneer.xp as a prefix?

@Bukama
Copy link
Member Author

Bukama commented May 2, 2020

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:
org.junitpioneer.<missing projectname.>jupiter (replace jupiter with vintage for Junit 4 stuff).

So we are missing that part in my opinion and I'm fine with just calling it xp. But then we should rename the packages inside the project too.

@nipafx
Copy link
Member

nipafx commented May 2, 2020

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:

  1. Ignore the hierarchical module name "problem" and keep everything as is.
  2. Acknowledge that the project is called XP and rename all the things to (org.)junit(-)pioneer(.|/)xp
  3. Try some mix of junit-pioneer/xp on GitHub and in module/package name(s)

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.

@nipafx nipafx closed this as completed May 2, 2020
nipafx pushed a commit that referenced this issue Sep 26, 2020
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants