-
-
Notifications
You must be signed in to change notification settings - Fork 417
Blog Post: How does mill build android apps #5776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice article. I think the diagrams are a real value, even to non-Mill users. I once had a rudimentary android build working with sbuild
(my personal predecessor of Mill) around 2014, where Android builds where simpler, but even then, it was hard to get these dependencies out from pure documentation. Reverse engineering is required to get the whole picture and your work here is really appreciated.
thank you! |
Some comments on this:
|
55e3233
to
322b5ab
Compare
Thanks. I've made the adjustments. In some place, I put comparison with Gradle and in other a generic "other build tools", I'm not sure which one you'd prefer, but when you get the chance, let me know of any more feedback |
_{author}, {revdate}_ | ||
|
||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave out fast, predictable
here. Whether or not it's true, it sounds too salesly. Let's just say "Mill provides an alternative to Gradle that is easier to use and learn", and hope that enough people have had trouble with Gradle that they empathize
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]) | ||
image:AndroidPokedexMultimoduleExample.png[A multi-module Android app built with Mill, showing a list of Pokémon and details for each pokemon.] | ||
|
||
Unlike Gradle, where build steps are buried inside plugins and DSL magic, Mill exposes each Android step as a task you can run, override, or extend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any angle we can discuss of Mill being easier to setup v.s. Gradle in terms of the number of manual steps? Or more performant, in terms of time-to-update-the-app? We should try to discuss some user-facing benefits in a way people can see for themselves why it's cool, rather than just "Mill is fast and predictable because we say so", so they are more engaged for the internal technical discussion below
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]. | ||
// end::header[] | ||
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a bullet-point list, so it's easier to skim: each bullet can either be a technical feature or tool-integration, or a demo or example app that we got working.
That way users can quickly look at it and see that it hits many of the requirements for day-to-day work developing Android apps, v.s. now they have to read a sentence and try to parse the important parts out of it
|
||
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. | ||
|
||
What makes this different from other build tools is control: every build step is a visible Mill task, easy to run on its own, inspect, or override. That means you can debug problems faster, adapt the pipeline to your project’s needs, and extend it without fighting opaque built-in or plugin logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The obvious question to me here is: is this not true of Gradle? Maybe it's not, but you have to show that in more detail for me to understand why Mill is cool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, yeah I have an idea how to show it and connect it with the diagram above (i.e. using inspect) . I think, at least empirically, it's true for gradle too, as a lot of times it wasn't obvious what steps were followed to build android apps and we had to do some reverse engineering. but again, I'm not an expert in gradle to know any tools to inspect its internals, but that's another point, you shouldn't be an expert to use and extend the tool, so I think I'll demonstrate the points in my comments here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the output of plan
, visualizePlan
, visualize
or path
can help showing what's going on under the hood. It will also show what default tools users have to explore an unfamiliar project.
thanks for the comments, I will come back to this tomorrow or the day after (just fyi)! |
f8a4652
to
bc15204
Compare
I think I've addressed the comments, if you could do another review. There's time as I want to get the latest mill version in the example so it's compatible with the build.mill I'm referencing which I should also update to the most recent I can so it's easier for me to reason and test the content |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor things
@vaslabs now that 1.0.5 is out with your latest improvements to the android toolchain, shall we finalize this blog post and publish it? |
Yes, I will get on with it today! |
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
Co-authored-by: Tobias Roeser <[email protected]>
a8e43db
to
a286459
Compare
I added the following gif as well after the android test, but it's the first one as far as I can tell, let me know if you'd prefer it wasn't there, or if you like it I can make a gif for the pokedex app or native app instead of showing a static image, showing more liveness is good imo for demo purposes. |
updated the versions as well and retested the scripts. oops, need to update the date too I guess |
IMHO an animated GIF is ok, but it should not change content multiple times a second. Give the reader some time to recognize the image, before changing it. |
this one is a live recording when the tests run (without any speedups), I mean it's purpose is to show android tests run in emulator and as fast(?) as Gradle - I haven't done any benchmarks, but my very first implementation was running extremely slow |
I'm getting an error trying to build the website on this PR locally
|
strange, I had it running let me try again |
only thing I can think of, is when I make some changes and don't track the directory, then mill is complaining with a similar error, could you double check with |
Sure lemme try on a clean checkout and get back to you |
Managed to get it building on a clean checkout. Blog post looks good to me, can merge and publish it whenever you're ready |
Ok, nice! it's ready then from my side! |
looks like it failed on some link check but the link seems to be valid, but it's a doc page included in the PR and referenced from the blog post, is this a case of checking blog post links against older versions of the docs? |
@vaslabs yes there is version skew: on PRs we build everything against |
that makes sense, yeah will do a PR |
PR to fix the broken link #5894 |
An introductory blog post for Mill's android support. I tried to focus on celebrating mill's design in helping to add all this android support. I think I need a better title, please let me know your ideas and also feedback for the content.
Also added a page in the android docs for the native endless tunnel example (so as I can also reference it in the blog post).