-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Gradle modernization #1642
base: gradle
Are you sure you want to change the base?
Gradle modernization #1642
Conversation
0144d6e
to
aeda926
Compare
1ca551a
to
d80ee10
Compare
5fa97ac
to
3f03dbd
Compare
Added library conventions and language based configurations. - Added `doclets` to `buildSrc` for the `javadocs` - Added `conventions` to centralize configuration of gradle plugins - Added `projects` to handle project level conventions JAVA-5758 JAVA-5757
Added library conventions and language based configurations. - Updated to Gradle 8 (JAVA-5756) - Removed `util:taglets` as now in `buildSrc`. - Moved `util:spock` into `driver-core` as the annotation is now shared via `testArtifacts`. - Added optional support (JAVA-5757) JAVA-5756 JAVA-5758 JAVA-5757
Added library conventions and language based configurations. - Refactored `JsonPoweredTestHelper` to handle either local and jar sources - Refactored test cases to use new `JsonPoweredTestHelper.getTestDocuments` method - Refactored test cases to normalize usage of loading test data - Moved scala integration tests into a standardized `integerationTest` directory JAVA-5758
Testing builds between
|
Env & task | main | JAVA-5758 | Findings | |
---|---|---|---|---|
latest Sharded Cluster Auth SSL JDK8 Linux test-core | 4718 | 4776 | ⬆️ | Unknown: Possibly getData helper fetching more tests? - diff of logs wasn't instructive |
latest Sharded Cluster Auth SSL JDK8 Linux test-legacy | 1033 | 1033 | ||
latest Sharded Cluster Auth SSL JDK8 Linux test-reactive | 3218 | 3218 | ||
latest Sharded Cluster Auth SSL JDK8 Linux test-sync | 4454 | 4460 | ⬆️ | |
Load Balancer latest Auth SSL JDK21 Ubuntu | 1826 | 1826 | ||
Scala 2.13 JDK17 7.0 Replica Set Ubuntu | 944 | 944 | ||
Kotlin: JDK17 7.0 Replica Set Ubuntu | 1314 | 1227 | ⬇️ |
Now Fixed - Kotlin extensions had the wrong junit library |
JDK8 Linux Unit test bson and crypt | 3813 | 3813 |
Source Main: Evergreen main build
Source PR: Evergreen patch build
Issues found and fixed by this testing
- Scala language dependencies updated to
api
fromimplementation
to keep the poms the same. slf4j
dependencies updated tooptionalAPI
fromoptionalImplementation
to keep poms the same.- bson-kotlinx dependencies for datetime and json serialization updated to
optionalAPI
fromoptionalImplementation
to keep poms the same. - Fixed various mainfest attributes as they differed from previous versions
- Fixed driver-kotlin-extensions testing and updated kotlin junit dependency in libs.versions.toml to use junit5.
"BOM must not contain <scope> elements in dependency:\n$destination" | ||
} | ||
assert(it.getNode("optional") == null) { | ||
"BOM must not contain <scope> elements in dependency:\n$destination" |
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.
should be "BOM must not contain <optional>
elements ..."?
It was intentional that driver-legacy doesn't have a manifest (and also can never be a Java module). The reason is that OSGi requires that Java packages are segregated between modules, i.e. you can't have more than module containing types in the same Java package. And for various reasons, we were forced to do that with driver-legacy, as there are types in both core and legacy in the "com.mongodb" package (and same for "org.bson" in the bson module. Is there a straightforward way to exclude the manifest for driver-legacy? I know there is at least one place where our module names are referenced in buildSrc. Maybe this is another one? |
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.
I haven't reviewed the buildSrc directory yet.
} | ||
|
||
/* | ||
* Validate the Bom file. |
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.
* Validate the Bom file. | |
* Validate the BOM file. |
* Modify the generated POM to include all supported versions of Scala for driver-scala or bson-scala. | ||
*/ | ||
configureMavenPublication { | ||
components.findByName("javaPlatform")?.let { from(it) } |
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.
What does this do?
|
||
@RunWith(classOf[JUnitRunner]) |
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.
Why is this no longer needed?
@@ -0,0 +1,38 @@ | |||
/* |
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.
I don't see a deleted build.gradle
in this directory, but it's not in the source either. Where did it get deleted?
@@ -18,7 +18,7 @@ | |||
import org.slf4j.Logger; | |||
import org.slf4j.LoggerFactory; | |||
|
|||
import javax.annotation.Nullable; | |||
import org.jetbrains.annotations.Nullable; |
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.
Why do we need the jetbrains one? I didn't know we depended on an artifact that contains this annotation?
|
||
configurations[integrationTest.implementationConfigurationName].extendsFrom(configurations.testImplementation.get()) | ||
|
||
configurations[integrationTest.runtimeOnlyConfigurationName].extendsFrom(configurations.testRuntimeOnly.get()) |
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.
If you are tired of "integrationTestImplementation"(...)
, you might well replace the above two statements with
val integrationTestImplementation: Configuration by
configurations.getting { extendsFrom(configurations.implementation.get()) }
val integrationTestRuntimeOnly: Configuration by
configurations.getting { extendsFrom(configurations.runtimeOnly.get()) }
then you can use integrationTestImplementation(...)
directly
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.
nvm. Further more configs are required. maybe not worth while.
This PR comprises of 3 separate commits for the purpose of aiding reviewability.
The commits themselves aren't designed to be standalone (they are not) but rather compose separate areas of work that updating the build has required.