Skip to content

Migrate Gradle to Kotlin#3684

Open
duanemay wants to merge 5 commits into
developfrom
kotlin_gradle
Open

Migrate Gradle to Kotlin#3684
duanemay wants to merge 5 commits into
developfrom
kotlin_gradle

Conversation

@duanemay
Copy link
Copy Markdown
Member

@duanemay duanemay commented Nov 25, 2025

Expected Benefits

Developer Experience

  • Type Safety: Compile-time checking of build script syntax and API usage
  • IDE Support: Full autocomplete, refactoring
  • Error Detection: Build script errors caught before execution
  • Code Navigation: Jump to plugin/task definitions, find usages

Build Performance

  • Faster Builds: Kotlin DSL leverages compilation caching for build scripts
  • Better Incremental Builds: More precise dependency tracking

Maintainability

  • Modern Syntax: Align with current Gradle best practices
  • Consistent Style: Match Kotlin codebase conventions
  • Better Refactoring: IDE-assisted renames and restructuring
  • Documentation: Improved code completion shows parameter types and documentation

Team Productivity

  • Reduced Build Script Bugs: Type checking prevents common configuration errors
  • Easier Onboarding: IDE assistance helps new team members understand build logic
  • Standardization: Move toward industry standard (Kotlin DSL is Gradle's recommended approach)

The conversion will modernize the build system while maintaining all existing functionality and improving the development experience for the team.

@duanemay duanemay marked this pull request as ready for review June 4, 2026 20:58
Copilot AI review requested due to automatic review settings June 4, 2026 20:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the project’s Gradle build configuration from Groovy DSL (*.gradle) to Kotlin DSL (*.gradle.kts), while keeping module structure and key build tasks (WAR packaging, docs generation, unit/integration test wiring) aligned with the existing build behavior.

Changes:

  • Replaced Groovy build scripts with Kotlin DSL equivalents across root project and subprojects.
  • Moved Gradle plugin definitions to the version catalog’s [plugins] section and adopted alias(libs.plugins.*) usage in build scripts.
  • Refactored/ported various task configurations (test logging, docs generation, boot image settings, integration test startup/shutdown, etc.) into Kotlin DSL.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
build.gradle.kts New root Kotlin DSL build with shared repositories, dependency management, test logging/config, and utility tasks.
build.gradle Removed legacy root Groovy DSL build script.
settings.gradle.kts New Kotlin DSL settings including project includes and directory mappings.
settings.gradle Removed legacy Groovy DSL settings script.
gradle/libs.versions.toml Removed unused catalog entries and introduced [plugins] definitions for plugin aliases.
uaa/build.gradle.kts New Kotlin DSL build for UAA module including WAR/BootWar setup, docs tasks, boot image config, and integration test lifecycle.
uaa/build.gradle Removed legacy Groovy DSL build script for UAA.
server/build.gradle.kts Updated server module build script to Kotlin DSL plugin block + dependency/task syntax updates.
model/build.gradle.kts New Kotlin DSL build for model module including test-jar artifact publication and resource filtering.
model/build.gradle Removed legacy Groovy DSL build script for model module.
model/build_properties.gradle.kts New Kotlin DSL applied script to generate git/build properties during resource processing.
model/build_properties.gradle Removed legacy Groovy applied script for build/git properties.
metrics-data/build.gradle.kts New Kotlin DSL build for metrics-data module including resource filtering and test deps.
metrics-data/build.gradle Removed legacy Groovy DSL build script for metrics-data module.
statsd/build.gradle.kts New Kotlin DSL build for statsd WAR module (dependencies, test exclusions, disabled integrationTest/bootRun).
statsd/build.gradle Removed legacy Groovy DSL build script for statsd module.
statsd-lib/build.gradle.kts New Kotlin DSL build for statsd-lib module including test deps and integrationTest filtering.
statsd-lib/build.gradle Removed legacy Groovy DSL build script for statsd-lib module.

Comment thread uaa/build.gradle.kts
Comment on lines +268 to +269
logger.lifecycle("Killing UAA before auto-start")
rootProject.tasks.named("killUaa").get().actions.forEach { it.execute(rootProject.tasks.named("killUaa").get()) }
Comment thread uaa/build.gradle.kts
Comment on lines +305 to +307
logger.lifecycle("Killing UAA after failed auto-start")
rootProject.tasks.named("killUaa").get().actions.forEach { it.execute(rootProject.tasks.named("killUaa").get()) }
throw GradleException("UAA failed to start within $maxWaitSeconds seconds. Check ${bootLogFile.absolutePath}")
Comment thread uaa/build.gradle.kts
Comment on lines +315 to +317
logger.lifecycle("Stopping UAA application...")
rootProject.tasks.named("killUaa").get().actions.forEach { it.execute(rootProject.tasks.named("killUaa").get()) }
rootProject.file("build/boot.pid").delete()
Copy link
Copy Markdown
Member

@strehle strehle left a comment

Choose a reason for hiding this comment

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

beside copilot comments ok for me

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Merge | Prioritized

Development

Successfully merging this pull request may close these issues.

3 participants