Loading android/androidmk.go +24 −11 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ type AndroidMkData struct { Disabled bool Include string Required []string Host_required []string Target_required []string Custom func(w io.Writer, name, prefix, moduleDir string, data AndroidMkData) Loading Loading @@ -200,6 +202,8 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod } data.Required = append(data.Required, amod.commonProperties.Required...) data.Host_required = append(data.Host_required, amod.commonProperties.Host_required...) data.Target_required = append(data.Target_required, amod.commonProperties.Target_required...) // Make does not understand LinuxBionic if amod.Os() == LinuxBionic { Loading Loading @@ -267,10 +271,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod fmt.Fprintln(&data.preamble, "LOCAL_MODULE :=", name+data.SubName) fmt.Fprintln(&data.preamble, "LOCAL_MODULE_CLASS :=", data.Class) fmt.Fprintln(&data.preamble, "LOCAL_PREBUILT_MODULE_FILE :=", data.OutputFile.String()) if len(data.Required) > 0 { fmt.Fprintln(&data.preamble, "LOCAL_REQUIRED_MODULES := "+strings.Join(data.Required, " ")) } WriteRequiredModulesSettings(&data.preamble, data) archStr := amod.Arch().ArchType.String() host := false Loading Loading @@ -360,3 +361,15 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) { fmt.Fprintln(w, "include "+data.Include) } func WriteRequiredModulesSettings(w io.Writer, data AndroidMkData) { if len(data.Required) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(data.Required, " ")) } if len(data.Host_required) > 0 { fmt.Fprintln(w, "LOCAL_HOST_REQUIRED_MODULES :=", strings.Join(data.Host_required, " ")) } if len(data.Target_required) > 0 { fmt.Fprintln(w, "LOCAL_TARGET_REQUIRED_MODULES :=", strings.Join(data.Target_required, " ")) } } android/module.go +16 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,8 @@ type ModuleContext interface { InstallInRecovery() bool RequiredModuleNames() []string HostRequiredModuleNames() []string TargetRequiredModuleNames() []string // android.ModuleContext methods // These are duplicated instead of embedded so that can eventually be wrapped to take an Loading Loading @@ -269,6 +271,12 @@ type commonProperties struct { // names of other modules to install if this module is installed Required []string `android:"arch_variant"` // names of other modules to install on host if this module is installed Host_required []string `android:"arch_variant"` // names of other modules to install on target if this module is installed Target_required []string `android:"arch_variant"` // relative path to a file to include in the list of notices for the device Notice *string `android:"path"` Loading Loading @@ -1459,6 +1467,14 @@ func (ctx *androidModuleContext) RequiredModuleNames() []string { return ctx.module.base().commonProperties.Required } func (ctx *androidModuleContext) HostRequiredModuleNames() []string { return ctx.module.base().commonProperties.Host_required } func (ctx *androidModuleContext) TargetRequiredModuleNames() []string { return ctx.module.base().commonProperties.Target_required } func (ctx *androidModuleContext) Glob(globPattern string, excludes []string) Paths { ret, err := ctx.GlobWithDeps(globPattern, excludes) if err != nil { Loading android/prebuilt_etc.go +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android import ( "fmt" "io" "strings" ) // TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file. Loading Loading @@ -157,7 +156,7 @@ func (p *PrebuiltEtc) AndroidMk() AndroidMkData { fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", "$(OUT_DIR)/"+p.installDirPath.RelPathString()) fmt.Fprintln(w, "LOCAL_INSTALLED_MODULE_STEM :=", p.outputFilePath.Base()) fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !p.Installable()) fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(data.Required, " ")) WriteRequiredModulesSettings(w, data) if p.additionalDependencies != nil { fmt.Fprint(w, "LOCAL_ADDITIONAL_DEPENDENCIES :=") for _, path := range *p.additionalDependencies { Loading android/prebuilt_etc_test.go +9 −5 Original line number Diff line number Diff line Loading @@ -150,6 +150,8 @@ func TestPrebuiltEtcAndroidMk(t *testing.T) { data := AndroidMkData{} data.Required = append(data.Required, "modA", "moduleB") data.Host_required = append(data.Host_required, "hostModA", "hostModB") data.Target_required = append(data.Target_required, "targetModA") expected := map[string]string{ "LOCAL_MODULE": "foo", Loading @@ -157,6 +159,8 @@ func TestPrebuiltEtcAndroidMk(t *testing.T) { "LOCAL_MODULE_OWNER": "abc", "LOCAL_INSTALLED_MODULE_STEM": "foo.conf", "LOCAL_REQUIRED_MODULES": "modA moduleB", "LOCAL_HOST_REQUIRED_MODULES": "hostModA hostModB", "LOCAL_TARGET_REQUIRED_MODULES": "targetModA", } mod := ctx.ModuleForTests("foo", "android_arm64_armv8-a_core").Module().(*PrebuiltEtc) Loading android/variable.go +6 −4 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ type variableProperties struct { Cppflags []string Init_rc []string Required []string Host_required []string Target_required []string } // eng is true for -eng builds, and can be used to turn on additionaly heavyweight debugging Loading Loading
android/androidmk.go +24 −11 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ type AndroidMkData struct { Disabled bool Include string Required []string Host_required []string Target_required []string Custom func(w io.Writer, name, prefix, moduleDir string, data AndroidMkData) Loading Loading @@ -200,6 +202,8 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod } data.Required = append(data.Required, amod.commonProperties.Required...) data.Host_required = append(data.Host_required, amod.commonProperties.Host_required...) data.Target_required = append(data.Target_required, amod.commonProperties.Target_required...) // Make does not understand LinuxBionic if amod.Os() == LinuxBionic { Loading Loading @@ -267,10 +271,7 @@ func translateAndroidModule(ctx SingletonContext, w io.Writer, mod blueprint.Mod fmt.Fprintln(&data.preamble, "LOCAL_MODULE :=", name+data.SubName) fmt.Fprintln(&data.preamble, "LOCAL_MODULE_CLASS :=", data.Class) fmt.Fprintln(&data.preamble, "LOCAL_PREBUILT_MODULE_FILE :=", data.OutputFile.String()) if len(data.Required) > 0 { fmt.Fprintln(&data.preamble, "LOCAL_REQUIRED_MODULES := "+strings.Join(data.Required, " ")) } WriteRequiredModulesSettings(&data.preamble, data) archStr := amod.Arch().ArchType.String() host := false Loading Loading @@ -360,3 +361,15 @@ func WriteAndroidMkData(w io.Writer, data AndroidMkData) { fmt.Fprintln(w, "include "+data.Include) } func WriteRequiredModulesSettings(w io.Writer, data AndroidMkData) { if len(data.Required) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(data.Required, " ")) } if len(data.Host_required) > 0 { fmt.Fprintln(w, "LOCAL_HOST_REQUIRED_MODULES :=", strings.Join(data.Host_required, " ")) } if len(data.Target_required) > 0 { fmt.Fprintln(w, "LOCAL_TARGET_REQUIRED_MODULES :=", strings.Join(data.Target_required, " ")) } }
android/module.go +16 −0 Original line number Diff line number Diff line Loading @@ -133,6 +133,8 @@ type ModuleContext interface { InstallInRecovery() bool RequiredModuleNames() []string HostRequiredModuleNames() []string TargetRequiredModuleNames() []string // android.ModuleContext methods // These are duplicated instead of embedded so that can eventually be wrapped to take an Loading Loading @@ -269,6 +271,12 @@ type commonProperties struct { // names of other modules to install if this module is installed Required []string `android:"arch_variant"` // names of other modules to install on host if this module is installed Host_required []string `android:"arch_variant"` // names of other modules to install on target if this module is installed Target_required []string `android:"arch_variant"` // relative path to a file to include in the list of notices for the device Notice *string `android:"path"` Loading Loading @@ -1459,6 +1467,14 @@ func (ctx *androidModuleContext) RequiredModuleNames() []string { return ctx.module.base().commonProperties.Required } func (ctx *androidModuleContext) HostRequiredModuleNames() []string { return ctx.module.base().commonProperties.Host_required } func (ctx *androidModuleContext) TargetRequiredModuleNames() []string { return ctx.module.base().commonProperties.Target_required } func (ctx *androidModuleContext) Glob(globPattern string, excludes []string) Paths { ret, err := ctx.GlobWithDeps(globPattern, excludes) if err != nil { Loading
android/prebuilt_etc.go +1 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android import ( "fmt" "io" "strings" ) // TODO(jungw): Now that it handles more than the ones in etc/, consider renaming this file. Loading Loading @@ -157,7 +156,7 @@ func (p *PrebuiltEtc) AndroidMk() AndroidMkData { fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", "$(OUT_DIR)/"+p.installDirPath.RelPathString()) fmt.Fprintln(w, "LOCAL_INSTALLED_MODULE_STEM :=", p.outputFilePath.Base()) fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !p.Installable()) fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(data.Required, " ")) WriteRequiredModulesSettings(w, data) if p.additionalDependencies != nil { fmt.Fprint(w, "LOCAL_ADDITIONAL_DEPENDENCIES :=") for _, path := range *p.additionalDependencies { Loading
android/prebuilt_etc_test.go +9 −5 Original line number Diff line number Diff line Loading @@ -150,6 +150,8 @@ func TestPrebuiltEtcAndroidMk(t *testing.T) { data := AndroidMkData{} data.Required = append(data.Required, "modA", "moduleB") data.Host_required = append(data.Host_required, "hostModA", "hostModB") data.Target_required = append(data.Target_required, "targetModA") expected := map[string]string{ "LOCAL_MODULE": "foo", Loading @@ -157,6 +159,8 @@ func TestPrebuiltEtcAndroidMk(t *testing.T) { "LOCAL_MODULE_OWNER": "abc", "LOCAL_INSTALLED_MODULE_STEM": "foo.conf", "LOCAL_REQUIRED_MODULES": "modA moduleB", "LOCAL_HOST_REQUIRED_MODULES": "hostModA hostModB", "LOCAL_TARGET_REQUIRED_MODULES": "targetModA", } mod := ctx.ModuleForTests("foo", "android_arm64_armv8-a_core").Module().(*PrebuiltEtc) Loading
android/variable.go +6 −4 Original line number Diff line number Diff line Loading @@ -89,6 +89,8 @@ type variableProperties struct { Cppflags []string Init_rc []string Required []string Host_required []string Target_required []string } // eng is true for -eng builds, and can be used to turn on additionaly heavyweight debugging Loading