Questions tagged [android-soong]

Soong is the replacement for the old Android make-based build system. It replaces Android.mk files with Android.bp files, which are JSON-like simple declarative descriptions of modules to build.

Soong is the replacement for the old Android make-based build system. It replaces Android.mk files with Android.bp files, which are JSON-like simple declarative descriptions of modules to build.

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

82 questions
17
votes
2 answers

How is the AOSP project built?

All the git projects for the AOSP are cloned by the repo tool, which reads this xml: https://android.googlesource.com/platform/manifest/+/refs/heads/master/default.xml. AOSP guide says the in order to build, we should run source build/envsetup.sh on…
Guerlando OCs
  • 1,886
  • 9
  • 61
  • 150
17
votes
3 answers

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?
Midhun PM
  • 512
  • 1
  • 7
  • 24
6
votes
2 answers

How to add relative path for srcs :[] in android.bp file

I m using androidmk tool to convert Android.mk files to Android.bp at many places we have Android.mk chanining so it produces relative path for srcs:[], but its not working with Android.bp build. Throwing error : Path is outside directory:…
Shabaz Khan
  • 71
  • 1
  • 5
6
votes
2 answers

Native Code coverage with android soong build system

I'm trying to generate code coverage report for my native components with AOSP source code using soong build system. I have extended aosp vhal but unit test cases are same as in below…
Pankaj
  • 2,115
  • 2
  • 19
  • 39
6
votes
2 answers

How to build AOSP Latin IME out of tree?

I am trying to build the AOSP Latin IME (source code: https://android.googlesource.com/platform/packages/inputmethods/LatinIME/+/master) without downloading the entire AOSP source code. Ideally, I would like to build the project as a Gradle project,…
Foobar
  • 7,458
  • 16
  • 81
  • 161
6
votes
3 answers

Android.bp: how to add external header .h files

I have a similar problem as How to add external header files during bazel/tensorflow build. but I hope there is a better solution. I have a module that requires some external .h header files at other location. Suppose I try to include…
user2271769
  • 181
  • 2
  • 7
5
votes
0 answers

How to resolve missing variant arch:common for a dependency using Android.bp?

Originally, the dependency was included inside the Android.mk file for Android 9. This module would compile and run with no build errors. When migrating to Android 11, the dependency "libvlc" must be added to the Android.bp static_libs. …
Naman Jain
  • 321
  • 5
  • 21
5
votes
2 answers

Is there a way to add/remove module in Android.bp?

I'm trying to add/remove modules in Android.bp, according to the set of envirenment variable. E.g., if I set 1 to BUILD_SOURCE, cc_prebuilt_binary is removed in Android.bp and some cc_binary is added instead. I've seen the guide and seen below…
Chan Lee
  • 71
  • 1
  • 5
5
votes
1 answer

Include shared library from Android.mk into cc_test of Android.bp

I have an Android.mk, which builds some library: ifeq ($(CONDITION),something) LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) BDROID_DIR := $(TOP_DIR)system/bt LOCAL_CFLAGS += \ -Wall \ -Werror LOCAL_SRC_FILES :=…
a_girl
  • 959
  • 7
  • 22
4
votes
1 answer

How to append aapt flags to Android.bp dynamically

I need to dynamically append new flags to aaptflags property from android_app from Android.bp, based in some conditions. I am trying something similar to this answer, the Go script is executed (I can see it when I add some prints), but the flags are…
Heitor Paceli
  • 493
  • 6
  • 16
4
votes
1 answer

What is art.go? And why is it considered a way to write conditionals in bp files?

I am trying to find a way to write a conditional inside a .bp file. I found a documentation here: https://android.googlesource.com/platform/build/soong/+/HEAD/README.md It has a "How do I write conditionals?" part, which points to the art.go:…
a_girl
  • 959
  • 7
  • 22
3
votes
1 answer

Failed to build sample SDK add-on on Android 13 AOSP

I'm trying to build my own SDK add-on from scratch, and attempt to comply with the sample in device/sample. Complying to the instructions in README.txt, I got following failure while building: [100% 1/1] analyzing Android.bp files and generating…
3
votes
2 answers

Create unstripped executable for android with .bp

I want to build aosp native test and debug it on emulator. Is it possible to build executable with debugging symbols? I have tried to add -g and -ggdb to Android .bp: cflags: [ "-Werror", "-Wall", "-g", ], but it…
JuicyKitty
  • 318
  • 1
  • 16
3
votes
2 answers

How do I add condition in Android.bp

I want to differentiate code between Android Q and Android R how do I achieve this in Android.bp? In Android.mk I did something like this ifeq ($(PLATFORM_VERSION), R) LOCAL_CFLAGS += -DANDROID_R_AOSP else LOCAL_CFLAGS += -DANDROID_Q_AOSP How to do…
3
votes
1 answer

Building static library in aosp

I am trying to built a static library in aosp, which is then used by another program. Android.bp is for the static library is as follows: cc_library_static { name: "libabc", srcs: [ "src/abc.c", "src/abcd.c", ], …
foo
  • 71
  • 2
  • 8
1
2 3 4 5 6