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

build: define dependencies in version catalog #17

Merged
merged 1 commit into from
Oct 19, 2024

Conversation

mervyn-mccreight
Copy link
Collaborator

@mervyn-mccreight mervyn-mccreight commented Oct 19, 2024

The version catalog is a Gradle standard feature to define dependency versions in a single source in multi-module projects.

Using a standard features has two major benefits:

  • Easier to understand for contributors
  • Tooling support (e.g. for automating dependency updates)

Also remove unused third party dependencies from kgraphql-ktor.

@mervyn-mccreight mervyn-mccreight changed the title Define dependencies in version catalog chore: define dependencies in version catalog Oct 19, 2024

[libraries]
kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
dokkatoo-gradle = { module = "dev.adamko.dokkatoo:dokkatoo-plugin", version = "2.4.0" }
Copy link
Owner

Choose a reason for hiding this comment

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

Out of interest: Why not define all version numbers in the [versions] section?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You could, but in general I tend only to do this if several dependencies share a common version, to force having them synced versions.

To me this is one layer of indirection more. When I want to see the current version of a dependency I have to do one look more to see the actual version when using version references.
I favor seeing what I want to see as easy as possible, so I try to use version references only when there is a need to do so.

But that's just personal preference I guess, the format itself allows doing what you asked for and I can't find any official recommendations.

junit-jupiter-params = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit-jupiter" }
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }

#region kgraphql-example
Copy link
Owner

Choose a reason for hiding this comment

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

Would it make sense to separate test dependencies as well?

@mervyn-mccreight mervyn-mccreight changed the title chore: define dependencies in version catalog build: define dependencies in version catalog Oct 19, 2024
kotlinx-coroutines = "1.9.0"
kotlinx-serialization = "1.7.3"
jackson = "2.18.0"
ktor = "2.3.12"

Choose a reason for hiding this comment

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

We could try to use ktor 3.0.0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah 👍 I'll do updates in separate PRs

@mervyn-mccreight mervyn-mccreight merged commit f15b4e5 into main Oct 19, 2024
3 checks passed
@mervyn-mccreight mervyn-mccreight deleted the chore/use-version-catalog branch October 19, 2024 14:54
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