Add support for a prebuilt_root_host type.
Test: art-tests Change-Id: If013e46d2bbd9cc937a11fe7cf3b67eb8b262b55
This commit is contained in:
@@ -1118,6 +1118,25 @@ prebuilt_usr_share_host {
|
||||
|
||||
src: "foo.txt",
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
desc: "prebuilt_root_host",
|
||||
in: `
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := foo
|
||||
LOCAL_MODULE_CLASS := ETC
|
||||
LOCAL_MODULE_PATH := $(HOST_OUT)/subdir
|
||||
LOCAL_SRC_FILES := foo.txt
|
||||
include $(BUILD_PREBUILT)
|
||||
`,
|
||||
expected: `
|
||||
prebuilt_root_host {
|
||||
name: "foo",
|
||||
|
||||
src: "foo.txt",
|
||||
relative_install_path: "subdir",
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
|
@@ -610,7 +610,11 @@ func (f etcPrebuiltModuleUpdate) update(m *parser.Module, path string) bool {
|
||||
}
|
||||
|
||||
var localModuleUpdate = map[string][]etcPrebuiltModuleUpdate{
|
||||
"HOST_OUT": {{prefix: "/etc", modType: "prebuilt_etc_host"}, {prefix: "/usr/share", modType: "prebuilt_usr_share_host"}},
|
||||
"HOST_OUT": {
|
||||
{prefix: "/etc", modType: "prebuilt_etc_host"},
|
||||
{prefix: "/usr/share", modType: "prebuilt_usr_share_host"},
|
||||
{prefix: "", modType: "prebuilt_root_host"},
|
||||
},
|
||||
"PRODUCT_OUT": {{prefix: "/system/etc"}, {prefix: "/vendor/etc", flags: []string{"proprietary"}}},
|
||||
"TARGET_OUT": {{prefix: "/usr/share", modType: "prebuilt_usr_share"}, {prefix: "/fonts", modType: "prebuilt_font"},
|
||||
{prefix: "/etc/firmware", modType: "prebuilt_firmware"}, {prefix: "/vendor/firmware", modType: "prebuilt_firmware", flags: []string{"proprietary"}},
|
||||
|
@@ -828,6 +828,46 @@ func TestRewritePrebuiltEtc(t *testing.T) {
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "prebuilt_etc sub_dir",
|
||||
in: `
|
||||
prebuilt_etc_host {
|
||||
name: "foo",
|
||||
src: "bar",
|
||||
local_module_path: {
|
||||
var: "HOST_OUT",
|
||||
fixed: "/etc/baz",
|
||||
},
|
||||
}
|
||||
`,
|
||||
out: `prebuilt_etc_host {
|
||||
name: "foo",
|
||||
src: "bar",
|
||||
relative_install_path: "baz",
|
||||
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "prebuilt_etc sub_dir",
|
||||
in: `
|
||||
prebuilt_etc_host {
|
||||
name: "foo",
|
||||
src: "bar",
|
||||
local_module_path: {
|
||||
var: "HOST_OUT",
|
||||
fixed: "/baz/sub",
|
||||
},
|
||||
}
|
||||
`,
|
||||
out: `prebuilt_root_host {
|
||||
name: "foo",
|
||||
src: "bar",
|
||||
relative_install_path: "baz/sub",
|
||||
|
||||
}
|
||||
`,
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
|
@@ -54,6 +54,7 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) {
|
||||
ctx.RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory)
|
||||
ctx.RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory)
|
||||
ctx.RegisterModuleType("prebuilt_root", PrebuiltRootFactory)
|
||||
ctx.RegisterModuleType("prebuilt_root_host", PrebuiltRootHostFactory)
|
||||
ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
|
||||
ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
|
||||
ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
|
||||
@@ -454,6 +455,17 @@ func PrebuiltRootFactory() android.Module {
|
||||
return module
|
||||
}
|
||||
|
||||
// prebuilt_root_host is for a host prebuilt artifact that is installed in $(HOST_OUT)/<sub_dir>
|
||||
// directory.
|
||||
func PrebuiltRootHostFactory() android.Module {
|
||||
module := &PrebuiltEtc{}
|
||||
InitPrebuiltEtcModule(module, ".")
|
||||
// This module is host-only
|
||||
android.InitAndroidArchModule(module, android.HostSupported, android.MultilibCommon)
|
||||
android.InitDefaultableModule(module)
|
||||
return module
|
||||
}
|
||||
|
||||
// prebuilt_usr_share is for a prebuilt artifact that is installed in
|
||||
// <partition>/usr/share/<sub_dir> directory.
|
||||
func PrebuiltUserShareFactory() android.Module {
|
||||
|
Reference in New Issue
Block a user