Merge "Implement vendor as a synonym of proprietary"

This commit is contained in:
Treehugger Robot 2017-04-08 00:08:50 +00:00 committed by Gerrit Code Review
commit 2ce95652a8
5 changed files with 16 additions and 8 deletions

View File

@ -234,6 +234,9 @@ func translateAndroidMkModule(ctx blueprint.SingletonContext, w io.Writer, mod b
if amod.commonProperties.Proprietary { if amod.commonProperties.Proprietary {
fmt.Fprintln(w, "LOCAL_PROPRIETARY_MODULE := true") fmt.Fprintln(w, "LOCAL_PROPRIETARY_MODULE := true")
} }
if amod.commonProperties.Vendor {
fmt.Fprintln(w, "LOCAL_VENDOR_MODULE := true")
}
if amod.commonProperties.Owner != "" { if amod.commonProperties.Owner != "" {
fmt.Fprintln(w, "LOCAL_MODULE_OWNER :=", amod.commonProperties.Owner) fmt.Fprintln(w, "LOCAL_MODULE_OWNER :=", amod.commonProperties.Owner)
} }

View File

@ -60,7 +60,7 @@ type androidBaseContext interface {
Windows() bool Windows() bool
Debug() bool Debug() bool
PrimaryArch() bool PrimaryArch() bool
Proprietary() bool Vendor() bool
AConfig() Config AConfig() Config
DeviceConfig() DeviceConfig DeviceConfig() DeviceConfig
} }
@ -143,6 +143,9 @@ type commonProperties struct {
// vendor who owns this module // vendor who owns this module
Owner string Owner string
// whether this module is device specific and should be installed into /vendor
Vendor bool
// *.logtags files, to combine together in order to generate the /system/etc/event-log-tags // *.logtags files, to combine together in order to generate the /system/etc/event-log-tags
// file // file
Logtags []string Logtags []string
@ -462,7 +465,7 @@ func (a *ModuleBase) androidBaseContextFactory(ctx blueprint.BaseModuleContext)
return androidBaseContextImpl{ return androidBaseContextImpl{
target: a.commonProperties.CompileTarget, target: a.commonProperties.CompileTarget,
targetPrimary: a.commonProperties.CompilePrimary, targetPrimary: a.commonProperties.CompilePrimary,
proprietary: a.commonProperties.Proprietary, vendor: a.commonProperties.Proprietary || a.commonProperties.Vendor,
config: ctx.Config().(Config), config: ctx.Config().(Config),
} }
} }
@ -499,7 +502,7 @@ type androidBaseContextImpl struct {
target Target target Target
targetPrimary bool targetPrimary bool
debug bool debug bool
proprietary bool vendor bool
config Config config Config
} }
@ -632,8 +635,8 @@ func (a *androidBaseContextImpl) DeviceConfig() DeviceConfig {
return DeviceConfig{a.config.deviceConfig} return DeviceConfig{a.config.deviceConfig}
} }
func (a *androidBaseContextImpl) Proprietary() bool { func (a *androidBaseContextImpl) Vendor() bool {
return a.proprietary return a.vendor
} }
func (a *androidModuleContext) InstallInData() bool { func (a *androidModuleContext) InstallInData() bool {

View File

@ -649,7 +649,7 @@ func PathForModuleInstall(ctx ModuleContext, paths ...string) OutputPath {
var outPaths []string var outPaths []string
if ctx.Device() { if ctx.Device() {
partition := "system" partition := "system"
if ctx.Proprietary() { if ctx.Vendor() {
partition = ctx.DeviceConfig().VendorPath() partition = ctx.DeviceConfig().VendorPath()
} }

View File

@ -69,12 +69,12 @@ func init() {
"LOCAL_PACKAGE_NAME": "name", "LOCAL_PACKAGE_NAME": "name",
"LOCAL_MODULE_RELATIVE_PATH": "relative_install_path", "LOCAL_MODULE_RELATIVE_PATH": "relative_install_path",
"LOCAL_PROTOC_OPTIMIZE_TYPE": "proto.type", "LOCAL_PROTOC_OPTIMIZE_TYPE": "proto.type",
"LOCAL_HEADER_LIBRARIES": "header_libs",
"LOCAL_MODULE_OWNER": "owner", "LOCAL_MODULE_OWNER": "owner",
}) })
addStandardProperties(bpparser.ListType, addStandardProperties(bpparser.ListType,
map[string]string{ map[string]string{
"LOCAL_SRC_FILES_EXCLUDE": "exclude_srcs", "LOCAL_SRC_FILES_EXCLUDE": "exclude_srcs",
"LOCAL_HEADER_LIBRARIES": "header_libs",
"LOCAL_SHARED_LIBRARIES": "shared_libs", "LOCAL_SHARED_LIBRARIES": "shared_libs",
"LOCAL_STATIC_LIBRARIES": "static_libs", "LOCAL_STATIC_LIBRARIES": "static_libs",
"LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs", "LOCAL_WHOLE_STATIC_LIBRARIES": "whole_static_libs",
@ -90,6 +90,7 @@ func init() {
"LOCAL_YACCFLAGS": "yaccflags", "LOCAL_YACCFLAGS": "yaccflags",
"LOCAL_SANITIZE_RECOVER": "sanitize.recover", "LOCAL_SANITIZE_RECOVER": "sanitize.recover",
"LOCAL_LOGTAGS_FILES": "logtags", "LOCAL_LOGTAGS_FILES": "logtags",
"LOCAL_EXPORT_HEADER_LIBRARY_HEADERS": "export_header_lib_headers",
"LOCAL_EXPORT_SHARED_LIBRARY_HEADERS": "export_shared_lib_headers", "LOCAL_EXPORT_SHARED_LIBRARY_HEADERS": "export_shared_lib_headers",
"LOCAL_EXPORT_STATIC_LIBRARY_HEADERS": "export_static_lib_headers", "LOCAL_EXPORT_STATIC_LIBRARY_HEADERS": "export_static_lib_headers",
"LOCAL_INIT_RC": "init_rc", "LOCAL_INIT_RC": "init_rc",
@ -121,6 +122,7 @@ func init() {
"LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations", "LOCAL_PACK_MODULE_RELOCATIONS": "pack_relocations",
"LOCAL_TIDY": "tidy", "LOCAL_TIDY": "tidy",
"LOCAL_PROPRIETARY_MODULE": "proprietary", "LOCAL_PROPRIETARY_MODULE": "proprietary",
"LOCAL_VENDOR_MODULE": "vendor",
"LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources", "LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
}) })

View File

@ -389,7 +389,7 @@ func (ctx *moduleContextImpl) sdkVersion() string {
} }
func (ctx *moduleContextImpl) vndk() bool { func (ctx *moduleContextImpl) vndk() bool {
return ctx.ctx.Os() == android.Android && ctx.ctx.Proprietary() && ctx.ctx.DeviceConfig().CompileVndk() return ctx.ctx.Os() == android.Android && ctx.ctx.Vendor() && ctx.ctx.DeviceConfig().CompileVndk()
} }
func (ctx *moduleContextImpl) selectedStl() string { func (ctx *moduleContextImpl) selectedStl() string {