chore(build): migrate Gradle build scripts from Groovy to Kotlin DSL#100
chore(build): migrate Gradle build scripts from Groovy to Kotlin DSL#100balazs-szucs wants to merge 2 commits intogrimmory-tools:developfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughReplaced Groovy-based Gradle build and settings files with Kotlin DSL equivalents: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
booklore-api/build.gradle.kts (1)
146-152: Consider more idiomatic Kotlin DSL property assignment.The JaCoCo report configuration uses
.set(true)which works, but Kotlin DSL supports direct property assignment for a cleaner syntax.♻️ Optional: Use property assignment syntax
tasks.named<JacocoReport>("jacocoTestReport") { dependsOn(tasks.named("test")) reports { - xml.required.set(true) - html.required.set(true) + xml.required = true + html.required = true } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@booklore-api/build.gradle.kts` around lines 146 - 152, Change the JaCoCo report property assignments to use Kotlin DSL direct property assignment instead of calling .set(true); locate the tasks.named<JacocoReport>("jacocoTestReport") block and replace xml.required.set(true) and html.required.set(true) with the idiomatic assignments xml.required = true and html.required = true so the configuration uses Kotlin property syntax.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@booklore-api/build.gradle.kts`:
- Around line 154-167: The configuration currently calls
frontendResourcesDir.exists() during Gradle configuration in the
tasks.named<Copy>("processResources") block (using configuredFrontendDistDir /
defaultFrontendDistDir), so the from(...) is skipped if the dir is created
later; change this by deferring the existence check to execution time: either
move the conditional into a doFirst/doLast in the same
tasks.named<Copy>("processResources") block and call
frontendResourcesDir.get().exists() there, or register a separate Copy task
(e.g., "copyFrontend") that uses
from(configuredFrontendDistDir.orElse(providers.provider {
defaultFrontendDistDir })) with an onlyIf {
configuredFrontendDistDir.get().exists() } and make
tasks.named("processResources") dependOn("copyFrontend") so the copy runs only
at execution time when the directory may exist.
---
Nitpick comments:
In `@booklore-api/build.gradle.kts`:
- Around line 146-152: Change the JaCoCo report property assignments to use
Kotlin DSL direct property assignment instead of calling .set(true); locate the
tasks.named<JacocoReport>("jacocoTestReport") block and replace
xml.required.set(true) and html.required.set(true) with the idiomatic
assignments xml.required = true and html.required = true so the configuration
uses Kotlin property syntax.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d3011105-5066-43d7-bd79-3b659d627144
📒 Files selected for processing (4)
booklore-api/build.gradlebooklore-api/build.gradle.ktsbooklore-api/settings.gradlebooklore-api/settings.gradle.kts
💤 Files with no reviewable changes (2)
- booklore-api/settings.gradle
- booklore-api/build.gradle
Description
Linked Issue: Fixes #
Changes
This pull request migrates the build configuration of the
booklore-apiproject from Groovy-based Gradle files to Kotlin DSL (KTS). The main goal is to modernize the build setup, improve maintainability, and leverage Kotlin's type safety and tooling support. The changes include a direct translation of all build logic, dependencies, and tasks, as well as the removal of the old Groovy files.Summary by CodeRabbit