Skip to content

Commit fff4aa8

Browse files
authored
Fix some AsciiDoc format issues in latest blog posts (#5911)
Pull request: #5911
1 parent 8c738df commit fff4aa8

File tree

5 files changed

+40
-36
lines changed

5 files changed

+40
-36
lines changed

website/blog/modules/ROOT/pages/12-direct-style-build-tool.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
= Mill as a Direct Style Build Tool
2-
32
// tag::header[]
43
:author: Li Haoyi
54
:revdate: 10 May 2025

website/blog/modules/ROOT/pages/13-mill-build-tool-v1-0-0.adoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
= Mill Build Tool v1.0.0 Release Highlights
2-
32
:link-github: https://github.com/com-lihaoyi/mill
43
:link-pr: {link-github}/pull
5-
64
// tag::header[]
75
:author: Li Haoyi
86
:revdate: 10 July 2025

website/blog/modules/ROOT/pages/14-bash-zsh-completion.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,15 +230,15 @@ $ foo app<TAB>
230230
$ foo apple
231231
----
232232

233-
However in this scenario the descriptions are entirely ignored by Bash. Because Bash
233+
However, in this scenario the descriptions are entirely ignored by Bash. Because Bash
234234
does not have a concept of tab-complete descriptions, in Bash we only pass the `trimmed`
235235
word-completions to `COMPREPLY` and discard the `raw` lines containing the descriptions.
236236

237237
== Hacking Bash Completion Descriptions
238238

239239
To make Bash show completion "descriptions", we can take advantage of the fact
240240
that the completions are generated dynamically every time we call
241-
`_generate_foo_completions`, and Bash and Zsh only inserts text
241+
`+_generate_foo_completions+`, and Bash and Zsh only inserts text
242242
that is a common prefix to all completion options
243243

244244
[,console]
@@ -257,7 +257,7 @@ The code below implements this: if there is only one completion we trim off the
257257
following the `:` off as normal, but if there's more than one completion we leave the
258258
description intact for the user to see
259259

260-
[source,bash]
260+
[,bash]
261261
----
262262
_complete_foo_bash() {
263263
local IFS=$'\n'
@@ -335,7 +335,7 @@ is a complete word, and if so adding a second "dummy" completion: this makes
335335
the tab-completion ambiguous, which cases Bash and Zsh to print out the completions
336336
and descriptions for the user to see.
337337

338-
Doing this in `_complete_foo_bash` looks like the following:
338+
Doing this in `+_complete_foo_bash+` looks like the following:
339339

340340
[,bash]
341341
----

website/blog/modules/ROOT/pages/15-android-build-flow.adoc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
= Mill as an Alternative Android Build Tool
2-
32
// tag::header[]
43
:author: Vasilis Nicolaou
54
:revdate: 17 September 2025
@@ -20,7 +19,7 @@ In less than a year, Mill went from minimal Android support to producing install
2019
image:AndroidPokedexMultimoduleExample.png[A multi-module Android app built with Mill, showing a list of Pokémon and details for each pokemon.]
2120
2221
23-
=== Why you might prefer this to Gradle
22+
== Why you might prefer this to Gradle
2423

2524
Because Mill’s Android support is built out of simple, object-oriented modules (AndroidModule, AndroidAppModule, etc.), the entire pipeline is transparent and hackable. If something doesn’t work, you don’t need to wait for a plugin update, you can open the task in your IDE, see the source, and tweak it yourself. This is the same design that let us implement end-to-end Android support in under a year, and it’s what makes Mill attractive if you value control and debuggability in your build.
2625

@@ -81,7 +80,7 @@ Android adds a dozen more steps, each involving different tools and formats:
8180

8281
Each step is order-sensitive: resources must be compiled before classes, manifests merged before packaging, APKs signed before installation. With Gradle, these steps are usually hidden inside plugin logic. When we explored Gradle builds, we often had to reverse engineer its behavior to understand what was going on. Mill instead exposes each phase as a target you can call, inspect its sources, or override.
8382

84-
=== The Mill Android Build Pipeline
83+
== The Mill Android Build Pipeline
8584

8685
.Standard Android build pipeline (without Hilt)
8786
[graphviz]
@@ -239,7 +238,7 @@ Run the instrumented tests and watch the app being tested inside the emulator:
239238

240239
image:androidtodo_test.gif[Android Test running inside an emulator, showing the Todo app being tested automatically.]
241240

242-
Let's say you want to know how the apk is built. First, you can check the plan of `androidApk`, i.e which
241+
Let's say you want to know how the apk is built. First, you can check the plan of `androidApk`, i.e. which
243242
tasks it depends on:
244243
[,console]
245244
----
@@ -282,7 +281,7 @@ In addition, due to xref:12-direct-style-build-tool.adoc#_direct_style_builds[Mi
282281

283282
=== Example: tweak the build in your `build.mill`
284283

285-
[source,scala]
284+
[,scala]
286285
----
287286
import mill._
288287
import mill.androidlib._

website/blog/modules/ROOT/pages/16-zero-setup.adoc

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
= Zero-Setup All-in-One Java Tooling via Mill Bootstrap Scripts
2-
32
// tag::header[]
43
:author: Li Haoyi
54
:revdate: 24 September 2025
@@ -17,17 +16,19 @@ The Mill build tool does something interesting here: it requires no system-wide
1716
at all to build your Java projects! You can checkout any codebase built with Mill on a bare
1817
Linux/Mac/Windows machine, build it without any prior setup using it's `./mill` bootstrap
1918
script, and Mill will automatically download and cache itself, any JVMs, and any third-party
20-
libraries and tools necessary. For example, the `./mill __.compile` below is all that is needed
19+
libraries and tools necessary. For example, the `+./mill __.compile+` below is all that is needed
20+
libraries and tools necessary. For example, the `+./mill __.compile+` below is all that is needed
2121
to compile all modules in a newly-checked-out Mill project on a clean machine, greatly
2222
simplifying building your project on diverse dev and CI environments:
2323

24-
```console
24+
[,console]
25+
----
2526
> curl -L https://github.com/com-lihaoyi/cask/archive/refs/heads/master.zip -o cask.zip
2627

2728
> unzip cask.zip && cd cask-master
2829

2930
> ./mill __.compile
30-
```
31+
----
3132
3233
This blog post explores how Mill's zero-install workflow works: the status quo,
3334
the interesting innovations that Mill builds upon, and Mill's unique ideas
@@ -41,9 +42,10 @@ working with Java, Scala, or Kotlin projects.
4142
Perhaps the most common way software is installed is via package managers like `apt`, `yum`, or
4243
`brew`. For example, the incantation to install `git` in an Amazon-Linux machine is:
4344
44-
```console
45+
[,console]
46+
----
4547
> sudo yum install git
46-
```
48+
----
4749
4850
Depending on how nicely the software you are installing is packaged, this may or may not require
4951
additional commands to install transitive dependencies. For example, when setting up a codebase
@@ -98,9 +100,10 @@ commit to the repository root. The bootstrap script embeds the version of Gradle
98100
want to use, and ensures to download and cache that specific version when it is invoked. That means
99101
you can checkout a project's code and run:
100102
101-
```console
103+
[,console]
104+
----
102105
> ./gradlew build
103-
```
106+
----
104107
105108
And be sure you are using the same version of Gradle that everyone else is also using
106109
to build that project. This can be very handy: you now no longer need to worry about installing
@@ -119,13 +122,14 @@ However, one limitation of the Maven and Gradle approach to bootstrap scripts is
119122
on `java` being pre-installed to begin the bootstrapping process. Without `java`, they cannot
120123
run at all, as shown below:
121124
122-
```console
125+
[,console]
126+
----
123127
> curl -L https://github.com/netty/netty/archive/refs/heads/4.2.zip -o netty.zip
124128
> unzip netty.zip
125129
> ./mvnw clean install
126130
/usr/bin/which: no javac in (/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
127131
Error: JAVA_HOME is not defined correctly.
128-
```
132+
----
129133

130134
So even with the `./gradlew` or `./mvnw` bootstrap scripts, working with Gradle or Maven still
131135
ends up being a 1-step installation process: you need to install `java` (and the right version
@@ -148,12 +152,12 @@ similar to `./mvnw` or `./gradle`, but differ in that
148152
by default they do not require `java` pre-installed in order to run. Instead, `./mill` downloads
149153
a native platform-specific binary that then performs the bootstrapping process:
150154

151-
```
155+
----
152156
mill-dist-native-linux-aarch64-1.0.5.exe
153157
mill-dist-native-linux-amd64-1.0.5.exe
154158
mill-dist-native-mac-aarch64-1.0.5.exe
155159
mill-dist-native-mac-amd64-1.0.5.exe
156-
```
160+
----
157161

158162
These `.exe` files are JVM executables, but compiled to native platform-specific binaries using
159163
the xref:7-graal-native-executables.adoc[Graal Native Image compiler]. Apart from the benefits
@@ -167,7 +171,8 @@ machine the bootstrap script it running on, and that logic needs to run in the `
167171
bootstrap script because we need it to run _before_ the native image binary has been downloaded.
168172
The `.sh` version of this implemented using `uname` is as follows:
169173

170-
```bash
174+
[,bash]
175+
----
171176
ARTIFACT_SUFFIX=""
172177
set_artifact_suffix(){
173178
if [ "$(expr substr $(uname -s) 1 5 2>/dev/null)" = "Linux" ]; then
@@ -187,22 +192,24 @@ set_artifact_suffix(){
187192
exit 1
188193
fi
189194
}
190-
```
195+
----
191196

192197
The bootstrap script can then assemble this into a download URL to `curl` down the relevant file
193198
from the Maven Central package repository:
194199

195-
```bash
200+
[,bash]
201+
----
196202
DOWNLOAD_URL="https://repo1.maven.org/maven2/com/lihaoyi/mill-dist${ARTIFACT_SUFFIX}/${MILL_VERSION}/mill-dist${ARTIFACT_SUFFIX}-${MILL_VERSION}.${DOWNLOAD_EXT}"
197203
curl -f -L -o "${DOWNLOAD_FILE}" "${DOWNLOAD_URL}"
198-
```
204+
----
199205

200206
We can then execute the downloaded file, taking any command line arguments given to the bootstrap
201207
script and forwarding them to the native binary:
202208

203-
```bash
209+
[,bash]
210+
----
204211
exec "${DOWNLOAD_FILE}" "$@"
205-
```
212+
----
206213

207214
The snippets above are somewhat simplified - the
208215
https://github.com/com-lihaoyi/mill/blob/1.0.5/dist/scripts/src/mill.sh[actual bootstrap script]
@@ -218,7 +225,7 @@ rest of the way.
218225

219226
Once we execute our native image binary, we then have an opportunity to run real JVM code (as
220227
opposed to sketchy shell scripts) to proceed with bootstrapping. When someone runs
221-
`./mill __.compile` to compile all modules in a repository, and the native image bootstrap
228+
`+./mill __.compile+` to compile all modules in a repository, and the native image bootstrap
222229
launcher has been downloaded as described above, we can then use it to:
223230

224231
1. **Download the JVM that Mill needs to run**, as Graal Native Images have limitations around
@@ -258,11 +265,12 @@ scripts, so Mill handles that using https://github.com/coursier/coursier[Coursie
258265
a common JVM dependency resolution library also used by https://bazel.build/[Bazel] and
259266
https://www.scala-sbt.org/[SBT].
260267

261-
The final bootstrapping process of `./mill __.compile` looks something like this, with the
268+
The final bootstrapping process of `+./mill __.compile+` looks something like this, with the
262269
solid lines indicating local steps in the bootstrapping process, and the dashed lines
263270
indicating downloads from package repositories:
264271

265-
```graphviz
272+
[graphviz]
273+
....
266274
digraph G {
267275
node [shape=box width=0 height=0 style=filled fillcolor=white]
268276
subgraph cluster0{
@@ -287,7 +295,7 @@ digraph G {
287295
"JVM Vendor" -> "user code JVM" [style=dashed arrowhead=empty weight=0]
288296
{"Maven Central"; "JVM Vendor"; "./mill"; rank=same}
289297
}
290-
```
298+
....
291299

292300
Although this may seem like a lot of steps, all of them are completely automatic, and generally
293301
invisible to the user:
@@ -308,7 +316,7 @@ and program installation often involves manual work to set up and maintain, Mill
308316
of dependencies in this bootstrap process is largely hands-off and automated.
309317

310318
Despite the complexity described above, Mill's zero-install bootstrap process means that the user
311-
never needs to deal with any of it. They can immediately start using `./mill __.compile` or
319+
never needs to deal with any of it. They can immediately start using `+./mill __.compile+` or
312320
or any other command on a clean system, and the only indication noticeable
313321
difference would be the first command taking longer than normal and logging indicating that
314322
these downloads are happening. And once caches are warm, running `./mill` feels just as fast
@@ -347,7 +355,7 @@ For the purposes of this article, we simplified and skimmed over a lot of things
347355
- xref:mill::cli/build-header.adoc#_mill_jvm_version[Explicitly pinning the JVM version]
348356
to ensure consistency regardless of what may be installed locally
349357

350-
- Use of `./mill __.prepareOffline`, to force Mill to download dependencies up-front so they
358+
- Use of `+./mill __.prepareOffline+`, to force Mill to download dependencies up-front so they
351359
can be used later without further downloads (e.g. in an internet-restricted environment)
352360

353361
Although this article covers bootstrapping Java and JVM

0 commit comments

Comments
 (0)