Skip to content

Conversation

@fzhinkin
Copy link
Contributor

Fixes #2901

*/
fun Project.configureMetadataJarAutomaticModuleName() {
val kotlin = extensions.findByType<KotlinMultiplatformExtension>() ?: return
val moduleName = project.name.replace('-', '.') + ".artifact_disambiguating_module"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: Manifest lines are supposed to be 72 chars in length

No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).
https://docs.oracle.com/en/java/javase/25/docs/specs/jar/jar.html

So this gets automatically wrapped to next line:

Manifest-Version: 1.0
Automatic-Module-Name: kotlinx.serialization.core.artifact_disambiguatin
  g_module

While it shouldn't cause any problems, we may want to choose a shorter name to look a bit nicer. WDYT of common_artifact suffix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked the same name we agreed to use for coroutines for consistency.

I'm not sure if we should pursue shorter name here, as nobody is expected to import that module. And I hope not so many people have to read manifest files bundled in third-party libraries (to enjoy nice name :)).

If you prefer a shorter name, than kotlin_metadata or just metadata might be a better option compared to common_artifact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's stick to kotlinx.coroutines name then

@sandwwraith sandwwraith merged commit ca11219 into dev Nov 13, 2025
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants