Skip to content

Restore Gradle composite build with XTC plugin#11

Open
lagergren wants to merge 13 commits intomasterfrom
lagergren/newdsl
Open

Restore Gradle composite build with XTC plugin#11
lagergren wants to merge 13 commits intomasterfrom
lagergren/newdsl

Conversation

@lagergren
Copy link

Summary

  • Restore the Gradle build infrastructure that was accidentally lost when PR feat: Implement chess game server and web interface #3 merged a wrapper removal but not the re-add
  • Modernize to a multi-project build with the XTC Gradle plugin, replacing ad-hoc xcc Exec tasks
  • Standardize source layout to src/main/x/ (XTC plugin convention), move tests to src/test/x/
  • Add build-logic/ with a unified webapp-conventions plugin that conditionally applies Node/npm when webapp/package.json exists
  • Add root installDist task that collects all 11 .xtc modules into build/install/examples/lib/
  • Add xtcRun for welcomeTest — the only standalone-runnable module (the rest are @WebApp modules that need the platform)
  • Include chess-game as a standard subproject (remove its standalone Gradle wrapper)
  • Fix welcomeTest.x (was referencing schema.count which was renamed to schema.counters in 2024)
  • @Disabled three @DatabaseTest(PerTest) test classes in BankTest.x due to upstream xunit_db bug (PerTest lifecycle doesn't register ExecutionContext as injectable — Shared lifecycle works fine)
  • Add multi-stage Dockerfile: builds with gradle:jdk25, bundles XVM from ghcr.io/xtclang/xvm:latest, runs welcomeTest as build-time verification
  • Upgrade Gradle to 9.4.1, version catalog with XTC 0.4.4-SNAPSHOT
  • Rewrite README with build/run/test/Docker instructions using modern xtc build/xtc run CLI

Test plan

  • ./gradlew build — all 4 examples compile, 25/25 enabled tests pass
  • ./gradlew installDist — all 11 .xtc modules collected
  • ./gradlew :welcome:runXtc — runs welcomeTest, counter increments across runs
  • docker build -t xtc-examples . — multi-stage build succeeds, welcomeTest runs during build
  • docker run --rm xtc-examples — runs welcomeTest from the image

🤖 Generated with Claude Code

lagergren and others added 12 commits March 24, 2026 12:55
…yout

The composite build infrastructure was accidentally lost when PR #3 merged
the chess-game wrapper removal but not the re-add. This commit restores and
modernizes the build setup:

- Gradle wrapper at 9.4.0 with version catalog (XTC 0.4.4-SNAPSHOT)
- Root composite build including all 4 examples (welcome, banking, counter, chess-game)
- build-logic with webapp-conventions and static-webapp-conventions plugins
- Source layout standardized to src/main/x/ (XTC plugin convention)
- Test modules moved to src/test/x/ (BankTest.x, welcomeTest.x rewritten)
- Root installDist task collects all .xtc modules to build/install/examples/lib/
- Per-project xtcRun configuration (welcome runs welcomeTest standalone)
- Chess-game standalone gradle wrapper removed (uses root wrapper)
- README rewritten with build/run/Docker instructions using modern xtc CLI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Combine static-webapp-conventions and webapp-conventions into one plugin
  that conditionally applies Node/npm when webapp/package.json exists
- Clean up mavenLocal comments with explanation
- Remove redundant root xdkDistribution dependency

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace string-based tasks.named() with typed tasks.existing delegates.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Multi-stage build: compiles all examples in eclipse-temurin:25-jdk,
then copies the .xtc modules to a slim JRE image. No JDK, Gradle,
or Node.js required on the host — only Docker.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- @disabled the 3 @databasetest(PerTest) test classes in BankTest.x with
  detailed explanation: xunit_db PerTest lifecycle bug where ExecutionContext
  is not registered as an injectable resource (Shared lifecycle works fine)
- Dockerfile: 3-stage build using gradle:jdk25, ghcr.io/xtclang/xvm:latest,
  and eclipse-temurin:25-jre — runs welcomeTest as build-time verification
- Upgrade Gradle wrapper to 9.4.1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The kotlin-dsl plugin generates accessor code in an internal project
that inherits the build-logic version. Without an explicit version,
Gradle emits: "Project 'gradle-kotlin-dsl-accessors' has unspecified version."

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Contributor

@ggleyzer ggleyzer left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Contributor

@thegridman thegridman left a comment

Choose a reason for hiding this comment

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

This looks ok. You can merge and I can look at the XUnit issue in a separate PR

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