Skip to content

Refactor Mill to use mill.api.opt API#6800

Closed
lefou wants to merge 81 commits intocom-lihaoyi:mainfrom
lefou:tr-refactor-use-opt-api
Closed

Refactor Mill to use mill.api.opt API#6800
lefou wants to merge 81 commits intocom-lihaoyi:mainfrom
lefou:tr-refactor-use-opt-api

Conversation

@lefou
Copy link
Copy Markdown
Member

@lefou lefou commented Feb 7, 2026

Follow-up PR to #6129

A Proof-of-concept refactoring of various modules that contain configuration data potentially containing paths. This breaks the current binary compatibility to showcase how the new API could be used. It is not set in stone and can be separated or reverted or whatever is necessary to get the API additions merged.

All tasks containing configuration data that also may contain file or directory paths should use the Opt class or the container type Opts or OptMap.

Most prominent tasks are:

  • javacOptions: T[Seq[String]] --> T[Opts]
  • scalacOptions: T[Seq[String]] --> T[Opts]
  • kotlincOptions: T[Seq[String]] --> T[Opts]
  • forkArgs: T[Seq[String]] --> T[Opts]
  • forkEnv: T[OptMap] --> T[OptMap]

Since the JSON serialization for paths re-use the respective upickle-serializers, the root path mapping of PR #6031 may also work here (Resulting is paths like $MILL_OUT/task/to/jar.dest/out.jar).

@lefou lefou added later The issue is still relevant, but has now high priority right now compat-breaker A PR breaks compatibility and needs to wait till we prepare a major release labels Feb 7, 2026
@lefou lefou changed the title Refactor Mill to use mill.api.opt API Refactor Mill to use mill.api.opt API Feb 7, 2026
@lefou lefou closed this Feb 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compat-breaker A PR breaks compatibility and needs to wait till we prepare a major release later The issue is still relevant, but has now high priority right now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant