Merge changes Iba57c949,Ief43ff51,Ib1809a4d,I2ab64f36

* changes:
  Store ndkKnownLibs in the config
  Register the kythe singleton on the Context instead of globally
  Store ninja file deps from PackageVarContext in the config
  Store SingletonMakeVarsProviders in the config
This commit is contained in:
Treehugger Robot
2020-11-18 20:00:31 +00:00
committed by Gerrit Code Review
14 changed files with 183 additions and 61 deletions

View File

@@ -88,7 +88,7 @@ func RegisterCCBuildComponents(ctx android.RegistrationContext) {
ctx.TopDown("double_loadable", checkDoubleLoadableLibraries).Parallel()
})
android.RegisterSingletonType("kythe_extract_all", kytheExtractAllFactory)
ctx.RegisterSingletonType("kythe_extract_all", kytheExtractAllFactory)
}
type Deps struct {
@@ -369,7 +369,7 @@ type ModuleContextIntf interface {
useSdk() bool
sdkVersion() string
useVndk() bool
isNdk() bool
isNdk(config android.Config) bool
isLlndk(config android.Config) bool
isLlndkPublic(config android.Config) bool
isVndkPrivate(config android.Config) bool
@@ -939,8 +939,8 @@ func (c *Module) isCoverageVariant() bool {
return c.coverage.Properties.IsCoverageVariant
}
func (c *Module) IsNdk() bool {
return inList(c.BaseModuleName(), ndkKnownLibs)
func (c *Module) IsNdk(config android.Config) bool {
return inList(c.BaseModuleName(), *getNDKKnownLibs(config))
}
func (c *Module) isLlndk(config android.Config) bool {
@@ -1145,8 +1145,8 @@ func (ctx *moduleContextImpl) useVndk() bool {
return ctx.mod.UseVndk()
}
func (ctx *moduleContextImpl) isNdk() bool {
return ctx.mod.IsNdk()
func (ctx *moduleContextImpl) isNdk(config android.Config) bool {
return ctx.mod.IsNdk(config)
}
func (ctx *moduleContextImpl) isLlndk(config android.Config) bool {
@@ -1766,7 +1766,7 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) {
for _, entry := range list {
// strip #version suffix out
name, _ := StubsLibNameAndVersion(entry)
if ctx.useSdk() && inList(name, ndkKnownLibs) {
if ctx.useSdk() && inList(name, *getNDKKnownLibs(ctx.Config())) {
variantLibs = append(variantLibs, name+ndkLibrarySuffix)
} else if ctx.useVndk() {
nonvariantLibs = append(nonvariantLibs, rewriteVendorLibs(entry))