.vendor suffix is added only for libs having core/vendor variants

When the lib is vendor-only, then .vendor suffix is not added.
Furthermore, this change correctly adds .vendor suffix even to the names
listed in LOCAL_SHARED_LIBRARIES so that we don't need to add the suffix
in the make world.

This also allows us to use the original name (without the .vendor
suffix) of the vendor-only modules in make (e.g. in PRODUCT_PACKAGES or
as a make target).

Bug: 37480243
Test: BOARD_VNDK_VERSION=current m -j <name> is successful, where <name>
is one of the vendor-only libraries in Soong. (i.e.
android.hardware.renderscript@1.0-impl)
Test: m -j does not break anything

Change-Id: I203e546ff941878a40c5e7cfbb9f70b617df272d
This commit is contained in:
Jiyong Park
2017-07-18 13:23:39 +09:00
parent 4b2382f78e
commit 27b188bc86
3 changed files with 39 additions and 9 deletions

View File

@@ -23,6 +23,10 @@ import (
"android/soong/android"
)
var (
vendorSuffix = ".vendor"
)
type AndroidMkContext interface {
Target() android.Target
subAndroidMk(*android.AndroidMkData, interface{})
@@ -81,8 +85,10 @@ func (c *Module) AndroidMk() (ret android.AndroidMkData, err error) {
}
c.subAndroidMk(&ret, c.installer)
if c.vndk() {
ret.SubName += ".vendor"
if c.vndk() && Bool(c.Properties.Vendor_available) {
// .vendor suffix is added only when we will have two variants: core and vendor.
// The suffix is not added for vendor-only module.
ret.SubName += vendorSuffix
}
return ret, nil