Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How the soong/android.bp build works?

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?

like image 214
Midhun PM Avatar asked May 10 '18 02:05

Midhun PM


People also ask

What is Soong build system?

What is Soong? The Soong build system was introduced in Android 7.0 (Nougat) to replace Make. It leverages the Kati GNU Make clone tool and Ninja build system component to speed up builds of Android.

What is use of Android BP file?

Android now uses the Soong build system for simpler test configuration. Soong uses Blueprint or . bp files, which are JSON-like simple declarative descriptions of modules to build. This format replaces the Make-based system used in previous releases.

How does Android MK work?

The syntax of the Android.mk allows you to group your sources into modules. A module is either a static library, a shared library, or a standalone executable. You can define one or more modules in each Android.mk file, and you can use the same source file in multiple modules.

What build system does Android use?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.


2 Answers

  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.

like image 139
oscarthecat Avatar answered Sep 18 '22 08:09

oscarthecat


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

like image 37
satur9nine Avatar answered Sep 19 '22 08:09

satur9nine