diff options
author | 2024-01-03 14:24:34 +0900 | |
---|---|---|
committer | 2024-01-05 11:15:23 +0900 | |
commit | b5fdb2e966bf6e819677e266eda27a8cb0a86d0c (patch) | |
tree | 95f3897c0e86ec61e05b053f8a21cbcaadd245e0 /rust/image.go | |
parent | 202bc5b689ed7f5deaf997c78347f64bfc19dce5 (diff) |
Generate image variation without version
Current CC/Rust Image variations are generated with target VNDK version.
However, this is no longer valid if VNDK is deprecated. This change
generates image variation without version ("vendor", "product") if VNDK
is deprecated.
Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Test: aosp_cf_x86_64_phone build succeeded
Change-Id: I2387ed8a2632bfd9462621f882a947695ae1653d
Diffstat (limited to 'rust/image.go')
-rw-r--r-- | rust/image.go | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/rust/image.go b/rust/image.go index d0218f00e..7adf23460 100644 --- a/rust/image.go +++ b/rust/image.go @@ -184,12 +184,12 @@ func (mod *Module) HasNonSystemVariants() bool { } func (mod *Module) InProduct() bool { - return mod.Properties.ImageVariationPrefix == cc.ProductVariationPrefix + return mod.Properties.ImageVariation == cc.ProductVariation } // Returns true if the module is "vendor" variant. Usually these modules are installed in /vendor func (mod *Module) InVendor() bool { - return mod.Properties.ImageVariationPrefix == cc.VendorVariationPrefix + return mod.Properties.ImageVariation == cc.VendorVariation } func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) { @@ -198,9 +198,11 @@ func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant stri m.MakeAsPlatform() } else if variant == android.RecoveryVariation { m.MakeAsPlatform() - } else if strings.HasPrefix(variant, cc.VendorVariationPrefix) { - m.Properties.ImageVariationPrefix = cc.VendorVariationPrefix - m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix) + } else if strings.HasPrefix(variant, cc.VendorVariation) { + m.Properties.ImageVariation = cc.VendorVariation + if strings.HasPrefix(variant, cc.VendorVariationPrefix) { + m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix) + } // Makefile shouldn't know vendor modules other than BOARD_VNDK_VERSION. // Hide other vendor variants to avoid collision. @@ -209,9 +211,11 @@ func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant stri m.Properties.HideFromMake = true m.HideFromMake() } - } else if strings.HasPrefix(variant, cc.ProductVariationPrefix) { - m.Properties.ImageVariationPrefix = cc.ProductVariationPrefix - m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix) + } else if strings.HasPrefix(variant, cc.ProductVariation) { + m.Properties.ImageVariation = cc.ProductVariation + if strings.HasPrefix(variant, cc.ProductVariationPrefix) { + m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix) + } } } |