Loading cc/androidmk.go +5 −1 Original line number Diff line number Diff line Loading @@ -546,7 +546,7 @@ func (c *snapshotLibraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entrie entries.SubName += c.baseProperties.Androidmk_suffix entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { entries.ExtraEntries = append(entries.ExtraEntries, func(_ android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { c.libraryDecorator.androidMkWriteExportedFlags(entries) if c.shared() || c.static() { Loading @@ -567,6 +567,10 @@ func (c *snapshotLibraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entrie if c.tocFile.Valid() { entries.SetString("LOCAL_SOONG_TOC", c.tocFile.String()) } if c.shared() && len(c.Properties.Overrides) > 0 { entries.SetString("LOCAL_OVERRIDES_MODULES", strings.Join(makeOverrideModuleNames(ctx, c.Properties.Overrides), " ")) } } if !c.shared() { // static or header Loading cc/binary.go +6 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,12 @@ func (binary *binaryDecorator) hostToolPath() android.OptionalPath { return binary.toolPath } func (binary *binaryDecorator) overriddenModules() []string { return binary.Properties.Overrides } var _ overridable = (*binaryDecorator)(nil) func init() { pctx.HostBinToolVariable("verifyHostBionicCmd", "host_bionic_verify") } Loading cc/cc.go +11 −0 Original line number Diff line number Diff line Loading @@ -616,6 +616,10 @@ type xref interface { XrefCcFiles() android.Paths } type overridable interface { overriddenModules() []string } type libraryDependencyKind int const ( Loading Loading @@ -3642,6 +3646,13 @@ func (c *Module) UniqueApexVariations() bool { return c.UseVndk() && c.IsVndk() } func (c *Module) overriddenModules() []string { if o, ok := c.linker.(overridable); ok { return o.overriddenModules() } return nil } var _ snapshot.RelativeInstallPath = (*Module)(nil) type moduleType int Loading cc/library.go +6 −0 Original line number Diff line number Diff line Loading @@ -2241,6 +2241,12 @@ func (library *libraryDecorator) getAPIListCoverageXMLPath() android.ModuleOutPa return library.apiListCoverageXmlPath } func (library *libraryDecorator) overriddenModules() []string { return library.Properties.Overrides } var _ overridable = (*libraryDecorator)(nil) var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList") // versioningMacroNamesList returns a singleton map, where keys are "version macro names", Loading cc/testing.go +19 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package cc import ( "encoding/json" "path/filepath" "testing" Loading Loading @@ -736,3 +737,21 @@ func AssertExcludeFromRecoverySnapshotIs(t *testing.T, ctx *android.TestContext, t.Errorf("expected %q ExcludeFromRecoverySnapshot to be %t", m.String(), expected) } } func checkOverrides(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, jsonPath string, expected []string) { out := singleton.MaybeOutput(jsonPath) content := android.ContentFromFileRuleForTests(t, out) var flags snapshotJsonFlags if err := json.Unmarshal([]byte(content), &flags); err != nil { t.Errorf("Error while unmarshalling json %q: %w", jsonPath, err) return } for _, moduleName := range expected { if !android.InList(moduleName, flags.Overrides) { t.Errorf("expected %q to be in %q: %q", moduleName, flags.Overrides, content) return } } } Loading
cc/androidmk.go +5 −1 Original line number Diff line number Diff line Loading @@ -546,7 +546,7 @@ func (c *snapshotLibraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entrie entries.SubName += c.baseProperties.Androidmk_suffix entries.ExtraEntries = append(entries.ExtraEntries, func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { entries.ExtraEntries = append(entries.ExtraEntries, func(_ android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) { c.libraryDecorator.androidMkWriteExportedFlags(entries) if c.shared() || c.static() { Loading @@ -567,6 +567,10 @@ func (c *snapshotLibraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entrie if c.tocFile.Valid() { entries.SetString("LOCAL_SOONG_TOC", c.tocFile.String()) } if c.shared() && len(c.Properties.Overrides) > 0 { entries.SetString("LOCAL_OVERRIDES_MODULES", strings.Join(makeOverrideModuleNames(ctx, c.Properties.Overrides), " ")) } } if !c.shared() { // static or header Loading
cc/binary.go +6 −0 Original line number Diff line number Diff line Loading @@ -540,6 +540,12 @@ func (binary *binaryDecorator) hostToolPath() android.OptionalPath { return binary.toolPath } func (binary *binaryDecorator) overriddenModules() []string { return binary.Properties.Overrides } var _ overridable = (*binaryDecorator)(nil) func init() { pctx.HostBinToolVariable("verifyHostBionicCmd", "host_bionic_verify") } Loading
cc/cc.go +11 −0 Original line number Diff line number Diff line Loading @@ -616,6 +616,10 @@ type xref interface { XrefCcFiles() android.Paths } type overridable interface { overriddenModules() []string } type libraryDependencyKind int const ( Loading Loading @@ -3642,6 +3646,13 @@ func (c *Module) UniqueApexVariations() bool { return c.UseVndk() && c.IsVndk() } func (c *Module) overriddenModules() []string { if o, ok := c.linker.(overridable); ok { return o.overriddenModules() } return nil } var _ snapshot.RelativeInstallPath = (*Module)(nil) type moduleType int Loading
cc/library.go +6 −0 Original line number Diff line number Diff line Loading @@ -2241,6 +2241,12 @@ func (library *libraryDecorator) getAPIListCoverageXMLPath() android.ModuleOutPa return library.apiListCoverageXmlPath } func (library *libraryDecorator) overriddenModules() []string { return library.Properties.Overrides } var _ overridable = (*libraryDecorator)(nil) var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList") // versioningMacroNamesList returns a singleton map, where keys are "version macro names", Loading
cc/testing.go +19 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ package cc import ( "encoding/json" "path/filepath" "testing" Loading Loading @@ -736,3 +737,21 @@ func AssertExcludeFromRecoverySnapshotIs(t *testing.T, ctx *android.TestContext, t.Errorf("expected %q ExcludeFromRecoverySnapshot to be %t", m.String(), expected) } } func checkOverrides(t *testing.T, ctx *android.TestContext, singleton android.TestingSingleton, jsonPath string, expected []string) { out := singleton.MaybeOutput(jsonPath) content := android.ContentFromFileRuleForTests(t, out) var flags snapshotJsonFlags if err := json.Unmarshal([]byte(content), &flags); err != nil { t.Errorf("Error while unmarshalling json %q: %w", jsonPath, err) return } for _, moduleName := range expected { if !android.InList(moduleName, flags.Overrides) { t.Errorf("expected %q to be in %q: %q", moduleName, flags.Overrides, content) return } } }