Define product_available property
To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.
Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
diff --git a/cc/library.go b/cc/library.go
index d946629..eeddd90 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -72,7 +72,7 @@
Suffix *string `android:"arch_variant"`
Target struct {
- Vendor struct {
+ Vendor, Product struct {
// set suffix of the name of the output
Suffix *string `android:"arch_variant"`
}
@@ -172,11 +172,11 @@
Export_system_include_dirs []string `android:"arch_variant"`
Target struct {
- Vendor struct {
+ Vendor, Product struct {
// list of exported include directories, like
- // export_include_dirs, that will be applied to the
- // vendor variant of this library. This will overwrite
- // any other declarations.
+ // export_include_dirs, that will be applied to
+ // vendor or product variant of this library.
+ // This will overwrite any other declarations.
Override_export_include_dirs []string
}
}
@@ -253,6 +253,7 @@
}
func (f *flagExporter) exportedIncludes(ctx ModuleContext) android.Paths {
+ // TODO(b/150902910): product variant must use Target.Product
if ctx.useVndk() && f.Properties.Target.Vendor.Override_export_include_dirs != nil {
return android.PathsForModuleSrc(ctx, f.Properties.Target.Vendor.Override_export_include_dirs)
} else {
@@ -716,6 +717,7 @@
suffix := ""
if useVndk {
+ // TODO(b/150902910): product variant must use Target.Product
suffix = String(library.Properties.Target.Vendor.Suffix)
}
if suffix == "" {
@@ -812,6 +814,7 @@
deps.ReexportSharedLibHeaders = append(deps.ReexportSharedLibHeaders, library.SharedProperties.Shared.Export_shared_lib_headers...)
deps.ReexportStaticLibHeaders = append(deps.ReexportStaticLibHeaders, library.SharedProperties.Shared.Export_static_lib_headers...)
}
+ // TODO(b/150902910): product variant must use Target.Product
if ctx.useVndk() {
deps.WholeStaticLibs = removeListFromList(deps.WholeStaticLibs, library.baseLinker.Properties.Target.Vendor.Exclude_static_libs)
deps.SharedLibs = removeListFromList(deps.SharedLibs, library.baseLinker.Properties.Target.Vendor.Exclude_shared_libs)