Skip to content

Add explicit automatic module name configuration.#1232

Merged
vbabanin merged 3 commits into
mongodb:masterfrom
vbabanin:JAVA-5213
Oct 26, 2023
Merged

Add explicit automatic module name configuration.#1232
vbabanin merged 3 commits into
mongodb:masterfrom
vbabanin:JAVA-5213

Conversation

@vbabanin

@vbabanin vbabanin commented Oct 24, 2023

Copy link
Copy Markdown
Member

Description :

Some modules rely on the publish.gradle file to generate the Automatic Module Name in the manifest, based on the groupName and archivesBaseName of the project. However, the archivesName contains hyphens that are not valid according to the Java Language Specification.

As a result, all Automatic Module Names are now explicitly specified in each build.gradle file:

org.mongodb.mongodb-driver-kotlin-coroutine is renamed to org.mongodb.driver.kotlin.coroutine
org.mongodb.mongodb-driver-kotlin-sync is renamed to org.mongodb.driver.kotlin.sync
org.mongodb.bson-kotlin is renamed to org.mongodb.bson.kotlin
org.mongodb.bson-kotlinx is renamed to org.mongodb.bson.kotlinx
org.mongodb.mongo-scala-driver is renamed to org.mongodb.driver.scala
org.mongodb.mongo-scala-bson is renamed to org.mongodb.bson.scala

JAVA-5213
JAVA-5202

@vbabanin vbabanin requested a review from rozza October 24, 2023 21:50
Comment thread driver-scala/build.gradle Outdated
Comment thread bson-scala/build.gradle Outdated
@jyemin

jyemin commented Oct 24, 2023

Copy link
Copy Markdown
Collaborator

Should we remove Automatic-Module-Name configuration from publish.gradle entirely since it's rarely correct (bson is the only module without a hyphen, and driver-legacy should not have a module name)?

@jyemin

jyemin commented Oct 24, 2023

Copy link
Copy Markdown
Collaborator

Static checks are failing.

@vbabanin

vbabanin commented Oct 25, 2023

Copy link
Copy Markdown
Member Author

Should we remove Automatic-Module-Name configuration from publish.gradle entirely since it's rarely correct (bson is the only module without a hyphen, and driver-legacy should not have a module name)?

Agree, I've removed the Automatic-Module-Name configuration from publish.gradle, as it indeed seems unnecessary. Thank you!
With explicit naming in each build.gradle, it might be worth considering adding a validation check in publish.gradle after projects evaluation stage to ensure Automatic-Module-Name's are correctly specified and not overlooked if we have added a new module.

@vbabanin vbabanin requested a review from jyemin October 25, 2023 05:34

@rozza rozza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jyemin jyemin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@vbabanin vbabanin merged commit aa4c0f1 into mongodb:master Oct 26, 2023
@vbabanin vbabanin deleted the JAVA-5213 branch October 26, 2023 07:44
vbabanin added a commit to vbabanin/mongo-java-driver that referenced this pull request Oct 27, 2023
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