Newer
Older
iw-project-support / change-requests / 202501-mill.md

Change Request #01/2025: Mill Build Tool Support

Date Created: 02.04.2025 Author: Claude

1. Original Request

Investigate using Mill as an alternative to SBT for Scala builds while maintaining our standardized approach to dependency management and project configuration.

2. Change Specification

Overview

Create Mill build tool support equivalent to our existing SBT infrastructure. This would enable us to use Mill as an alternative build tool while maintaining our standardized dependency management and project configuration approaches.

Motivation

Mill offers several potential benefits over SBT:

  • Faster build times through aggressive caching and parallelism
  • Better IDE support with type-checked build files
  • Simpler configuration with fewer plugins needed
  • Easier extension with custom tasks
  • Cleaner syntax and more approachable learning curve

Scope

  1. Create an equivalent to IWMaterialsVersions for Mill
  2. Create an equivalent to IWMaterialsDeps for Mill
  3. Create an equivalent to IWScalaProjectPlugin for Mill
  4. Document how to configure publishing to IW Maven repositories
  5. Create examples showing migration from SBT to Mill

3. Time Estimate and Timeline

  • Research & Planning: 1 week
  • Implementation of core components: 2 weeks
  • Documentation and examples: 1 week
  • Testing with existing projects: 1 week

Total: 5 weeks

4. Technical Solution Overview

1. IWMillVersions

Create a centralized version management module that mirrors our IWMaterialsVersions in SBT:

  • Define same version constants for all libraries
  • Ensure compatibility with existing projects
  • Support for both Scala 2.13 and Scala 3

2. IWMillDeps

Create a dependency management module similar to IWMaterialsDeps:

  • Provide access to individual libraries with proper version control
  • Implement helper methods like useZIO(), useZIOAll(), etc.
  • Support for cross-platform (JVM/JS) dependencies

3. IWScalaModule trait

Create a standard module trait for Mill projects similar to IWScalaProjectPlugin:

  • Set Scala version defaults (prioritizing Scala 3)
  • Configure standard compiler options
  • Setup ScalafmtModule integration
  • Provide standard test configuration with UTest
  • Define publishing configuration for IW Maven repositories

4. Publication Setup

Document and implement standard configuration for publishing to IW Maven repositories:

  • Snapshot vs release handling
  • PomSettings standardization
  • Developer information

5. Example Migration

Create an example showing how to migrate from SBT to Mill:

  • Single project example
  • Multi-module project example
  • Project with JS/JVM cross-building

5. Technical Considerations

  • Mill uses a different file format (build.sc vs build.sbt)
  • Different approach to module definitions and dependencies
  • Task definitions use different syntax and caching model
  • Need to ensure cross-version compatibility
  • Need to handle the ivy dependency notation differences

6. Success Criteria

  • Can build existing projects with Mill using our standardized approach
  • Equivalent functionality to our SBT setup
  • Well-documented migration path
  • Performance improvements over SBT builds

7. Approval

PO Approval: _ Date: _

Tech Lead Approval: _ Date: _