Skip to content

Improve gradle#234

Merged
UserNugget merged 5 commits intoElytrium:masterfrom
makeevrserg:improve-gradle
Mar 28, 2026
Merged

Improve gradle#234
UserNugget merged 5 commits intoElytrium:masterfrom
makeevrserg:improve-gradle

Conversation

@makeevrserg
Copy link
Copy Markdown
Contributor

Summary

Migrate Gradle build scripts to Kotlin DSL with a version catalog.

Changes

No functional changes. Build outputs are identical

1. .gradle converted into .gradle.kts (except /plugin/build.gradle)

  • IDE now provides auto-completion, click-to-navigate, and compile-time error checking for build scripts.
  • Groovy scripts are dynamically typed. A typo compiles fine and crashes at a runtime

2. Added version catalog libs.versions.toml

  • All dependency versions in one file
  • libs.minecraft.velocity.api instead of "com.velocitypowered:velocity-api:$velocityVersion"
  • Typo in the old way == silent empty string
  • Typo in the new way == compile error

3. Type-safe project accessors

  • projects.api instead of project(":api")
  • Rename a module and the build fails immediately, not at runtime

Comment thread api/build.gradle.kts
Comment thread build.gradle.kts Outdated

tasks.withType<SpotBugsTask> {
if (project == rootProject) return@withType
reports.register("html") {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No longer builds, see this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Something went wrong after rebase on newly merged PRs, fixed it

@UserNugget UserNugget merged commit 74424b4 into Elytrium:master Mar 28, 2026
1 check passed
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