Repository navigation
Commit 90c1703
build: convert Gradle build scripts from Groovy to Kotlin DSL
Converts every .gradle file in the repo (root, build-logic's precompiled
plugins, desktop/engine/modules/templates) to .gradle.kts.
Notable non-mechanical changes required along the way:
- build-logic switches from the groovy-gradle-plugin to kotlin-dsl plugin;
its precompiled scripts move from src/main/groovy to src/main/kotlin.
- GestaltExtension is extracted into its own GestaltExtension.kt: Kotlin
script files don't share top-level type declarations across files the
way Groovy scripts implicitly do.
- Several scripts (destination-sol-jre, destination-sol-module,
engine/build.gradle.kts, desktop/build.gradle.kts) look up the
base/idea/eclipse extensions explicitly via the<T>()/configure<T>()
instead of the generated type-safe accessors: those plugins are applied
transitively through another precompiled plugin rather than directly in
the consuming script's own plugins{} block, and Gradle's accessor
generation doesn't chase through that chain.
- destination-sol-ide.gradle.kts's IDEA XML patching (compiler.xml,
misc.xml, checkstyle-idea.xml) is ported off Groovy's Node '.@attr'
sugar onto groovy.util.Node's plain Java API via small child()/attr()
helpers. Verified by actually running `gradlew idea` - not just
compiling - since this is exactly the kind of dynamically-typed code a
naive port could silently get wrong.
- gestalt-module.gradle.kts's module.json/module.txt parsing moves from
Groovy's JsonSlurper to Gson (added as a build-logic dependency), fully
typed.
- The publishing blocks in gestalt-module, terasology-publish-common and
destination-sol-module all configure the same, project-name-keyed
MavenPublication. Groovy's "$project.name"(MavenPublication){} sugar
silently reconfigures an existing publication; Kotlin's create<>() does
not, it throws. Switched all three to maybeCreate().
- Dropped ipr.withXml{}/workspace.iws.withXml{} calls to
ideaActivateCheckstyle/Copyright/Annotations/Git/Gradle,
ideaMakeAutomatically and ideaRunConfig in the root build script: none
of the 7 functions have existed since config/gradle/ide.gradle was
deleted in 6819386 (Dec 2022). Groovy only fails on missing methods at
runtime, when `gradle idea`/`ipr`/`iws` actually executes, which
nothing does - so this has been silently dead for ~3 years. Kept the
one working sibling line (wildcards.remove) alongside it.
- .gitignore's !modules/subprojects.gradle and !libs/subprojects.gradle
negations are updated to the new .kts filenames, otherwise the broader
modules/*/libs/* ignore rules swallow the renamed files.
Verified: gradlew help configures the full project (root, build-logic,
desktop, engine, templates, and the auto-templated modules:core).
:engine:compileJava and :desktop:compileJava both build clean. gradlew
idea and :desktop:eclipse both run end-to-end, exercising the hand-ported
XML logic at runtime rather than just at compile time.
No behavior change intended anywhere in this diff; the findbugs ->
error-prone swap is a separate, follow-up PR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 2807a6e commit 90c1703
41 files changed
Lines changed: 1278 additions & 1230 deletions
File tree
- build-logic
- src/main
- groovy
- kotlin
- desktop
- engine
- libs
- modules
- templates
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
File renamed without changes.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments