Skip to content

Commit 6ce17f0

Browse files
committed
docs: avoid hard-coded Scala versions in docs
Motivation: The development docs embedded concrete Scala cross versions, which drift when build.mill is updated and create recurring maintenance work. Modification: Point CLAUDE.md at build.mill as the source of truth for Mill and Scala versions, replace concrete JVM cross-version commands with Mill wildcard targets, and update README development/client-server examples to use the current cross-module syntax without pinning a Scala version. Result: The docs now stay aligned with the configured build matrix without requiring manual version edits when Scala versions change.
1 parent e686d89 commit 6ce17f0

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22

33
## Build & Test
44

5-
Uses [Mill](https://mill-build.org/) 1.1.2. Cross-built for Scala 3.3.7, 2.13.18, and 2.12.21 (JVM only).
5+
Uses the [Mill](https://mill-build.org/) version declared in `build.mill`. Cross-built for the Scala versions declared by `scalaVersions` and `jvmScalaVersions` in `build.mill`.
66

77
```bash
8-
# Compile (JVM, Scala 3)
9-
./mill 'sjsonnet.jvm[3.3.7]'.compile
8+
# Compile all JVM Scala versions
9+
./mill 'sjsonnet.jvm[_]'.compile
1010

11-
# Run all JVM tests (Scala 3)
12-
./mill 'sjsonnet.jvm[3.3.7]'.test
11+
# Run all JVM tests
12+
./mill 'sjsonnet.jvm[_]'.test
1313

1414
# Run all tests across all platforms
1515
./mill __.test
1616

17-
# Build assembly JAR
18-
./mill 'sjsonnet.jvm[3.3.7]'.assembly
17+
# Build assembly JARs
18+
./mill 'sjsonnet.jvm[_]'.assembly
1919

2020
# GraalVM native image
2121
./mill sjsonnet.graal.nativeImage
2222
```
2323

24-
The assembly JAR is at `out/sjsonnet/jvm/3.3.7/assembly.dest/out.jar`. Run it with `java -Xss100m -jar out.jar`.
24+
Assembly JARs are written under `out/sjsonnet/jvm/<scala-version>/assembly.dest/out.jar`. Run one with `java -Xss100m -jar out.jar`.
2525

2626
## Formatting
2727

@@ -71,7 +71,7 @@ Every bug fix should include a regression test:
7171
2. Create `new_test_suite/<descriptive_name>.jsonnet.golden` with expected output.
7272
- Success tests: JSON output followed by a newline, using `std.assertEqual` chains ending in `true`.
7373
- Error tests (filename starts with `error.`): expected stderr including stack traces.
74-
3. Run `./mill 'sjsonnet.jvm[3.3.7]'.test` to verify.
74+
3. Run `./mill 'sjsonnet.jvm[_]'.test` to verify.
7575

7676
## Debug Stats
7777

readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -335,16 +335,16 @@ To generate the static files without starting a server:
335335
The output is a single `index.html` file (with the Sjsonnet JS engine inlined) written to `out/playground/bundle.dest/`. You can open it directly in a browser — no server needed — or serve it with any static file server. The editor UI (CodeMirror) is loaded from a CDN at runtime, so an internet connection is required.
336336
337337
## Development
338-
To compile the JVM version:
338+
To compile the JVM versions:
339339
340340
```bash
341-
./mill 'sjsonnet.jvm[3.3.7]'.compile
341+
./mill 'sjsonnet.jvm[_]'.compile
342342
```
343343
344-
To run the tests:
344+
To run the JVM tests:
345345
346346
```bash
347-
./mill 'sjsonnet.jvm[3.3.7]'.test
347+
./mill 'sjsonnet.jvm[_]'.test
348348
```
349349
350350
If you want to test for all platforms and versions, you can run
@@ -357,16 +357,16 @@ If you want to test for all platforms and versions, you can run
357357
358358
Sjsonnet comes with a built in thin-client and background server, to help
359359
mitigate the unfortunate JVM warmup overhead that adds ~1s to every invocation
360-
down to 0.2-0.3s. For the simple non-client-server executable, you can use
360+
down to 0.2-0.3s. For the simple non-client-server executables, you can use
361361
362362
```bash
363-
./mill -i show sjsonnet[3.3.7].jvm.assembly
363+
./mill -i show 'sjsonnet.jvm[_].assembly'
364364
```
365365
366-
To create the executable. For the client-server executable, you can use
366+
For the client-server executables, you can use
367367
368368
```bash
369-
./mill -i show sjsonnet[3.3.7].server.assembly
369+
./mill -i show 'sjsonnet.jvm[_].server.assembly'
370370
```
371371
372372
By default, the Sjsonnet background server lives in `~/.sjsonnet`, and lasts 5

0 commit comments

Comments
 (0)