Skip to content

Bump dependencies, introduce BomsPlugin #44

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

Merged
merged 34 commits into from
Apr 30, 2025
Merged

Conversation

alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Apr 29, 2025

This PR builds the base-types module with latest dependency versions via pulling the latest config.

The PR also initiates adoption of the Maven BOM mechanism for forcing the dependencies in a more consolidated and controllable way, which is described in the section below.

BomsPlugin

This PR introduces the io.spine.dependency.boms package under buildSrc. The package provides:

  • Boms — the object which lists major platforms that we use.
  • BomsPlugin — a Gradle project plugin which enforces the versions of Boms platforms in a project to which it is applied.

Other notable changes

  • Kotlin dependency object got StdLib nested object to simplify forcing the stdlib artifacts.
  • Protobuf bumped to 3.25.7, which is the latest version in the 3.x family.

... to include such things as `kotlinCompilerBlahBlahBlah`.
# Conflicts:
#	build.gradle.kts
#	buildSrc/src/main/kotlin/io/spine/dependency/boms/Boms.kt
#	buildSrc/src/main/kotlin/io/spine/dependency/boms/BomsPlugin.kt
#	buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt
#	buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt
#	buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt
#	buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt
#	buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt
#	buildSrc/src/main/kotlin/jvm-module.gradle.kts
#	buildSrc/src/main/kotlin/module-testing.gradle.kts
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.18%. Comparing base (030ce7d) to head (92bc50f).
Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #44   +/-   ##
=========================================
  Coverage     94.18%   94.18%           
  Complexity       76       76           
=========================================
  Files            13       13           
  Lines           275      275           
  Branches         26       26           
=========================================
  Hits            259      259           
  Misses           12       12           
  Partials          4        4           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Also:
 * Improve documentation.
 * Remove `Logging.lib` implementation dependency in `jvm-module`. Let each module decide by itself on this heavy dependency.
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review April 30, 2025 11:13
@alexander-yevsyukov alexander-yevsyukov self-assigned this Apr 30, 2025
@alexander-yevsyukov alexander-yevsyukov changed the title Bump base Bump dependencies, introduce BomsPlugin Apr 30, 2025
@alexander-yevsyukov
Copy link
Contributor Author

@armiol, we can probably rename the package to bumps instead, and the plugin alike... :)

Copy link
Contributor

@yevhenii-nadtochii yevhenii-nadtochii left a comment

Choose a reason for hiding this comment

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

LGTM with some comments to consider.

build.gradle.kts Outdated
Comment on lines 84 to 91
apply(plugin = "io.spine.mc-java")

apply<IncrementGuard>()
apply<VersionWriter>()

apply<BomsPlugin>()

apply(from = "$projectDir/version.gradle.kts")
Copy link
Contributor

Choose a reason for hiding this comment

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

They can be grouped:

apply { 
    plugin("io.spine.mc-java)
    plugin<IncrementGuard>()
    plugin<VersionWriter>()
    plugin<BomsPlugin>()
    from("$projectDir/version.gradle.kts")
}

Copy link
Contributor Author

@alexander-yevsyukov alexander-yevsyukov Apr 30, 2025

Choose a reason for hiding this comment

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

It can, but I'd rather not to. The order of applying the plugins and their semantics are a bit different. Also, plugin { id("blah") } and apply { plugin("blah") } work differently regarding DSL appearing in the build script.

With Gradle, it's usually "don't touch when it works". So, let's move with new things gradually.

build.gradle.kts Outdated
apply(plugin = "io.spine.mc-java")

apply<IncrementGuard>()
apply<VersionWriter>()

apply<BomsPlugin>()
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can go without Plugin suffix? Other local plugins don't use it.

It can be BonEnforcer or BomAlignment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an experiment in progress. It's not enforcing BOM already. Let's see how it goes and then select the name. We've got a lot of code around the dependencies.

There's Boms object, BTW. So, the plugin has to have the suffix.

Comment on lines +37 to +43
* This one should be forced in a project via:
*
* ```kotlin
* dependencies {
* testImplementation(enforcedPlatform(JUnit.bom))
* }
* ```
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably, this piece of docs is no longer relevant.

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've added the reference to BomsPlugin.

@alexander-yevsyukov alexander-yevsyukov added this pull request to the merge queue Apr 30, 2025
Merged via the queue into master with commit ddd5159 Apr 30, 2025
7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the bump-base branch April 30, 2025 13:47
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.

2 participants