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

Add explicit automatic module name configuration. #1232

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

vbabanin
Copy link
Member

@vbabanin vbabanin commented Oct 24, 2023

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
driver-scala/build.gradle Outdated Show resolved Hide resolved
bson-scala/build.gradle Outdated Show resolved Hide resolved
@jyemin
Copy link
Contributor

jyemin commented Oct 24, 2023

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
Copy link
Contributor

jyemin commented Oct 24, 2023

Static checks are failing.

@vbabanin
Copy link
Member Author

vbabanin commented Oct 25, 2023

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
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jyemin jyemin left a comment

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
56 checks passed
@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
3 participants