Android Platform Build System Inspection

in #aosp7 years ago

AOSP Platform Build System was based on GNU Make in previous version of OS.
But from Android N (in my memory) Google launched new Android platform build system called Soong

Soong

Soong means just simple action : replace Android.mk with Android.bp
Android.bp is simple JSON-like description for module. It contains module name, source file paths to build or include and library info used while build.

This Android.bp only supports simple description so any kind of high-level conditional behavior must be pre-described with Go language.

example for conditionals
[1] : https://android.googlesource.com/platform/art/+/master/build/art.go
[2] : https://android.googlesource.com/platform/external/llvm/+/master/soong/llvm.go

Most of C/C++ sources in Android are using Soong instead of make now. And Java sources start to convert to soong

reference : https://android.googlesource.com/platform/build/soong/+/refs/heads/oreo-mr1-release

What the hell is bp??

bp is abbreviation of Blueprint.
Blueprint - which was made by Google - is meta-build system that reads all blueprint files and make it to Ninja manifest.
It simply create ninja file which contains build command, options, parameters.

reference : https://github.com/google/blueprint

Ninja

Ninja는 원시적인 Makefile 문법과 마찬가지로 goal과 커맨드로 이루어져있고
사람이 쓰는게 아닌 기계가 작성하도록 설계되어 있어 복잡한 문법은 지원하지 않는다.
빌드시 필요한 dependency 정보 등과 중간 산출물등을 기록하여 incremental build시 기존보다 더욱 빠르게 빌드할 수 있도록 지원한다.

Android Soong은 이러한 Ninja를 적극 활용하기 위해 모든 모듈들이 중간단계인 blueprint 들을 활용하여 ninja manifest를 작성하도록 되어 있다.

이는 기존 make을 사용하는 모듈도 마찬가지다.

kati

kati는 기존 Android.mk들을 Ninja manifest로 기술하는목적으로 만들어진 것으로 보인다.
Android.mk에서 복잡하게 활용되던 conditional statement는 어떤식으로 처리되는지 아직 unclear 하다.

reference : https://github.com/google/kati

Sort:  

Congratulations @sebien! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @sebien! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!