An interesting bit of Android's Rust integration: android.googlesource.com/platform/devel. It converts Cargo packages into Blueprint modules integrated into the normal build system. Blueprint is Android's declarative build system implemented on top of ninja. Fits into overall incremental build.
Conversation
Replying to
Question, does this (and/or "Blueprint") create a path to writing Android software without using Gradle?
1
Replying to
The Android Open Source Project builds everything including apps with ninja. The modern approach is the declarative Blueprint system. The legacy approach is the template-based Android.mk build system which was the basis for Blueprint. It's far nicer than gradle...
2
Here's an example of a Rust crate (futures) converted to Blueprint:
android.googlesource.com/platform/exter
Here's a manually written example for a C executable and static library:
android.googlesource.com/platform/exter
This is what it looks like for an app:
android.googlesource.com/platform/packa
I think it's great.
1
1
This is an example of an app using the legacy Android.mk-based system:
github.com/GrapheneOS/pla
It's essentially the same thing, but everything gets expanded into an enormous Makefile. Legacy system isn't implemented via make anymore but rather Kati and integrates with the rest.
1
Kati is a reimplementation of GNU make into ninja. AOSP incorporates it in a way that's interoperable with the new declarative Blueprint build system. The old approach was essentially a poor man's declarative build system. The usage is very similar to how they use Blueprint.
2
I can't stand gradle. It's the opposite of the approach taken by Android itself. AOSP wants everything to be declarative and a major reason for moving away from make is to enforce it. Helps a lot with avoiding bugs including rock solid reproducible builds and incremental builds.
Ant is (or can be used) declaratively. I was horrified when I saw Gradle pushed so hard. Definite step backward.
1
1
What makes Android.bp so nice is that it's a declarative build system made specifically for the Android Open Source Project so nearly everything you would ever want to do is very simple/clean and native code is first class using the same build system in an interoperable way.
1
Show replies


