Skip to content
CAI
Software that uses CAICheck a score

VirtusLab/scala-cli

69.6

Adequate · 28 September 2026

48.8k

lines of production code

Scala

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is Scala CLI, a command-line tool and build engine for compiling, running, and packaging Scala applications across JVM, JavaScript, and Native platforms. It manages project dependencies, handles build directives, and integrates with the Bloop server via the BSP protocol to provide IDE support and incremental compilation. The tool also supports generating native executables via GraalVM, executing code within Markdown documentation, and publishing artifacts with configurable signing and packaging options.

How it got here

2021 — Build engine migration and documentation overhaul

37 changes.

The project migrated its build engine from Ammonite to Bloop, introducing a new BSP integration layer and restructuring the CLI command architecture. Concurrently, the documentation site was completely redesigned with a new branding, automated GIF generation, and expanded use-case guides, while native image support and test infrastructure were significantly enhanced.

2022 — Architecture refactoring and configuration modularization

35 changes.

This period focused on restructuring the build system's core architecture, including modularizing build options, refining compiler integration, and rewriting the using directive parser. It also introduced significant enhancements to configuration management, packaging support, and documentation testing infrastructure.

2023–2026 — Build infrastructure and directive refactoring

5 changes.

This period focused on restructuring the build system's preprocessing logic by centralizing directive handling and introducing utilities for glob matching and warning management. It also added comprehensive BuildInfo generation for project metadata and expanded test coverage for BSP integration and CLI publishing behaviors.

Features

