Skip to content

0.11.0

Compare
Choose a tag to compare
@Ammonite-Bot Ammonite-Bot released this 07 Jun 11:19
· 328 commits to main since this release

Mill 0.11.0 is a breaking release with a focus on polish. This release fixes many long-standing sharp edges that could not be fixed without breaking backwards compatibility, and cleans up the Mill codebase for better maintainability and so we can offer better compatibility guarantees going forward. User-facing improvements include an overhauled documentation-site, much easier cross builds, faster/more-robust bootstrapping, better error messages. It aims to do everything Mill already does, but better.

One thing especially worth calling out is that the Mill documentation has been overhauled, with new sections Scala Build Examples, Scala Module Configuration, Web Build Examples, and many more. These examples all live in the example/ folder, and zips containing them can be downloaded from Github Releases to easily try them out or bootstrap a new project. This should make it much easier to learn Mill: what features exist, why they are necessary, and how you can use them in a realistic setting to configure a Mill build for a variety of real-world scenarios. All examples are executable, and are executed as part of Mill's CI to ensure they are correct and up to date. The Mill Scaladoc is now also aggregated and published with each release

Major changes that may require migration:

  • The mill._ import now has to be included explicitly at the top of your build.sc, and is no longer added implicitly

  • Mill no longer runs the build.sc file using Ammonite, and instead bootstraps build.sc itself using Mill.

    • Any build.sc compilation "pre-def" customization that may have been done using Ammonite's import $file.foo or import $exec.foo now has to be done using Mill meta-builds.
    • Normal import $file and import $ivys should continue working
  • The ./mill bootstrap script now downloads Mill from Maven Central rather than Github Releases.

    • This should help improve the robustness of Mill bootstrapping, such that Github outages would no longer cause Mill bootstrapping to fail (Maven Central outages cause bootstrapping failure regardless).
    • We will continue publishing the Mill artifacts to Github Releases for compatibility, but please update your ./mill script to the latest version (from this release) via curl -L https://github.com/com-lihaoyi/mill/releases/download/0.11.0/0.11.0 -o mill to benefit from this
  • Cross build syntax has been overhauled:

    • Rather than using class Foo(crossValue: T) extends Module, they are now defined by trait Foo extends Cross.Module[T].
    • Cross modules no longer add their cross-keys to the millSourcePath by default. If you previously had a def millSourcePath = super.millSourcePath / os.up, you must remove it. If you previously did not have that, you must add def millSourcePath = super.millSourcePath / crossValue
    • See the Cross-Scala Version Modules or Cross Build Documentation for more details of how things work now.
    • PlatformScalaModule has been introduced to simplify cross JVM/JS/Native modules: automatically inferring the jvm/js/native platformSuffix from the module path, automatically adding -${versionSuffix} source folders, and automatically removing the platformSuffix from the publish artifact path.
    • Test modules now automatically follow the source-folder layout of their parent module (#2531), removing much of the need for manually override def sources in your test modules to set up cross version/platform sources
    • See the Publishing Cross-Platform Scala Module or Publishing Cross-Platform Scala Module Alternative documentation to see how you can use these
  • Target resolution now instantiates modules substantially more lazily, often not instantiating them at all unless strictly necessary.

    • This may help improve startup performance for working with large build files
    • This means that for modules who override def millModuleDirectChildren, you need to additionally inherit from the marker trait DynamicModule so Mill knows to instantiate the module and use your override during resolution
  • The mill.modules package has been removed, with functionality moved to mill.util and mill.scalalib

  • The Tests trait has been removed, as it relies on trait shadowing that will be removed in Scala 3. Please use ScalaTests/ScalaJSTests/ScalaNativeTests instead

  • The ScalaModule#run command now takes a args: Task[Args] instead of args: String*, allowing it to be easily used in the implementation of tasks. example

  • RunScript.resolveTasks has been replaced by mill.resolve.Resolve.{Segments,Tasks}

Example Build Migrations

Below is a link the to 0.10.x -> 0.11.0 build migrations for a number of the com.lihaoyi projects, in order from simplest to the more complex. These may be useful to skim through to see what kind of changes a "typical" Mill project would need to do migrating to 0.11.0

Changelog

Merged Pull Requests (since 0.11.0-M11)

  • Renamings for conciseness: ScalaModuleTests -> ScalaTests, InnerCrossModule -> CrossValue by @lihaoyi in #2572
  • Add mill.define.DynamicModule to allow custom overriding of millModuleDirectChildren by @lihaoyi in #2574
  • Bump Scala to 2.13.11 and use pre-published bridges by @lihaoyi in #2575
  • Remove mill._ magic import from builds by @lolgab in #2418

Full Changelog: 0.11.0-M11...0.11.0

All Merged Pull Requests (since 0.10.10)

  • fix: remove index.scip by @ckipp01 in #2172
  • Update Mill to 0.10.10 by @lefou in #2174
  • Cleanup deprecated API, removed API, adapted call sites by @lefou in #2031
  • Restrict Cross parameter to be of type Module by @lefou in #2048
  • Update os-lib to 0.9.0 by @scala-steward in #2176
  • Consolidated artifact and platform suffix handling by @lefou in #2025
  • MultiLogger refactoring to better control debugEnabled by @lefou in #2179
  • Pass more settings from ScalaJSModule to its Tests by @lolgab in #2180
  • Remove deprecated scalajsmodule apis by @lolgab in #2181
  • Don't include resources into compileClasspath. by @vic in #1811
  • Removed some deprecated coursier helper methods by @lefou in #2184
  • Use classpath PathRefs hashCode as cache key for Scala.js worker by @lolgab in #2183
  • Use classpath PathRefs hashCode as cache key for Zinc worker by @lolgab in #2185
  • Use PathRef hashCode for workers caches by @lolgab in #2189
  • Doc: Fix download URL of Mill bootstrap script by @lefou in #2192
  • Update Scala Native API and worker by @lolgab in #2193
  • Update coursier to 2.1.0-RC3 by @scala-steward in #2194
  • Update scala-library to 2.12.17 by @scala-steward in #2195
  • Document ivyDepsTree and transitive dep management by @IdiosApps in #2175
  • Add in ability to pass in whatDependsOn to JavaModule.ivyDepsTree by @ckipp01 in #2191
  • Bind cross-versions to the context of the originating module by @lefou in #1574
  • Update trees to 4.7.0 by @scala-steward in #2201
  • Tooling maintenance by @lefou in #2208
  • Fixed typo in package of mill.scalalib.BoundDep by @lefou in #2214
  • Use millModuleDirectChildren consistently everywhere by @lolgab in #2207
  • Update trees to 4.7.1 by @scala-steward in #2211
  • Update coursier to 2.1.0-RC4 by @scala-steward in #2209
  • Accessing repository credentials via T.env by @seroperson in #2203
  • Update requests to 0.8.0 by @scala-steward in #2216
  • Support def scalaJSSourceMap: T[Boolean] by @lolgab in #2215
  • Added default argument to ivyDepsTree by @lefou in #2217
  • Update scalafmt-core, scalafmt-dynamic to 3.6.1 by @scala-steward in #2219
  • Fix scalafmt tests by @lefou in #2222
  • Make LevenshteinDistance a object by @lolgab in #2220
  • Remove deprecations from Evaluator and EvaluatorState by @lolgab in #2221
  • Update scalafmt-dynamic to 3.6.1 by @scala-steward in #2223
  • Add a changelog link to the published pom.xml by @lefou in #2228
  • Added test for ScalaModule.semanticDbData by @lefou in #2229
  • Support non-local Java compiler use in mixed Java/Scala compilation by @lefou in #2231
  • SemanticDB data generation for Java modules by @lefou in #2227
  • Add support for scalaJSOutputPatterns by @lolgab in #2233
  • Update semanticdb to 4.7.1 by @lefou in #2234
  • Support for Java 17 in all tests and CI by @lefou in #1724
  • BSP documentation updates by @lefou in #2239
  • Add a documentation link to the coursier resolution failure output by @lbunschoten in #2232
  • Use the bsp4j version as BSP protocol version by @lefou in #2240
  • Update upickle to 3.0.0-M1 by @lefou in #2246
  • Update Ammonite to 2.5.6 by @lefou in #2247
  • Dependency maintenance and bumps by @lefou in #2248
  • Fixed mill cmd in CI action by @lefou in #2249
  • Add @nowarn to generated ammonite script's millDiscover by @lolgab in #2242
  • Drop Scala.js 0.6 support and removed some deprecated API by @lefou in #2218
  • Refactored BSP module and use isolated classloading for implementations by @lefou in #2245
  • Update utest to 0.8.1 by @lefou in #2253
  • Set new MiMa baseline by @lefou in #2255
  • Fixed module cleaning and added tests by @lefou in #2257
  • Gitlab maven repo error message by @aheiska in #2103
  • Update jna, jna-platform to 5.13.0 by @scala-steward in #2261
  • Docs: Fix runIvyDeps code example by @nightscape in #2266
  • Update semanticdb-scalac, trees to 4.7.2 by @scala-steward in #2270
  • Also bump semanticDB version in antora.xml by @lefou in #2271
  • Change out/-layout from foo.overridden to foo.super by @lefou in #2262
  • Use unique out path for private named tasks - fixes #2107 by @lefou in #2108
  • Update coursier to 2.1.0-RC5 by @scala-steward in #2275
  • Make ScalaJS and Native Tests modules extend ScalaModule by @lolgab in #2274
  • fix generation of library paths containing : for Windows by @unkarjedy in #2273
  • Update semanticdb-scalac, trees to 4.7.3 by @scala-steward in #2277
  • Set new MiMa baseline by @lefou in #2278
  • Update default Mill version in wrapper script to 0.10.10 by @lefou in #2279
  • Updated changelog and build setup for 0.10.11 by @lefou in #2282
  • Update Mill to 0.10.11 by @scala-steward in #2284
  • SemanticDB for Java improvements by @lefou in #2288
  • BSP: Improve support for mill-build module and the build.sc by @lefou in #2291
  • Update nir, test-runner, tools, util to 0.4.10 by @scala-steward in #2292
  • Update scalajs-linker, ... to 1.13.0 by @scala-steward in #2290
  • Added another retry candidate for coursier resolution by @lefou in #2287
  • Fetch more tooling deps in prepareOffine by @lefou in #2294
  • Update semanticdb-java to 0.8.11 by @scala-steward in #2298
  • Added some upgrade notes by @lefou in #2301
  • Update semanticdb-java to 0.8.13 by @scala-steward in #2303
  • Update upickle to 3.0.0-M2 and Ammonite to 3.0.0-M0-1-beb96bfb by @lefou in #2305
  • Code review and cleanups by @lefou in #2307
  • Update junixsocket to 2.6.2 by @lefou in #2309
  • Support reporting of all compilation problems by @lefou in #2297
  • Post release preparations: MiMa baseline by @lefou in #2310
  • Add Weaver TestModule by @lolgab in #2311
  • Fix typo in Weaver scaladoc by @lolgab in #2313
  • Update jarjar-abrams-core to 1.8.2 by @scala-steward in #2316
  • Fix concurrency issue with test event reporting by @ollyw in #2314
  • Update semanticdb-scalac, trees to 4.7.4 by @scala-steward in #2318
  • Update scalac-scoverage-domain, ... to 2.0.8 by @scala-steward in #2319
  • Update coursier to 2.1.0-RC6 by @scala-steward in #2321
  • No longer inherit ammonite cli parser config by @lefou in #1960
  • Move JarManifest to mill.api by @lefou in #2325
  • PathRef: Hide hard to evolve case class properties by @lefou in #2327
  • Update log4j-core to 2.20.0 by @scala-steward in #2330
  • Update semanticdb-scalac, trees to 4.7.5 by @scala-steward in #2333
  • Support JsEnvConfig.Selenium in ScalaJSModule by @lolgab in #2329
  • Update de.tobiasroeser.lambdatest to 0.8.0 by @scala-steward in #2336
  • Call overridden task from ScalaModule.mapDependencies by @lefou in #2338
  • Allign source file locations with packages by @lefou in #2343
  • Update ammonite, ammonite-terminal to 3.0.0-M0-3-c2d1e706 by @scala-steward in #2317
  • Use a local .config dir for mill-version config by @lefou in #2334
  • Update os-lib to 0.9.1 by @lefou in #2345
  • Doc: Remove extra parenthesis and fixed typo by @daddykotex in #2346
  • Do not add Cross matrix items to millSourcePath by @lefou in #2347
  • Re-added --color and --predef cli args by @lefou in #2352
  • Set new MiMa baseline: 0.11.0-M6 by @lefou in #2351
  • Update Ammonite to 3.0.0-M0-5 and uPickle to 3.0.0 by @lihaoyi in #2354
  • Support automatic PathRef validation for cached targets by @lefou in #2328
  • Update coursier to 2.1.0 by @lefou in #2357
  • Process ivy dependency includes in MillBuildModule by @lefou in #2362
  • Doc: Added JMH plugin to navigation bar by @lefou in #2363
  • Update scalameta trees and semanticdb to 4.7.6 by @lefou in #2364
  • Update nir, test-runner, tools, util to 0.4.11 by @scala-steward in #2367
  • Integrated changelog for release 0.10.12 and build docs for it by @lefou in #2373
  • Update Mill to 0.10.12 by @lefou in #2375
  • CI: cancel older running jobs for pull requests by @lefou in #2378
  • Added a task to install Mill into ~/.cache/mill/download by @lefou in #2384
  • Update scala native tools to 0.4.12 by @scala-steward in #2382
  • Add boolean flag to search for proto files in dependencies. Update docs. by @carlosedp in #2380
  • Improve binary compatibility by @lefou in #2379
  • CI: only auto-build main and pull requests by @lefou in #2385
  • Use scala-parser-combinators:1.1.2 on scala 2, 2.1.0 otherwise by @mrdziuban in #2389
  • BSP: Support mainClasses in run and test environments by @lefou in #2387
  • Reworked PathRef.revalidate handling based on DynamicVariable by @lefou in #2392
  • Add nativeDump to ScalaNativeModule by @lolgab in #2391
  • Force a newer transitive snakeyaml version by @lefou in #2335
  • BSP: Remove query part from target identitfier URI and some cleanups by @lefou in #2394
  • ScalaJSModule: Deprecate fastOpt and fullOpt by @lefou in #2326
  • Post release chore by @lefou in #2395
  • Updated scalafmt to 3.7.3 and reformatted code base by @lefou in #2397
  • Update scalafmt-dynamic to 3.7.3 by @lefou in #2398
  • Update play version to 2.8.19 by @lefou in #2399
  • Remove Ammonite as a dependency, handle script running and bootstrapping ourselves by @lihaoyi in #2377
  • Add error if you define other modules outside top level root module by @lihaoyi in #2401
  • Combine Router and Discover, add some docs by @lihaoyi in #2403
  • Add 1-persistent-targets and 2-worker-task examples by @lihaoyi in #2404
  • Make Target type abstract to allow overriding by different concrete implementations by @lihaoyi in #2402
  • Update ammonite, ammonite-terminal to 3.0.0-M0-6-34034262 by @scala-steward in #2400
  • Reformat source code by @lefou in #2408
  • Reenabled CI checks: bin-compat and formatting by @lefou in #2407
  • Update coursier interface to 1.0.14 by @scala-steward in #2410
  • Rename CI jobs to reduce boilerplate in PR checks UI by @lihaoyi in #2411
  • Make use of MainArgs in example/basic/ by @lihaoyi in #2409
  • Bump Cask to 0.9.1 in example/web/ by @lihaoyi in #2413
  • Properly use sig of millBootClasspath if there is no meta build by @lefou in #2421
  • Update uPickle to 3.1.0 by @lihaoyi in #2423
  • Move BuildInfo from sources into resources, defer use of resources during compilation by @lihaoyi in #2425
  • Add some helpers to simplify cross-version/cross-platform modules by @lihaoyi in #2406
  • Cleanup stream handling in PrintLogger to try and avoid over-written lines by @lihaoyi in #2428
  • Pre compile zinc compiler interface for common Scala versions by @lihaoyi in #2424
  • Fix BSP regressions and improved resource file handling by @lefou in #2420
  • Add zio-test to TestModule by @carlosedp in #2432
  • enforce stdout/stderr contents in .local example/integration tests by @lihaoyi in #2435
  • Add example.web[webapp-cache-busting] by @lihaoyi in #2436
  • CI: Separate format and bincompat checks by @lefou in #2438
  • CI: Reused a shared workflow for building by @lefou in #2440
  • CI: ignore failing bincompat reports by @lefou in #2443
  • Update windows-ansi to 0.0.5 by @alexarchambault in #2442
  • Docs & Changelog for 0.11.0-M8 by @lihaoyi in #2439
  • Update coursier to 2.1.2 and coursier-interface to 1.0.15 by @lefou in #2445
  • Removed unused asciidoctorj dependency by @lefou in #2446
  • Allow Cross module types to be traits for greater regularity and less boilerplate at callsite by @lihaoyi in #2427
  • Fix uploadToGithub command by @lihaoyi in #2447
  • Fix spurious T.command definitions must have 1 parameter list error by @lihaoyi in #2451
  • Consolidate Docsite/Examples/Scaladoc/Giter8 by @lihaoyi in #2448
  • Post release chore by @lefou in #2454
  • Filter out non-script paths to avoid blow up due to invalid path format by @lihaoyi in #2471
  • Update testng to 7.5.1 by @lefou in #2469
  • Clean up Resolve.scala and related code to improve rigor and error reporting by @lihaoyi in #2453
  • Update semanticdb-scalac and trees to 4.7.7 and semanticdb-java to 0.8.16 by @lefou in #2470
  • Update mill-vcs-version to 0.3.1 by @lefou in #2472
  • Update mill-mima to 0.0.19 by @lefou in #2473
  • Fix crash aggregating failures by @lolgab in #2478
  • Break up main.core and main.test by @lihaoyi in #2475
  • Re-introduce Mill special handling of ivydeps, overhaul test classpath management to allow testing by @lihaoyi in #2476
  • Update scalajs-linker, ... to 1.13.1 by @scala-steward in #2431
  • Make run command arguments Tasks by @lihaoyi in #2452
  • Consolidate manual testing, automated testing, CI and release configurations by @lihaoyi in #2483
  • Support import $repo magic import by @lefou in #2480
  • Put BSP timing tests behind a retry, as these fail sometimes on Windows by @lefou in #2490
  • Add ability to watch T.inputs and interp.watchValues by @lihaoyi in #2489
  • Cleanup mill.eval by @lihaoyi in #2498
  • Support Java 20 by @lefou in #2501
  • Make --import flag work again by @lihaoyi in #2502
  • Enable inspect, path, etc. on T.commands without needing to pass in args in common cases by @lihaoyi in #2500
  • Tweak CI to improve UI display by @lihaoyi in #2505
  • Added deprecated type aliases for mill.define.Target by @lefou in #2507
  • Format build.sc by @lefou in #2508
  • Update semanticdb-java to 0.8.18 by @scala-steward in #2495
  • Update coursier to 2.1.3 by @scala-steward in #2503
  • More refactoring for Resolve logic by @lihaoyi in #2511
  • Update coursier interface to 1.0.16 by @scala-steward in #2504
  • Try to fix windows CI by @lihaoyi in #2512
  • Added a deprecated type alias for removed EvaluatorScopts by @lefou in #2491
  • Kill mill.modules package by @lihaoyi in #2513
  • Re-use MillBuildRootModule for BSP by @lihaoyi in #2415
  • Update mill-vcs-version to 0.3.1-5-910047 by @lefou in #2510
  • Improve VSCode/BSP integration by @lihaoyi in #2514
  • Cleanups for MillBuildServer by @lihaoyi in #2518
  • Enable warnings in build.sc, overhaul Agg to avoid triggering spurious deprecation warnings by @lihaoyi in #2519
  • CI: Refactor more common parts into workflow include by @lefou in #2509
  • More tweaks to simplify BSP logic by @lihaoyi in #2521
  • Updated mill-vcs-version for bootstrap setup by @lefou in #2524
  • Print out CLI help message when inspecting commands by @lihaoyi in #2522
  • Update zinc to 1.8.1 by @lefou in #2515
  • Reviewed and updated some target types by @lefou in #2494
  • Make mill-build folder opt in via import $meta._ by @lihaoyi in #2527
  • Swap over to mill-build.com domain name by @lihaoyi in #2528
  • Post release chore by @lefou in #2529
  • Update mill-vcs-version to 0.3.1-6-e80da7 by @lefou in #2530
  • Use showNamed output format for show with more than one item by @lihaoyi in #2532
  • Rebootstrap Mill on 0.11.0-M9 by @lihaoyi in #2463
  • Generalize handling of source folders in cross-platform/version scenarios by @lihaoyi in #2531
  • Add Agg.when operator by @lihaoyi in #2535
  • Publicize PlatformScalaModule#platformScalaSuffix by @lihaoyi in #2534
  • Make mill.backgroundwrapper a JavaModule again by @lihaoyi in #2538
  • Backtick wrap identifiers in generated code where necessary by @lefou in #2492
  • Move mill.BuildInfo tomill.main.BuildInfo by @lihaoyi in #2537
  • Make mill.define.Module a trait to allow abstract/virtual module lazy vals to be traits rather than classes by @lihaoyi in #2536
  • Clean up mill.eval even more by @lihaoyi in #2542
  • Silence git stderr output by @lefou in #2541
  • Tweak windows CI by @lihaoyi in #2544
  • Re-enable Acyclic enforcement and fix existing violations by @lihaoyi in #2543
  • Post release chore by @lefou in #2547
  • Rebootstrap Mill on 0.11.0-M10 by @lihaoyi in #2551
  • Cleanup build sc by @lihaoyi in #2555
  • Fix invalidation of workers pulled in from import $ivy when build.sc is modified by @lihaoyi in #2553
  • Update mill-github-dependency-graph to 0.2.3 by @lolgab in #2552
  • Add example/basic/2-custom-build-logic by @lihaoyi in #2559
  • Removed inner Tests traits to avoid no longer supported shadowing by @lefou in #2558
  • Tighten up compatibility promises and make them explicit by @lihaoyi in #2556
  • Distribute Mill Assembly via Maven Central by @lihaoyi in #2560
  • Fixed some compiler warnings, Enabled -Xsource:3 by @lefou in #2557
  • Update coursier to 2.1.4 by @lefou in #2563
  • Update scalameta-trees/semanticDB to 4.7.8 by @lefou in #2564
  • Tooling: Update scalafmt to 3.7.4 by @lefou in #2566
  • Update scalafmt to 3.7.4 by @lefou in #2565
  • Update zinc to 1.9.0 by @lefou in #2567
  • issue-408 - server timeout setting configurable through envs by @Ivoyaa in #2550
  • Enable buildInfoStaticCompiled on ScalaJSModule and ScalaNativeModule by @lolgab in #2562
  • Update thirdparty tests, make subprocess testrunner run user code in root classloader by @lihaoyi in #2561
  • Make contrib.buildinfo use compileModuleDeps rather than moduleDeps by @lihaoyi in #2568
  • Renamings for conciseness: ScalaModuleTests -> ScalaTests, InnerCrossModule -> CrossValue by @lihaoyi in #2572
  • Add mill.define.DynamicModule to allow custom overriding of millModuleDirectChildren by @lihaoyi in #2574
  • Bump Scala to 2.13.11 and use pre-published bridges by @lihaoyi in #2575
  • Remove mill._ magic import from builds by @lolgab in #2418

New Contributors

Full Changelog: 0.10.10...0.11.0