Layer 0: Pre-compile core into jar and update iw-run launcher #344

Closed
opened 2026-04-15 08:42:59 +00:00 by mprihoda · 0 comments
mprihoda commented 2026-04-15 08:42:59 +00:00 (Migrated from github.com)

Layer: 0 — Build Infrastructure
Parent: #343

Problem

Every command invocation passes all core/**/*.scala files to scala-cli for compilation. While scala-cli caches aggressively, the initial compile per command is slow, and this model doesn't support a Mill-built dashboard that needs core types as a dependency.

Solution

  1. Build iw-core.jar from core/ source (excluding tests) — can be done via scala-cli package or a Mill core module
  2. Update iw-run to pass --jar build/iw-core.jar to scala-cli instead of $core_files — this applies to all three command types (shared, plugin, project) so that hook/command authors don't need any //> using jar directives
  3. Dev-mode mtime check — if any core/**/*.scala is newer than build/iw-core.jar, warn or auto-rebuild before running the command
  4. Bootstrap update./iw --bootstrap should build the core jar

Key constraint

Command authors (hooks, project commands, plugin commands) must NOT need to add any directives — the jar is injected by iw-run transparently.

Files to modify

  • iw-run — change execute_command() to use --jar instead of $core_files
  • iw-run — add jar build/rebuild logic
  • scripts/package-release.sh — will be updated in a separate issue
**Layer:** 0 — Build Infrastructure **Parent:** #343 ## Problem Every command invocation passes all `core/**/*.scala` files to scala-cli for compilation. While scala-cli caches aggressively, the initial compile per command is slow, and this model doesn't support a Mill-built dashboard that needs core types as a dependency. ## Solution 1. **Build `iw-core.jar`** from `core/` source (excluding tests) — can be done via scala-cli `package` or a Mill `core` module 2. **Update `iw-run`** to pass `--jar build/iw-core.jar` to scala-cli instead of `$core_files` — this applies to all three command types (shared, plugin, project) so that hook/command authors don't need any `//> using jar` directives 3. **Dev-mode mtime check** — if any `core/**/*.scala` is newer than `build/iw-core.jar`, warn or auto-rebuild before running the command 4. **Bootstrap update** — `./iw --bootstrap` should build the core jar ## Key constraint Command authors (hooks, project commands, plugin commands) must NOT need to add any directives — the jar is injected by `iw-run` transparently. ## Files to modify - `iw-run` — change `execute_command()` to use `--jar` instead of `$core_files` - `iw-run` — add jar build/rebuild logic - `scripts/package-release.sh` — will be updated in a separate issue
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
iterative-works/iw-cli#344
No description provided.