Add BSP \`buildTarget/wrappedSources\` endpoint and data models

The Scala CLI BSP server now exposes a new \buildTarget/wrappedSources\ RPC method, allowing clients to retrieve details about generated source wrappers for specified build targets. This change introduces the necessary request and response types (\WrappedSourcesParams\, \WrappedSourcesResult\) and data structures (\WrappedSourceItem\, \WrappedSourcesItem\) that map build targets to their original URIs, generated URIs, and wrapper code snippets, enabling IDEs and tools to understand and interact with wrapped source files.

modules/scala-cli-bsp · high confidence

Add GCBenchmark tool for analyzing Bloop JVM memory usage

A new standalone Scala script (gcbenchmark.scala) has been added to analyze the memory footprint of the Bloop server under different JVM garbage collection configurations. The tool generates a temporary project, runs multiple builds, and measures both peak and idle memory usage for setups using ParallelGC and ShenandoahGC, helping users understand how specific JVM options impact Bloop's resource consumption.

gcbenchmark · high confidence

Add GraalVM native-image configuration for scala-cli-core

The scala-cli-core module now includes native-image configuration files (jni-config.json, native-image.properties, proxy-config.json, reflect-config.json, and resource-config.json) to support building a GraalVM native executable. These resources register required JNI methods, reflection access for BSP and Bloop types, proxy interfaces, and necessary runtime resources, enabling the CLI to run as a native image without fallback.

modules/cli/src/main/resources/META-INF/native-image/org.virtuslab · high confidence

Added Scala import parsing logic to scalaparse module

The scalaparse module now includes internal utilities for parsing Scala import statements. A new ImportTree case class and a ScalaParse object have been added to handle the extraction of import prefixes, mappings, and location indices, enabling the build system to accurately analyze and process import structures in Scala source files.

modules/scalaparse · high confidence

Automated GIF generation tooling for documentation

The \gifs\ directory now contains the infrastructure to automatically generate animated SVG/GIF documentation assets. This includes a Dockerfile (based on Ubuntu 24.04) for the build environment, scripts using \demo-magic\ and \asciinema\ to record terminal interactions, and a Scala CLI helper (\create\_missing.sc\) to generate stub scenarios for missing assets. This enables the documentation to feature animated visualizations of Scala CLI features.

gifs · high confidence

Automated generation of CLI reference documentation

A new \generate-reference-doc\ module has been added to automatically produce the command-line reference documentation. This tool scans CLI commands, options, and directives to generate structured Markdown files (such as the command-line options summary and scalac forwarding rules) into the \website/docs/reference\ directory. It handles the conversion of console-specific formatting (like ANSI color codes and hidden/experimental tags) into clean Markdown, ensuring the documentation stays synchronized with the current CLI interface.

modules/generate-reference-doc · high confidence

Initial repository structure and developer tooling configuration

The repository is initialized with the core build definition (build.mill), Mill launcher scripts, and configuration files for formatting (scalafmt), linting (scalafix), and dependency management (scala-steward). It includes essential developer documentation (DEV.md, CONTRIBUTING.md, AGENTS.md) and standard repository metadata files (.gitignore, .gitattributes, .dockerignore, Dockerfile) to support the development workflow.

(repo-wide) · high confidence

Introduce dedicated Java test runner with JUnit 5 support

A new \java-test-runner\ module has been added to provide a pure-Java implementation of the test runner, complementing the existing Scala-based \test-runner\. This new runner supports JUnit 4 and JUnit 5 (via the Jupiter framework), allowing users to run Java tests without requiring the Scala runtime. The implementation includes framework discovery via classpath scanning and service loaders, bytecode inspection for fingerprint matching, and specific handling for JUnit 5 test discovery. The Scala \test-runner\ remains unchanged for Scala-specific frameworks like Munit, ScalaTest, and ZIO Test.

modules/test-runner · high confidence

Introduce sclicheck for validating documentation code snippets

Adds a new \sclicheck\ tool within the \docs-tests\ module that parses Markdown files to extract and execute code blocks (Scala, Bash, etc.) as part of the documentation test suite. This enables users to verify that code examples in the documentation compile and run correctly, supporting features like expected failures, clean contexts, and regex-based output checks.

modules/docs-tests/src/main · high confidence

Introduce standalone TASTY library for reading and post-processing Scala bytecode

A new \tasty-lib\ module has been added to provide a standalone, Scala 3-only library for reading and post-processing TASTY files. This library includes components for parsing TASTy headers and names (\TastyHeaderUnpickler\, \TastyUnpickler\, \TastyReader\), managing byte buffers (\TastyBuffer\), and handling version compatibility checks (\TastyVersions\). It enables the tooling to validate TASTy file versions and perform post-processing tasks, such as cleaning up source paths, while ensuring compatibility with the latest supported Scala versions.

modules/tasty-lib · high confidence

Java interface for configuration access

A new Java helper class has been added to the configuration module, allowing Java code to read settings (strings, booleans, lists, and passwords) from the internal configuration database. This change enables Java-based components to interact with the Scala CLI configuration system without needing to depend on Scala libraries directly.

modules/config/src/main/scala/scala/cli/config/internal · high confidence

New BuildInfo generation for project metadata and scope details

Scala CLI now generates a \BuildInfo\ object containing project metadata such as the Scala version, target platform (JVM, JS, Native), JVM/Scala.js/Scala Native versions, main class, and the specific Scala CLI version used. Additionally, scoped build information is included, exposing sources, scalac options, compiler plugins, dependencies, resolvers, resource directories, and custom JARs for each scope. This allows users to access comprehensive build configuration details programmatically via the generated \scala.cli.build.BuildInfo\ object.

modules/options/src/main/scala/scala/build/info · high confidence

New documentation scenarios for animated GIF generation

Added a suite of shell scripts in the \gifs/scenarios\ directory to automate the creation of animated GIFs for the documentation. These scripts cover key usage patterns including installation, basic scripting, project management, embedding scripts, prototyping across Scala versions, and cross-compilation to JavaScript and Native, ensuring the visual guides accurately reflect current tool behavior.

gifs/scenarios · high confidence

New error-handling utilities for build macros

Added new Scala source files in the build-macros module to improve error handling: \EitherCps.scala\ introduces a continuation-passing style helper for propagating errors, \EitherSequence.scala\ provides a \sequence\ function to combine sequences of \Either\ results, and \Ops.scala\ adds implicit extension methods for \Either\ types, including \sequence\ for collections, \orThrow\ for exceptions, and \traverseN\ for combining up to six \Either\ values while collecting errors.

modules/build-macros/src/main · high confidence

New packaging options for Debian, Red Hat, Windows, Docker, and Native Image builds

Users can now configure specific settings for various packaging targets. Debian packages can define conflicts, dependencies, architecture, priority, and section. Red Hat packages support license, release, and architecture fields. Windows installers allow customization of license paths, product names, exit dialogs, validation suppression, extra configuration, bitness, installer version, and WIX upgrade codes. Docker builds support specifying a base image, registry, repository, tag, custom command, and extra directories. Native image builds allow configuration of GraalVM JVM ID, Java version, GraalVM version, and additional GraalVM arguments.

modules/options/src/main/scala/scala/build/options/packaging · high confidence

New post-processing infrastructure for bytecode, TASTy, and SemanticDB

The build system now includes a dedicated post-processing layer that modifies compiled artifacts after generation. This includes updating line numbers in class files via ASM (AsmPositionUpdater), adjusting TASTy metadata to reflect source path changes (TastyPostProcessor), and relocating/adjusting SemanticDB files for scripts (SemanticDbPostProcessor). Additionally, it introduces support for the 'sloth' lazy-val patching agent (SlothAgent/SlothPatcher) to optimize runtime performance, and provides a unified PostProcessor trait to manage these transformations.

modules/build/src/main/scala/scala/build/postprocessing · high confidence

Support for extracting and running Scala/Java code blocks in Markdown files

The build system now parses Markdown files to extract and execute code blocks marked with \scala\ or \java\ language identifiers. Scala snippets are wrapped in generated objects with scope management (supporting \reset\ and \test\ tags) to allow interactive-like execution, while Java snippets are emitted as raw source files. The parser ignores shebang lines, handles unclosed code fences with specific errors, and respects \ignore\ tags to exclude blocks from processing.

modules/build/src/main/scala/scala/build/internal/markdown · high confidence

Removals

Removal of initial CLI implementation and native-image support files

The initial implementation of the Scala CLI tooling has been removed from the codebase. This includes the deletion of the main entry point (\ScalaCli.scala\), core command handlers (\Compile\, \Run\, \Repl\, \Package\), and the underlying build, artifact, and source management logic (\Build\, \Artifacts\, \Sources\, etc.). Additionally, files related to SubstrateVM (GraalVM) native-image support, including JVM-specific substitutes and JNI configuration, have been deleted.

cli · high confidence

Removed $ivy stub class

The $ivy stub class, which previously contained an empty static method, has been removed from the codebase.

stubs · high confidence

Architecture

Refactor build options and artifact resolution into new internal modules

The build options and artifact resolution logic has been reorganized into new internal modules (\Artifacts\, \ScalaArtifacts\, \Positioned\, \CoursierUtils\, \TemporaryInMemoryRepository\, and \BuildOptionsRule\). This refactoring introduces a \Positioned\ wrapper to track source locations for options, separates artifact resolution details into dedicated case classes, and adds validation rules (such as warning when JVM options are used on non-JVM platforms). It also includes a temporary in-memory repository implementation for handling dependency fallbacks and utility functions for parsing Coursier modules.

modules/options/src/main/scala/scala/build · high confidence

Refactor build options into modular case classes with generic merging and hashing

The build configuration system has been restructured from a single monolithic \BuildOptions\ structure into a set of focused, modular case classes (e.g., \JavaOptions\, \ScalaJsOptions\, \PublishOptions\, \ClassPathOptions\). This change introduces a generic \ConfigMonoid\ mechanism that automatically derives how these options merge (e.g., appending sequences, overriding scalars) and a \HasHashData\ trait for consistent hashing of configuration states. As a result, users benefit from a more robust and maintainable configuration system that cleanly separates concerns like JVM management, Scala.js linking, and publishing credentials, while ensuring that option precedence and caching behave consistently across all sub-configurations.

modules/options/src/main/scala/scala/build/options · high confidence

Refactor input element model and workspace origin tracking

The build system's input handling has been restructured to improve type safety and clarity. A new \Element\ sealed hierarchy has been introduced to explicitly distinguish between on-disk files (such as \SourceScalaFile\, \JavaFile\, \Script\, and \MarkdownFile\), virtual sources, and compiled artifacts, replacing the previous flatter structure. Utility logic for processing these elements, including directory traversal and input hashing, has been extracted into \ElementsUtils\. Additionally, a new \WorkspaceOrigin\ enum has been added to track how the workspace was initialized (e.g., \HomeDir\, \SourcePaths\, \Forced\), and \ScalaCliInvokeData\ now captures sub-command details to provide better context for error messages and pre-processing.

modules/build/src/main/scala/scala/build/input · high confidence

Behavioural changes

Added Google Tag Manager integration to the website root layout

The website now includes Google Tag Manager (GTM) tracking by injecting the GTM initialization script into the root layout component. This change restores analytics capabilities to the site by embedding the specific GTM container ID (GTM-5TZTCGF) within the Head section of the Root component, ensuring the tracking snippet loads before the rest of the page content.

website/src/theme · high confidence

Added dummy class to enforce Ivy dependency resolution for scalafmt module

A new empty class, ScalafmtDummy, has been added to the scalafmt module to ensure that Ivy dependencies are properly resolved by the Mill build tool. This change addresses build configuration requirements without altering user-facing functionality.

modules/dummy · low confidence

CLI module restructured with new command entry points and restricted-mode enforcement

The CLI module has been refactored to introduce a new command entry point class (ScalaCliCommands) that explicitly registers all sub-commands, including the new PGP commands (PgpPull, PgpPush) and the GitHub secret commands (SecretCreate, SecretList). A new RestrictableCommand trait and RestrictedCommandsParser have been added to enforce specification levels (RESTRICTED, EXPERIMENTAL), ensuring that restricted features are hidden or warned against in SIP (Secure/Restricted) mode. The main entry point (ScalaCli) now handles stacktrace persistence to files for non-CI environments and loads Java properties from .scala-jvmopts. Additionally, a CustomWindowsEnvVarUpdater is introduced to handle Windows environment variable updates with specific null-character stripping logic.

modules/cli/src/main/scala · high confidence

Core module refactoring and error handling improvements

The core module has been restructured to improve error reporting and utility organization. A new Logger trait and its Nop implementation provide a unified interface for logging across Coursier, Bloop, Scala.js, and Scala Native, including support for experimental and deprecation warnings. A comprehensive set of specific BuildException subclasses (e.g., AmbiguousPlatformError, DependencyFormatError, NoFrameworkFoundByBridgeError) replaces generic errors, providing precise, actionable messages with source positions. Utility objects like CsUtils (for Scala version checks), Os (for path/architecture detection), and RepositoryUtils (for snapshot/nightly repos) have been added. Additionally, the Position model now supports rendering relative to a working directory, and the CodeWrapper exposes the script path to generated code.

modules/core · high confidence

Improved GraalVM native image support with working directory changes and binary parser fallbacks

The build system now supports changing the current working directory when running processes in GraalVM native images, enabling more accurate path resolution during builds. Additionally, Java source parsing now uses an external binary by default in native images, with a JVM-based fallback available when external binaries are not present, ensuring consistent behavior across execution environments.

modules/build/src/main/java · high confidence

Improved native image support for command naming and signing

Scala CLI now correctly identifies its own command name on Linux, macOS, and Windows within native images by substituting the underlying argument retrieval logic, ensuring accurate help text and error messages. Additionally, the native image build process now statically links the libsodium and coursier JNI utilities on supported platforms to resolve missing native library issues, and substitutes the BouncyCastle signer maker to properly handle external signing configurations without relying on JVM-specific initialization.

modules/cli/src/main/java/scala/cli/internal · high confidence

Improved resource handling with automatic cleanup on rename or delete

The build system now tracks resource file mappings in a registry file, enabling automatic removal of output resources when their source files are deleted or renamed. This change introduces a new \ResourceMapper\ that manages copying resources (including individual files and directories) to the build output while maintaining a persistent mapping, and adds a \NativeResourceMapper\ to handle Scala Native C interop files using the same registry-based approach.

modules/build/src/main/scala/scala/build/internal/resource · high confidence

Interactive prompts now support literal input values

The interactive module now allows users to provide literal string values directly at prompts, rather than being restricted to index-based selections. This is implemented via the new \Interactive.scala\ and \InteractiveFileOps.scala\ files, which handle confirmation and choice operations by parsing both integer indices and direct string matches, enabling more flexible input methods for interactive operations.

modules/options/src/main/scala/scala/build/interactive · high confidence

Introduce new BSP server architecture with BloopSession and reloadable options

The BSP integration in this module has been restructured to support dynamic workspace reloading and improved error handling. A new \BloopSession\ class now manages the lifecycle of the Bloop compiler and file watchers, while \BspReloadableOptions\ allows build configuration to be updated without restarting the server. The \BspImpl\ class coordinates these components, and \BuildServerProxy\ enables the \workspace/reload\ capability by delegating to the reloaded session. Additionally, \BspClient\ now handles generated source diagnostics more accurately by mapping URIs and adjusting line numbers for wrapped scripts.

modules/build/src/main/scala/scala/build/bsp · high confidence

Introduction of specification levels for CLI stability and visibility

A new \SpecificationLevel\ module has been added to define stability tiers (MUST, SHOULD, IMPLEMENTATION, RESTRICTED, EXPERIMENTAL) for CLI options, directives, and commands. This mechanism allows the tool to categorize features based on their inclusion in the standard Scala Runner Specification and controls their visibility in help output, laying the groundwork for deprecating unstable or internal options.

modules/specification-level · high confidence

Migrate build engine from Ammonite to Bloop

The build engine in the build module has been replaced with Bloop, introducing new components such as Bloop.scala, BloopBuildClient, and ConsoleBloopBuildClient to handle compilation and diagnostics via the BSP protocol. This change removes the previous Ammonite-based implementation, shifting how projects are compiled and how build targets are managed.

modules/build/src/main/scala/scala/build · high confidence

Migrate dependency resolution to Coursier 0.3.1 APIs

The internal utility module now converts the project's dependency model to the updated Coursier 0.3.1 API. This change ensures that dependency resolution, including handling of exclusions, classifiers, types, and transitive settings, aligns with the new library interface, preventing compatibility errors during artifact fetching.

modules/options/src/main/scala/scala/build/internals · high confidence

Migrate using directives to a Scala-rewritten parser

The \using\ directive system has been rewritten in Scala, replacing the previous implementation. This change introduces a new \DirectiveHandler\ mechanism that derives directive parsers from case classes, enabling features like scoped directives (via \ScopePath\ and \Scoped\), improved error reporting with precise positions, and support for new directives such as \buildInfo\, \computeVersion\, \objectWrapper\, and \exclude\. Users benefit from more robust directive parsing, better error messages, and expanded configuration options for build settings, packaging, and platform selection.

modules/directives/src/main/scala/scala/build/preprocessing · high confidence

Migrate using directives to a Scala-rewritten parser module

The \using\ directive handling has been migrated from the legacy \using\_directives\ implementation to a new Scala-rewritten \directives-parser\ module. This change introduces a structured directive system with dedicated metadata annotations (such as \DirectiveName\, \DirectiveLevel\, and \DirectiveGroupDetails\) and a robust \DirectiveValueParser\ that natively supports parsing Boolean, String, and Numeric values. Users benefit from improved error reporting, including specific messages for missing toolkit versions and incorrect value types, as well as enhanced path handling that correctly resolves the \${.}\ special syntax for parent directory references.

modules/directives/src/main/scala/scala/build/directives · high confidence

Native image PGP proxy implementation decoupled from BouncyCastle

When Scala CLI runs as a native image, the PGP proxy mechanism now uses a dedicated substitute class to instantiate the proxy, effectively decoupling the native build from the BouncyCastle library required by the standard signing implementation.

modules/cli/src/main/java/scala/cli/commands/publish · high confidence

New landing page components and installation UI

The website now features a redesigned landing page with a new installation interface that automatically detects the user's operating system (macOS, Linux, Windows, or GitHub Actions) and displays the appropriate one-line install command. This change introduces a suite of new React components (such as BasicInstall, BigHeader, and UseCase) to support the new layout, while removing the previous generic HomepageFeatures component.

website/src/components · high confidence

New specific error types for using directives and linking

The build system now introduces dedicated exception classes for using directive and Scala.js linking failures, including \ScalaJsLinkingError\, \SingleValueExpectedError\, \UsingDirectiveExpectationError\ (with subtypes for wrong value types, incorrect value counts, and missing toolkit versions), \UsingFileFromUriError\, and path-validation errors (\WrongDirectoryPathError\, \WrongJarPathError\, \WrongJavaHomePathError\, \WrongSourcePathError\). These errors provide clearer, context-rich messages—such as expected vs. actual values, specific directive keys, and file/URI locations—helping users quickly identify and fix configuration issues in their using directives or linking steps.

modules/directives/src/main/scala/scala/build/errors · high confidence

New utility utilities for glob pattern matching and centralized warning messages

This change introduces two new utility files in the build module: \RegexUtils\ and \WarningMessages\. \RegexUtils\ adds a \globPattern\ function to convert glob expressions (using \\*\) into compiled regular expressions, enabling pattern matching for inputs like test class names. \WarningMessages\ centralizes the generation of user-facing warning and error text, covering experimental features, deprecated directives/options, offline mode fallbacks when Bloop is unavailable, script-specific issues (such as multiple main objects or \@main\ annotation limitations), and new warnings related to the 'sloth' lazy-val patching feature and toolkit 'latest' deprecation.

modules/build/src/main/scala/scala/build/internal/util · high confidence

New website design and component styles

The website now uses a new design system, introducing fresh styles for key sections including the 'About' page, feature highlights, image-text layouts, and CLI installation instructions. A new 'Runnable Sample' component provides styled code blocks with a '$' prompt for bash commands, and a 'Yellow Banner' section offers a distinct call-to-action area. All new components support both light and dark themes, with specific adjustments for mobile viewports.

website/src/scss/components · high confidence

New website styling and branding updates

The website's visual presentation has been updated with a new SCSS structure and branding elements. A new theme configuration defines specific red and yellow colors, which are applied to section titles and content in dark mode. The layout now includes a custom header link displaying the VL logo, and typography has been adjusted to use Roboto Mono for section titles. Additionally, the stylesheet imports various component-specific styles (such as sections, tooltips, and runnable samples) and sets container widths to 1204px.

website/src/scss · high confidence

Outdated dependency warnings with update suggestions

The build system now detects when classpath dependencies are outdated and emits actionable hint diagnostics. These diagnostics display the current and latest stable versions, provide a concrete update suggestion (formatted as a dependency string or a toolkit-specific identifier), and include a text edit that allows users to apply the update directly. The feature respects the \suppressOutdatedDependencyWarning\ option to allow users to disable these warnings, and it filters out specific toolkit-test dependencies to prevent duplicate suggestions.

modules/options/src/main/scala/scala/build/actionable · high confidence

PGP commands now run as external processes in GraalVM native images

In GraalVM native images, PGP operations (create, key-id, sign, verify) are now executed via external commands rather than relying on internal Scala implementations. This change ensures PGP functionality works correctly in native builds by delegating to system-installed PGP tools, while the internal Scala command implementations are disabled for this target.

modules/cli/src/main/java/scala/cli/commands/pgp · high confidence

Redesigned configuration system with secure credential handling and granular key controls

The configuration module has been rebuilt to introduce a structured \ConfigDb\ for managing settings, featuring a new \Key\ system that enforces specification levels (such as \EXPERIMENTAL\, \RESTRICTED\, and \IMPLEMENTATION\) and supports deprecation messages. Passwords are now handled via a \PasswordOption\ abstraction that supports inline values, environment variables, file paths, and external commands, with strict POSIX permission checks (owner-only read/write) when saving config files. The system adds dedicated configuration keys for HTTP proxy settings, repository mirrors, and publishing credentials, while also introducing global flags to suppress warnings for outdated dependencies, experimental features, and deprecated features.

modules/config/src/main/scala/scala/cli/config · high confidence

Redesigned website with dedicated use-case pages and Spark documentation

The website has been restructured to highlight specific Scala CLI use cases, introducing new dedicated pages for Education, Scripting, Prototyping, and Single-module projects, each featuring tailored messaging and GIFs. The landing page (index.js) has been completely revamped with a new layout, updated feature descriptions, and direct links to these use-case sections. Additionally, a new Install page has been added to streamline installation instructions, and comprehensive documentation for experimental Spark and Hadoop features (including packaging and running jobs) has been introduced to guide users on using Scala CLI with these big data tools.

website/src/pages · high confidence

Refactor publish options into dedicated module with new signer and VCS parsing

The publish-related option classes (ConfigPasswordOption, Developer, License, Signer, Vcs) have been moved from the general options module into a new dedicated package scala.build.options.publish. This refactoring introduces a new Signer enum that explicitly supports a 'nop' or 'none' value to disable signing, and updates the Vcs parser to handle GitHub shorthand syntax (github:org/project) in addition to the standard pipe-delimited format. The Developer parser now strictly validates the id\|name\|url\|mail format, and the License parser continues to support both license IDs and custom name:url pairs.

modules/options/src/main/scala/scala/build/options/publish · high confidence

Refactor script execution and main-class detection internals

The build module's internal execution and packaging logic has been restructured. Script code generation now uses dedicated wrappers (App, Class, and Object) to handle entry points and argument passing more robustly. Main-class detection has been rewritten to support JEP 512 flexible main methods (including non-public and no-arg variants) and to correctly resolve inheritance hierarchies in bytecode. Java source parsing now uses an external \java-class-name\ binary as a fallback when the JVM-based parser is unavailable. Additionally, the runner now supports creating manifest JARs to handle long classpaths on Windows and allows specifying a working directory for executed processes.

modules/build/src/main/scala/scala/build/internal · high confidence

Refactored \`using\` directive processing into a centralized handler registry

The \using\ directive processing logic has been restructured to ensure all directives are pre-processed in a single, unified location. This change introduces a centralized registry of directive handlers (in \DirectivesPreprocessingUtils\) that explicitly lists supported directives such as \objectWrapper\, \BuildInfo\, \Wasm\, \Sloth\, and \benchmarking\, alongside existing ones like \Dependency\ and \ScalaVersion\. New data structures (\PartiallyProcessedDirectives\ and \PreprocessedDirectives\) now encapsulate the results of this processing, separating global requirements, global options, scoped requirements, and stripped content. This consolidation simplifies the pre-processing logic and provides a more robust foundation for handling directive errors during BSP initialization.

modules/build/src/main/scala/scala/build/preprocessing/directives · high confidence

Refactored compiler architecture with new Bloop integration and retry logic

The compiler module has been restructured to introduce a new BloopCompiler and BloopCompilerMaker, which manage the Bloop server lifecycle and support offline mode fallbacks. To improve reliability in parallel execution environments, the Bloop compiler now includes automatic server restart logic with retries when the server exits unexpectedly. Additionally, the refactoring extracts and abstracts common compilation handling logic into the SimpleScalaCompiler, while introducing new traits (ScalaCompiler, ScalaCompilerMaker) to standardize compiler creation and usage across the build system.

modules/build/src/main/scala/scala/build/compiler · high confidence

Refactored test input handling to use explicit temporary directories

The integration test infrastructure now uses a dedicated temporary directory for test inputs, controlled by the SCALA\_CLI\_TMP environment variable, instead of relying on the operating system's default temporary directories. This change ensures that test resources are written and managed in a predictable location, improving reliability and cleanup behavior during integration tests.

modules/integration/src/main · high confidence

Refactored using directives processing with new parser and deprecation warnings

The preprocessing module has been restructured to use a new \scala3-directives-parser\ for extracting \using\ directives, replacing the previous implementation. This change introduces a \DeprecatedDirectives\ system that warns users when they use deprecated directive keys (such as \lib\ or \libs\, which should be \dep\ or \deps\) or deprecated values (such as \latest\ for toolkits, which should be \default\). The refactoring also splits directive handling into dedicated preprocessor components for different input types (Scala, Java, Markdown, Scripts, JARs, and Data), ensuring that directives are processed consistently across all source formats and that errors are handled more robustly.

modules/build/src/main/scala/scala/build/preprocessing · high confidence

Restored custom domain configuration for the website

The CNAME file has been added back to the static assets, configuring the custom domain scala-cli.virtuslab.org for the website. This ensures that the site is correctly associated with its custom domain for DNS resolution.

website/static · high confidence

Support for JEP 512 flexible main methods and simplified stack traces

The runner now supports JEP 512 flexible main methods, allowing applications to define main methods with or without String arguments, and preferring the argument-taking version when both are present. It also handles instance main methods by instantiating the class via a non-private zero-argument constructor. Additionally, stack traces are now printed without internal runner frames and with optional coloring, controlled by the \scala.colored-stack-traces\ system property and verbosity levels.

modules/runner · high confidence

Support for running Scala.js linker on JVM or Native

The Scala.js linker options now allow users to explicitly choose whether to run the linker on the JVM or on Native. This is controlled via the \useJvm\ option, where a right-biased value indicates JVM execution, while a left-biased value specifies the target architecture for Native execution. If not specified, the system defaults to Native based on the platform architecture, falling back to JVM if the platform suffix cannot be determined.

modules/options/src/main/scala/scala/build/options/scalajs · high confidence

Support for running Scala.js linker via native binaries and new linker configuration options

Users can now run the Scala.js linker using native binaries (or JVM classpath) instead of requiring a full JVM invocation, which improves startup performance. This is enabled by new options in the linker configuration, including \--js-emit-wasm\ to emit WebAssembly, \--importmap\ to remap ES module imports at link time, and support for the \SmallModulesFor\ module split style. Additionally, the \--esVersion\ flag now accepts newer ECMA script version strings, with hard errors for unknown values, and conflicts between watch/interactive modes and standard input reading have been resolved via a concurrent reader.

modules/options/src/main/scala/scala/build/internal · high confidence

Website restructured with new navigation, local search, and Dockerized build

The documentation site has been reorganized with a new navbar featuring dedicated sections for Installation, Use Cases (Education, Scripting, Prototyping, Projects), Documentation, Commands, and Guides. Local search is now available via the docusaurus-search-local plugin, and code highlighting has been updated with light/dark themes and additional language support. The site URL has changed to scala-cli.virtuslab.org, community links now point to Discord instead of Gitter, and the GitHub repository reference has been updated to reflect the 'main' branch. A new safe-yarn.sh script enables building the site in a Docker container using Node 16, and the site now throws errors on broken anchors and markdown links for improved reliability.

website · high confidence

Website visual redesign with new primary color and layout adjustments

The website's appearance has been updated with a new primary color (red) replacing the previous teal theme, alongside structural CSS changes that adjust section margins, reorder image-box content for specific layouts, and hide certain columns in feature rows. A new CSS file was also added to support mobile layouts and specific styling for code highlighting and content prefixes.

website/src/css · high confidence

Test coverage

Added CLI test suite for argument splitting, native binary caching, JAR packaging, and environment configuration; Added Docker integration tests for Scala CLI; Added PGP public key for integration tests; Added integration tests for Scala CLI features; Added munit-based test suites for documentation, GIFs, and link validation; Added negative test for mismatched left types in EitherCps; Added test models for BSP wrapped sources; Added tests for CLI command options and behaviors; Added tests for Ivy publishing attributes, checksum exclusions, native image options, and help detection; Added unit tests for Markdown code block extraction and wrapping; Added unit tests for legacy runner fallbacks, ConfigMonoid merging, and Scala.js ES version validation; Added unit tests for the CPS macro; Added unit tests for version computation and VCS parsing; Expanded test coverage for build module components; New test utilities for Bloop, compiler plugins, and Docker integration; Removal of CLI integration test suite; Test utility for managing Bloop server connections.

Dependencies

Build infrastructure migrated to Mill 1.1.2 with centralized dependency management

The project build has been migrated to Mill 1.1.2, replacing the previous Mill 0.10-compatible setup and the legacy \deps.sc\ script. This change introduces a new centralized dependency management structure under \project/deps/package.mill\, which defines version constants for core tools (Coursier 2.1.25-M26, Bloop 2.1.2, Scalafmt 3.11.5) and Scala versions (defaulting to Scala 3.9 Next). The migration also updates the minimum Java version required to launch Scala CLI to 17, adds support for SBT 2.0.0 export, and includes new publishing logic in \project/publish/package.mill\ for Sonatype Central.

project · high confidence

Website dependencies upgraded to React 19 and Docusaurus 3

The documentation site has been updated to use React 19 and Docusaurus 3 (specifically version 3.10.2), replacing the previous React 17 and Docusaurus 2 alpha versions. This upgrade includes adding the local search plugin (@easyops-cn/docusaurus-search-local) and SASS support (docusaurus-plugin-sass), while also updating core libraries like MDX and clsx to their latest major versions to ensure compatibility and performance.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 69 → 70 (+0.7)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 84 → 84 (+0.2)
  • Architecture 98 → 97 (-1.1)
  • Maturity 64 → 63 (-1.0)
  • Readiness 76 → 74 (-2.1)
  • Security 65 → 71 (+5.9)

Resolved (17)

  • Change coupling: FetchExternalBinary.scala ↔ BuildOptions.scala (modules/options/src/main/scala/scala/build/internal/FetchExternalBinary.scala)
  • CommentExtractor.extract (cognitive 105) (modules/directives-parser/src/main/scala/scala/cli/parse/CommentExtractor.scala)
  • CommentExtractor.extract (cyclomatic 56) (modules/directives-parser/src/main/scala/scala/cli/parse/CommentExtractor.scala)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no installation or build instructions (website/docs/reference/env-vars.md)
  • Documentation: no project overview (website/docs/reference/env-vars.md)
  • FixmeComment (modules/options/src/main/scala/scala/build/Artifacts.scala)
  • Hotspot: modules/build/src/main/scala/scala/build/Build.scala (modules/build/src/main/scala/scala/build/Build.scala)
  • Lexer.tokenize (cognitive 70) (modules/directives-parser/src/main/scala/scala/cli/parse/Lexer.scala)
  • Lexer.tokenize (cyclomatic 37) (modules/directives-parser/src/main/scala/scala/cli/parse/Lexer.scala)
  • Off-boarding risk: anonymized user #1
  • Parser.parse (cognitive 27) (modules/directives-parser/src/main/scala/scala/cli/parse/Parser.scala)
  • Parser.parse (cyclomatic 23) (modules/directives-parser/src/main/scala/scala/cli/parse/Parser.scala)
  • TodoComment (modules/cli/src/main/scala/scala/cli/commands/fix/Fix.scala)
  • TodoComment (modules/integration/src/test/scala/scala/cli/integration/FixBuiltInRulesTestDefinitions.scala)
  • TodoComment (modules/integration/src/test/scala/scala/cli/integration/FixBuiltInRulesTestDefinitions.scala)
  • TodoComment (modules/integration/src/test/scala/scala/cli/integration/FixScalafixRulesTestDefinitions.scala)

New (9)

  • Boundary-crossing change coupling: ScalaJsOptions.scala ↔ ScalaJsLinkerConfig.scala (modules/cli/src/main/scala/scala/cli/commands/shared/ScalaJsOptions.scala)
  • FixmeComment (modules/options/src/main/scala/scala/build/Artifacts.scala)
  • Hotspot: modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala (modules/cli/src/main/scala/scala/cli/commands/repl/Repl.scala)
  • Hotspot: modules/options/src/main/scala/scala/build/options/BuildOptions.scala (modules/options/src/main/scala/scala/build/options/BuildOptions.scala)
  • MavenProjectDescriptor.dependencySettings (cognitive 18) (modules/cli/src/main/scala/scala/cli/exportCmd/MavenProjectDescriptor.scala)
  • No ADRs found
  • Off-boarding risk: anonymized user #1
  • Orphaned knowledge (modules/core/src/main/scala/scala/build/internals/Licenses.scala)
  • Outdated (npm): sass

Changes since last survey

  • 42 commits — 37 feature/other, 5 fixes

By area

  • project/deps — 13 commits
  • (root) — 8 commits
  • modules/integration — 7 commits
  • modules/cli — 5 commits
  • (repo) — 2 commits
  • website/docs — 2 commits
  • website/package.json — 2 commits
  • modules/build — 1 commit
  • modules/directives-parser — 1 commit
  • website/yarn.lock — 1 commit

Notable commits

  • fix: Bump scalafix to 0.14.9 (was 0.14.8) and re-enable fix sub-command tests for Scala 3.10+ (#4471)
  • fix: Fix coursier wrapper tests (#4474)
  • fix: Fix native image for Scala 3.9
  • fix: fix: fix tests not working on Windows (#4502)
  • fix: fix: make fix respect excluded sources when running scalafix (#4492)
  • change: Add .gitattributes to recognize .mill files as Scala (#4483)
  • change: Add release notes for v1.17.1 (#4477)
  • change: Bump Mill to 1.1.9 (was 1.1.7) (#4472)
  • change: Bump Scala 3 Next RC to 3.10.0-RC3 (#4508)
  • change: Bump scala-cli-signing to 0.3.1
  • change: Bump scala-cli-signing to 0.3.1 & bcpkix-jdk18on to 1.86 (#4475)
  • change: Bump announced Scala Next RC to 3.10.0-RC2 (#4470)
  • change: Bump image-size from 2.0.2 to 2.0.4 in /website (#4505)
  • change: Bump minimum Java to launch Scala CLI to 17 (was 11), use -Yfuture-lazy-vals in specification-level, runner and test-runner modules
  • change: Bump the npm-dependencies group in /website with 4 updates (#4469)
  • change: Bump the npm-dependencies group in /website with 4 updates (#4488)
  • change: Cross-compile with LTS RCs
  • change: Merge pull request #4466 from Gedochao/update/internal-scala-next
  • change: Migrate to scala3-directives-parser
  • change: Pin config module to scala 3.9 LTS, bump default internal version to 3.9 LTS
  • …and 22 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

VirtusLab/scala-cli was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f1221a1eed44585c5dcba0a05ea2849efdc57d44 — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d46da229e3fd.