summaryrefslogtreecommitdiff
path: root/cc/genrule.go
diff options
context:
space:
mode:
author Justin Yun <justinyun@google.com> 2020-10-29 16:49:43 +0900
committer Justin Yun <justinyun@google.com> 2020-11-08 23:53:22 +0000
commit63e9ec70bb12a45d8dbce1e26b211f8c14e0571a (patch)
tree8e08f5052b29266563632527a9294ae5b157d077 /cc/genrule.go
parentb0a713acf918d87137cb8cfe7de77d47c111f483 (diff)
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
Diffstat (limited to 'cc/genrule.go')
-rw-r--r--cc/genrule.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/cc/genrule.go b/cc/genrule.go
index a5a58d2ec..3668e2bea 100644
--- a/cc/genrule.go
+++ b/cc/genrule.go
@@ -25,6 +25,7 @@ func init() {
type GenruleExtraProperties struct {
Vendor_available *bool
+ Product_available *bool
Ramdisk_available *bool
Vendor_ramdisk_available *bool
Recovery_available *bool
@@ -62,7 +63,7 @@ func (g *GenruleExtraProperties) CoreVariantNeeded(ctx android.BaseModuleContext
return false
}
- return Bool(g.Vendor_available) || !(ctx.SocSpecific() || ctx.DeviceSpecific())
+ return Bool(g.Vendor_available) || Bool(g.Product_available) || !(ctx.SocSpecific() || ctx.DeviceSpecific())
}
func (g *GenruleExtraProperties) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
@@ -100,7 +101,8 @@ func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleCont
return variants
}
- if Bool(g.Vendor_available) || ctx.ProductSpecific() {
+ // TODO(b/150902910): vendor_available will not create product variant. Remove Bool(g.Vendor_available)
+ if Bool(g.Vendor_available) || Bool(g.Product_available) || ctx.ProductSpecific() {
variants = append(variants, ProductVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
if vndkVersion := ctx.DeviceConfig().ProductVndkVersion(); vndkVersion != "current" {
variants = append(variants, ProductVariationPrefix+vndkVersion)