@@ -13,6 +13,176 @@ _The changelog below is for tagged, stable releases. For unstable releases,
1313see the list at https://repo1.maven.org/maven2/com/lihaoyi/mill-dist_
1414
1515
16+ [#1-1-0-RC1]
17+ === 1.1.0-RC1
18+ :version: 1.1.0-RC1
19+ :milestone-name: 1.1.0-RC1
20+ :milestone: 132
21+ :prev-version: 1.0.6
22+ _2025-11-04_
23+
24+ `1.1.0-RC1` is the first release candidate of the upcoming `1.1.0` release, due December 2025.
25+ `1.1.0` contains locally-breaking changes but preserves plugin compatibility: you may need to update
26+ your local builds to be compatible, but existing plugins published for 1.x can continue to be
27+ used unchanged. `1.1.0-RC1` is intended to give users a chance to try out the new Mill features,
28+ so any issues can be surfaced and resolved before being stabilized in Mill `1.1.0` final.
29+
30+ The big feature of Mill `1.1.0` is support for config-based modules defined in `build.mill.yaml`
31+ files and single-file `.java`, `.scala`, or `.kt` scripts with a YAML build header. These
32+ are compatible with existing `.mill` module definitions, and are intended for simple projects
33+ or modules that do not need the flexibility of a full programming language to configure their
34+ build.
35+
36+ ==== Config-Based Module Definitions
37+
38+ For example, you can define a simple `JavaModule` an it's test submodule via:
39+
40+ `build.mill.yaml`
41+
42+ ```yaml
43+ extends: [mill.javalib.JavaModule]
44+ mvnDeps:
45+ - "net.sourceforge.argparse4j:argparse4j:0.9.0"
46+ - "org.thymeleaf:thymeleaf:3.1.1.RELEASE"
47+ ```
48+
49+ `test/package.mill.yaml`
50+ ```yaml
51+ extends: [build.JavaTests, mill.javalib.TestModule.Junit4]
52+ mvnDeps:
53+ - "com.google.guava:guava:33.3.0-jre"
54+ ```
55+
56+ This is equivalent to Mill's existing `object foo extends JavaModule{ def mvnDeps = ... }` syntax.
57+ All the normal Mill commands still apply: `./mill compile`, `./mill test`, `./mill assembly`, etc.
58+
59+ We expect that config-based `build.mill.yaml` files will help simplify the use of Mill for
60+ small projects, where the user typically just needs to set some config keys and doesn't need
61+ custom tasks or custom build logic that programmatic module definitions allow. See the docs
62+ for https://mill-build.org/mill/main-branch/javalib/config.html[Config-Based Java Modules]
63+ for more information.
64+
65+ ==== Single-File Scripts
66+
67+ Single-file script modules allow you to write simple programs in a single file with a `//|`
68+ build header comment specifying its configuration. These are useful in scenarios where a separate
69+ build complexity is overkill: student projects, small experiments, prototypes, or command-line
70+ scripts to replace the Bash and Python scripts common throughout the ecosystem.
71+
72+ For example, a single-file script to spawn a simple
73+ https://spring.io/projects/spring-boot/[Spring-Boot] webserver can be defined as shown below:
74+
75+ ```java
76+ //| mvnDeps: [org.springframework.boot:spring-boot-starter-web:3.2.0]
77+ package example;
78+ import org.springframework.boot.SpringApplication;
79+ import org.springframework.boot.autoconfigure.SpringBootApplication;
80+ import org.springframework.web.bind.annotation.*;
81+
82+ @SpringBootApplication
83+ @RestController
84+ public class WebServer {
85+ public static void main(String[] args) throws Exception {
86+ SpringApplication.run(WebServer.class, args);
87+ Thread.sleep(Integer.MAX_VALUE);
88+ }
89+
90+ @PostMapping("/reverse-string")
91+ public String reverseString(@RequestBody String body) {
92+ return new StringBuilder(body).reverse().toString();
93+ }
94+ }
95+ ```
96+
97+ ```console
98+ > ./mill WebServer.java:runBackground
99+
100+ > curl -d 'helloworld' localhost:8080/reverse-string
101+ dlrowolleh
102+ ```
103+
104+ See the docs for https://mill-build.org/mill/main-branch/javalib/script.html[Java Single-File Scripts]
105+ for more information.
106+
107+ Single-file scripts support the three main JVM languages: Java, Scala, and Kotlin. Below
108+ is an example single-file Scala script implementing a recursive web scraper with
109+ https://jsoup.org/[JSoup]:
110+
111+ ```scala
112+ //| mvnDeps: [org.jsoup:jsoup:1.7.2]
113+ import org.jsoup._
114+ import scala.collection.JavaConverters._
115+
116+ def fetchLinks(title: String): Seq[String] = {
117+ Jsoup.connect(s"https://en.wikipedia.org/wiki/$title")
118+ .header("User-Agent", "Mozilla/5.0 (compatible; JsoupBot/1.0; +https://example.com/bot)")
119+ .get().select("main p a").asScala.toSeq.map(_.attr("href"))
120+ .collect { case s"/wiki/$rest" => rest }
121+ }
122+
123+ @main
124+ def main(startArticle: String, depth: Int) = {
125+ var seen = Set(startArticle)
126+ var current = Set(startArticle)
127+ for (i <- Range(0, depth)) {
128+ current = current.flatMap(fetchLinks(_)).filter(!seen.contains(_))
129+ seen = seen ++ current
130+ }
131+
132+ pprint.log(seen)
133+ }
134+ ```
135+
136+ ```console
137+ > ./mill HtmlScraper.scala --start-article singapore --depth 1
138+ ...
139+ "Hokkien",
140+ "Conscription_in_Singapore",
141+ "Malaysia_Agreement",
142+ "Government_of_Singapore",
143+ ...
144+ ```
145+
146+ Mill's single-file Scala script modules are an alternative to
147+ http://scala-cli.virtuslab.org/[Scala-CLI] scripts. They are also a replacement for
148+ https://ammonite.io/[Ammonite Scala Scripts], and bundle a similar set of libraries
149+ (OS-Lib, uPickle, Requests-Scala, etc.). See the docs for
150+ https://mill-build.org/mill/main-branch/scalalib/script.html[Scala Single-File Scripts]
151+ for more information
152+
153+ ==== Other Breaking Changes
154+
155+ * Cut down the number of Mill file suffixes to just `.mill`, and `.mill.yaml` ({link-pr}/6016[#6016])
156+ ** This means `.sc` and `.mill.scala` will no longer be recognized as build files. Please rename
157+ any build files using those suffixes to `.mill` instead
158+
159+ * Avoid using system java unless explicitly specified, instead use latest LTS Java version unless
160+ explicitly overridden with `system` ({link-pr}/6005[#6005]). This is intended to improve the
161+ reproduce-ability of Mill projects built across different environments.
162+ ** Mill instead uses a fixed default version `zulu:21` when no `mill-jvm-version` is specified.
163+ Please set an explicit `//| mill-jvm-version:` in your build header to specify the version
164+ you need, or revert to the old default of using the environmental `java` installation
165+ via `//| mill-jvm-version: system`
166+
167+ ==== Other Changes
168+
169+ * Add builtin support for `jshell` command on ``JavaModule``s and `./mill --jshell` flag to open
170+ a Java REPL ({link-pr}/5984[#5984])
171+ * Re-enable `./mill --repl` to open a Scala REPL not connected to any specific module ({link-pr}/5983[#5983])
172+ * Add `mill-jvm-index-version` to build header keys ({link-pr}/6085[#6085])
173+ * Allow users to disable some modules in BSP via `def enableBsp = false` ({link-pr}/6065[#6065])
174+ * Fix Scala Native link logs in server-client mode ({link-pr}/6053[#6053])
175+ * Add proper error message when circular task dependency is detected ({link-pr}/6044[#6044])
176+ * Many improvements to `./mill init` build importer ({link-pr}/5428[#5428])
177+ * Repair CLI option --help-advanced ({link-pr}/5993[#5993])
178+ * Support for HTTP Proxy settings in the Coursier dependency downloader ({link-pr}/5971[#5971])
179+ * Start of a dedicated documentation page and examples for using Mill to build
180+ Spring-Boot projects (https://mill-build.org/mill/main-branch/javalib/springboot-examples.html[link]).
181+ This is currently pretty bare, but will get fleshed out as we move towards `1.1.0` final
182+ * Many improvements to Mill's Android build support ({link-pr}/5887[#5887], {link-pr}/5888[#5888],
183+ {link-pr}/5926[#5926], {link-pr}/5963[#5963], {link-pr}/5997[#5997], {link-pr}/5980[#5980],
184+ {link-pr}/6063[#6063], {link-pr}/6073[#6073])
185+
16186[#1-0-6]
17187=== 1.0.6
18188:version: 1.0.6
0 commit comments