-
Notifications
You must be signed in to change notification settings - Fork 13
Make mongo-hibernate.jar a Java module
#149
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
base: main
Are you sure you want to change the base?
Changes from all commits
8700010
7b850d2
047b90d
f88ef68
635160b
de745c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,20 +39,28 @@ java { | |
| } | ||
|
|
||
| tasks.withType<Javadoc> { | ||
| exclude("/com/mongodb/hibernate/internal/**") | ||
| exclude("com/mongodb/hibernate/dialect/**") | ||
| exclude("com/mongodb/hibernate/jdbc/**") | ||
|
|
||
| val standardDocletOptions = options as StandardJavadocDocletOptions | ||
| standardDocletOptions.apply { | ||
| addBooleanOption("Werror", false) | ||
| // TODO-HIBERNATE-129 addStringOption("-link-modularity-mismatch", "info") | ||
| addBooleanOption("serialwarn", true) | ||
| addBooleanOption("Xdoclint:all", true) | ||
| addBooleanOption( | ||
| "Xdoclint/package:-" + | ||
| "com.mongodb.hibernate.internal.*" + | ||
| ",com.mongodb.hibernate.dialect.*" + | ||
| ",com.mongodb.hibernate.jdbc.*", | ||
| true) | ||
| addStringOption("-show-module-contents", "api") | ||
| addStringOption("-show-packages", "exported") | ||
| addStringOption("-show-types", "protected") | ||
| author(true) | ||
| version(true) | ||
| encoding = "UTF-8" | ||
| encoding("UTF-8") | ||
| charSet("UTF-8") | ||
| docEncoding("UTF-8") | ||
| addBooleanOption("html5", true) | ||
| addBooleanOption("-allow-script-in-comments", true) | ||
| // TODO-HIBERNATE-129 addStringOption("-link-modularity-mismatch", "info") | ||
| links = | ||
| listOf( | ||
| "https://docs.oracle.com/en/java/javase/17/docs/api/", | ||
|
|
@@ -141,11 +149,15 @@ spotless { | |
| tasks.check { dependsOn(tasks.spotlessApply) } | ||
|
|
||
| tasks.withType<JavaCompile>().configureEach { | ||
| options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror")) | ||
| options.compilerArgs.addAll( | ||
| listOf("-Xlint:all", "-Xlint:-requires-automatic", "-Xlint:-requires-transitive-automatic", "-Werror")) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems fine to declare |
||
| when (this) { | ||
| tasks.compileJava.get() -> | ||
| options.errorprone { | ||
| disableWarningsInGeneratedCode = true | ||
| // Error Prone does not understand the `@hidden` standard tag | ||
| disable("InvalidBlockTag") | ||
| disable("AssignmentExpression") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I upgraded the Error Prone, and it now has the |
||
| option("NullAway:AnnotatedPackages", "com.mongodb.hibernate") | ||
| error("NullAway") | ||
| } | ||
|
|
@@ -159,6 +171,8 @@ tasks.withType<JavaCompile>().configureEach { | |
| buildConfig { | ||
| useJavaOutput() | ||
| packageName("com.mongodb.hibernate.internal") | ||
| documentation.set( | ||
| "Generated by the <a href=\"https://github.com/gmazzo/gradle-buildconfig-plugin\">BuildConfig</a> plugin.\n\n@hidden") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I failed to exclude out generated code using |
||
| buildConfigField("NAME", provider { project.name }) | ||
| buildConfigField("VERSION", provider { "${project.version}" }) | ||
| } | ||
|
|
@@ -205,6 +219,9 @@ publishing { | |
| repositories { | ||
| // publish to local build dir for testing | ||
| // `./gradlew publishMavenPublicationToLocalBuildRepository` | ||
| // | ||
| // publish to the local Maven cache | ||
| // `./gradlew publishToMavenLocal` | ||
| maven { | ||
| url = uri(localBuildRepo.get()) | ||
| name = "LocalBuild" | ||
|
|
@@ -222,8 +239,8 @@ publishing { | |
| url = "https://www.mongodb.com/" | ||
| licenses { | ||
| license { | ||
| name = "The Apache License, Version 2.0" | ||
| url = "http://www.apache.org/licenses/LICENSE-2.0.txt" | ||
| name = "Apache License, Version 2.0" | ||
| url = "https://www.apache.org/licenses/LICENSE-2.0" | ||
| } | ||
| } | ||
| developers { | ||
|
|
@@ -234,8 +251,8 @@ publishing { | |
| } | ||
| scm { | ||
| url.set("https://github.com/mongodb/mongo-hibernate") | ||
| connection.set("scm:https://github.com/mongodb/mongo-hibernate.git") | ||
| developerConnection.set("scm:https://github.com/mongodb/mongo-hibernate.git") | ||
| connection.set("scm:git:https://github.com/mongodb/mongo-hibernate.git") | ||
| developerConnection.set("scm:git:https://github.com/mongodb/mongo-hibernate.git") | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The format is |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -337,3 +354,6 @@ tasks.register("publishArchives") { | |
| dependsOn(tasks.named("publishToSonatype")) | ||
| } | ||
| } | ||
|
|
||
| // `./gradlew -q printProjectVersion` | ||
| tasks.register("printProjectVersion") { doLast { logger.quiet(project.version.toString()) } } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Copyright 2025-present MongoDB, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| wrapperVersion=3.3.4 | ||
| distributionType=only-script | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/4.0.0-rc-5/apache-maven-4.0.0-rc-5-bin.zip |
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.
We can't enable
-Werrorbecause of the single warning we have that can only be disabled in Java SE 18+.