-
Notifications
You must be signed in to change notification settings - Fork 884
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
Added Automatic-Module-Name header to MANIFEST.MF in instrumentation libraries #9140
Conversation
Wouldn't it make more sense to build the module name from gradle module name so you wouldn't need to manually add it? Perhaps use a similar logic to what the maven publishing process does, for example |
Module names should follow the pattern (to avoid conflicts with other modules):
Applying it
That gives you: Other examples (module names that share a prefix):
Providing the I do not see a problem putting the final module name today, once we got to an agreement (it should not be changed in the future). |
@@ -186,6 +186,9 @@ testing { | |||
} | |||
} | |||
|
|||
// module name | |||
val moduleName: String? by extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using extra
, can you add that to the OtelJavaExtension
? Also, consider naming it javaModuleName
or javaModule
to signify that it's the Java 9 module, not some arbitrary module name (e.g. gradle module).
the concern here is that it's a bit error prone, and we will need to remember to add this for all new modules that get added in the future it would be really nice if we could maybe add this generically, e.g. to |
…ntation libraries" This reverts commit 5a96981.
The Java module names are now auto-generated. |
I checked what these generated module names look like:
|
I think some flattening might be better, similar to what we've done for instrumentation scope names, e.g.
instead of
because it would be a bit more resilient to re-arrangements of the repository, since currently the directory structure is encoded into the module names (EDIT sorry for the half-baked comment, I'll try to think more about this and propose something more concrete) |
Hmm, we could just skip all the directories between |
I reworked the module name algorithm to remove redundant segments from the module name
|
@laurit thx! one more thought, instead of
what do you think of
similar to our maven groupId strategy: https://search.maven.org/search?q=apache-dbcp-2.0 (and we could skip non-published artifacts if that helps) |
Customized handling for
|
thanks @rjbaucells @laurit ❤️ |
This PR adds the
Automatic-Module-Name
header toMETA-INF/MANIFEST.MF
jar file in instrumentation libraries. (see #9124)