How the soong/android.bp build works?

24,561

Solution 1

Only Googlers can probably explain, some basic documentation is here:

https://android.googlesource.com/platform/build/soong/

Try search Google groups as well:

https://groups.google.com/forum/#!topic/android-building/0Hy7kLwlBBk

Note that in Oreo Android.mk files continue to work and can depend on Android.bp files, however Android.bp files cannot depend on Android.mk files. Apparently more and more of the build system will be converted to Android.bp as time goes on, hopefully Google does a better job with documentation.

UPDATE Jan 2020

More info added by Google here: https://source.android.com/setup/build/index

Solution 2

  1. ninja is the new build tools for aosp, which using *.ninja to work;
  2. for the legacy Android.mk, kati is applied to transform Androd.mk to *.ninja;
  3. google is now using Android.bp file to describe module compile details, which is also transformed to *.ninja by blueprint/soong;
  4. after all Android.mk is rewrite to Android.bp, kati will be removed, and we will have blueprint/soong/ninja only;

as this link explains.

Solution 3

Soong build system is equivalent to legacy "Android make build system". Therefore Soong is collection of program, which are recipes "how to build hundreds of android modules" with lots of small tools.

Ninja is a process to really handle the final build manifest(Build.ninja) which is made by Blueprint or Kati (translate Android.mk to Android.bp).

Blueprint is like GNU Make grammar, so called "framework for build system". it made by Go language, hence it better provides multi-processing. Blueprint translate "hand-writing build manifest"(*.bp) to final manifest(build.ninja) which is ninja format.

Share:
24,561
Midhun PM
Author by

Midhun PM

I like to try out new things!

Updated on July 24, 2022

Comments

  • Midhun PM
    Midhun PM almost 2 years

    Google introduced Soong build system the replacement of old makefile system.

    Have any idea about how it works? What is this Android.bp in the sources?