Skip to content

Commit 322b5ab

Browse files
committed
Added screenshots and reproducible example in try out
1 parent bf9fd4f commit 322b5ab

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed
207 KB
Loading
296 KB
Loading
158 KB
Loading

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

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ _{author}, {revdate}_
1010
Until recently, Gradle was the only realistic option for Android builds. Today, Mill - a fast, predictable build tool for Java, Scala, and Kotlin - can build Android applications end-to-end.
1111

1212
In less than a year, Mill went from minimal Android support to producing installable APKs for projects as complex as xref:mill::android/hilt-sample.adoc[the Android Architecture Samples] and https://github.com/vaslabs/Pokedex_Compose_Multi_Module/tree/testing-mill[multi-module apps] with xref:mill::android/java.adoc#_using_third_party_native_libraries[native code] and xref:mill::android/compose-samples.adoc[Jetpack Compose].
13+
// end::header[]
14+
Multi-module Pokedex sample app (https://github.com/NicosNicolaou16/Pokedex_Compose_Multi_Module[original], https://github.com/vaslabs/Pokedex_Compose_Multi_Module/tree/testing-mill[with mill])
15+
image:AndroidPokedexMultimoduleExample.png[A multi-module Android app built with Mill, showing a list of Pokémon and details for each pokemon.]
1316

1417
This was possible because Mill’s design, incremental, transparent, and extensible maps surprisingly well onto Android’s intricate build process.
1518

@@ -146,35 +149,60 @@ The diagram above still doesn’t tell the whole story! It shows a typical build
146149

147150
We cover a lot of these architecture styles in various Android examples, based on xref:mill::android/java.adoc[Java], xref:mill::android/kotlin.adoc[Kotlin] and third party integration examples covering xref:mill::android/compose-samples.adoc[Android Compose], xref:mill::android/android-native-example.adoc[Android Native] and xref:mill::android/hilt-sample.adoc[Dependency Injection with Hilt].
148151

152+
Endless tunnel sample app
153+
image:AndroidEndlessTunnelExample.png[An Android app built with Mill using native code, showing a 3D tunnel effect.]
149154

150155
== Try it out
151156

152157
Mill’s Android support is still young, but it already covers the full build pipeline: resource compilation, manifest merging, packaging, signing, running, and even testing on emulators. This is possible thanks to Mill’s core design, fast, incremental, transparent, and extensible, which maps Android’s intricate flow into understandable, inspectable build targets.
153158

154159
If you’re curious, the best way to appreciate this is to try it yourself:
155160

156-
Clone one of the example Android projects (Compose, Native code, Hilt DI, etc).
161+
Get the `architecture-samples` containing the Todo App.
157162

158-
Package the app with
159-
[,console]
163+
[source,bash]
160164
----
161-
$ ./mill app.androidApk
165+
git clone [email protected]:android/architecture-samples.git
166+
cd architecture-samples
162167
----
163168

169+
Install mill
164170

165-
Create and run an emulator with
166-
[,console]
171+
[source,bash]
167172
----
168-
$ mill app.createAndroidVirtualDevice
169-
$ mill app.startAndroidEmulator
173+
curl -L https://repo1.maven.org/maven2/com/lihaoyi/mill-dist/1.0.4/mill-dist-1.0.4-mill.sh -o mill
174+
chmod +x mill
175+
echo "//| mill-version: 1.0.4-22-bcbf85" > build.mill
176+
./mill version
170177
----
171178

172-
Then install it with
173-
[,console]
179+
Configure the mill build
180+
181+
[source,bash]
182+
----
183+
curl https://raw.githubusercontent.com/com-lihaoyi/mill/186ede23a7e8f2b8f4da80877ed5f316cece9477/example/thirdparty/androidtodo/build.mill >> build.mill
184+
----
185+
186+
Start the emulator and run the app
187+
188+
[source,bash]
174189
----
175-
$ mill app.androidInstall
190+
./mill show app.createAndroidVirtualDevice
191+
./mill show app.startAndroidEmulator
192+
./mill show app.androidInstall
193+
./mill show app.androidRun --activity com.example.android.architecture.blueprints.todoapp.TodoActivity
176194
----
177195

196+
Run the instrumented tests and watch the app being tested inside the emulator:
197+
198+
[source,bash]
199+
----
200+
./mill app.androidTest
201+
----
202+
203+
The Android Todo App built with Mill
204+
image:AndroidTodoExample.png[The Todo app built with Mill, showing a list of tasks and a button to add new tasks.]
205+
178206
You may also inspect xref:mill::android/android-initial-setup.adoc[the getting started docs] to find out more.
179207

180208
We’d love feedback from the Android community, whether it’s bug reports, feature requests, or success stories. If you’ve ever wished Android builds felt less like a black box, Mill is worth a look.

0 commit comments

Comments
 (0)