Handle the 'enabled' property in bp2build
Also fix some bugs pertaining to configurable attribute handling of bool
attributes and label sttributes, so that they may support values across
multiple different axes at the same time.
Test: unit tests for bp2build
Test: mixed_droid
Change-Id: I411efcfddf02d55dbc0775962068a11348a8bb2c
diff --git a/android/bazel.go b/android/bazel.go
index f4f9a72..970ad0d 100644
--- a/android/bazel.go
+++ b/android/bazel.go
@@ -367,13 +367,21 @@
"libandroid_runtime_lazy", // depends on unconverted modules: libbinder_headers
"libcmd", // depends on unconverted modules: libbinder
+ "libdexfile_support_static", // Depends on unconverted module: libdexfile_external_headers
+ "libunwindstack_local", "libunwindstack_utils", "libc_malloc_debug", "libfdtrack", // Depends on unconverted module: libunwindstack
+
+ "libdexfile_support", // TODO(b/210546943): Enabled based on product variables.
+ "libdexfile_external_headers", // TODO(b/210546943): Enabled based on product variables.
+
+ "libunwindstack", // Depends on unconverted module libdexfile_support.
+ "libnativehelper_compat_libc++", // Broken compile: implicit declaration of function 'strerror_r' is invalid in C99
+
"chkcon", "sefcontext_compile", // depends on unconverted modules: libsepol
"libsepol", // TODO(b/207408632): Unsupported case of .l sources in cc library rules
"gen-kotlin-build-file.py", // module has same name as source
- "libbinder", // TODO(b/188503688): Disabled for some archs,
"libactivitymanager_aidl", // TODO(b/207426160): Depends on activity_manager_procstate_aidl, which is an aidl filegroup.
"libnativehelper_lazy_mts_jni", "libnativehelper_mts_jni", // depends on unconverted modules: libgmock_ndk
@@ -434,8 +442,7 @@
"linkerconfig", // http://b/202876379 has arch-variant static_executable
"mdnsd", // http://b/202876379 has arch-variant static_executable
- "acvp_modulewrapper", // disabled for android x86/x86_64
- "CarHTMLViewer", // depends on unconverted modules android.car-stubs, car-ui-lib
+ "CarHTMLViewer", // depends on unconverted modules android.car-stubs, car-ui-lib
"libdexfile", // depends on unconverted modules: dexfile_operator_srcs, libartbase, libartpalette,
"libdexfiled", // depends on unconverted modules: dexfile_operator_srcs, libartbased, libartpalette
@@ -443,9 +450,7 @@
// Per-module denylist of cc_library modules to only generate the static
// variant if their shared variant isn't ready or buildable by Bazel.
- bp2buildCcLibraryStaticOnlyList = []string{
- "libjemalloc5", // http://b/188503688, cc_library, `target: { android: { enabled: false } }` for android targets.
- }
+ bp2buildCcLibraryStaticOnlyList = []string{}
// Per-module denylist to opt modules out of mixed builds. Such modules will
// still be generated via bp2build.
@@ -513,6 +518,9 @@
// Windows toolchains are not currently supported.
return false
}
+ if !ctx.Module().Enabled() {
+ return false
+ }
if !ctx.Config().BazelContext.BazelEnabled() {
return false
}