Convert Provider to generic providers API
Convert all of the callers of Provider/HasProvider to use the type-safe android.ModuleProvider API. Bug: 316410648 Test: builds Change-Id: I73479de1625fa2865b6c73444cd477e50d56dc5a
This commit is contained in:
parent
402130276c
commit
ff694a8c88
16 changed files with 47 additions and 41 deletions
|
@ -167,7 +167,7 @@ func FindDeapexerProviderForModule(ctx ModuleContext) *DeapexerInfo {
|
||||||
if di != nil {
|
if di != nil {
|
||||||
return di
|
return di
|
||||||
}
|
}
|
||||||
ai := ctx.Provider(ApexInfoProvider).(ApexInfo)
|
ai, _ := ModuleProvider(ctx, ApexInfoProvider)
|
||||||
ctx.ModuleErrorf("No prebuilt APEX provides a deapexer module for APEX variant %s", ai.ApexVariationName)
|
ctx.ModuleErrorf("No prebuilt APEX provides a deapexer module for APEX variant %s", ai.ApexVariationName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1648,7 +1648,7 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
|
||||||
if !ctx.PrimaryArch() {
|
if !ctx.PrimaryArch() {
|
||||||
suffix = append(suffix, ctx.Arch().ArchType.String())
|
suffix = append(suffix, ctx.Arch().ArchType.String())
|
||||||
}
|
}
|
||||||
if apexInfo := ctx.Provider(ApexInfoProvider).(ApexInfo); !apexInfo.IsForPlatform() {
|
if apexInfo, _ := ModuleProvider(ctx, ApexInfoProvider); !apexInfo.IsForPlatform() {
|
||||||
suffix = append(suffix, apexInfo.ApexVariationName)
|
suffix = append(suffix, apexInfo.ApexVariationName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2150,7 +2150,7 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext,
|
||||||
af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
|
af := apexFileForNativeLibrary(ctx, ch, vctx.handleSpecialLibs)
|
||||||
af.transitiveDep = true
|
af.transitiveDep = true
|
||||||
|
|
||||||
abInfo := ctx.Provider(ApexBundleInfoProvider).(ApexBundleInfo)
|
abInfo, _ := android.ModuleProvider(ctx, ApexBundleInfoProvider)
|
||||||
if !abInfo.Contents.DirectlyInApex(depName) && (ch.IsStubs() || ch.HasStubsVariants()) {
|
if !abInfo.Contents.DirectlyInApex(depName) && (ch.IsStubs() || ch.HasStubsVariants()) {
|
||||||
// If the dependency is a stubs lib, don't include it in this APEX,
|
// If the dependency is a stubs lib, don't include it in this APEX,
|
||||||
// but make sure that the lib is installed on the device.
|
// but make sure that the lib is installed on the device.
|
||||||
|
@ -2589,7 +2589,7 @@ func (a *apexBundle) checkStaticLinkingToStubLibraries(ctx android.ModuleContext
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
abInfo := ctx.Provider(ApexBundleInfoProvider).(ApexBundleInfo)
|
abInfo, _ := android.ModuleProvider(ctx, ApexBundleInfoProvider)
|
||||||
|
|
||||||
a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
|
a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
|
||||||
if ccm, ok := to.(*cc.Module); ok {
|
if ccm, ok := to.(*cc.Module); ok {
|
||||||
|
|
14
cc/cc.go
14
cc/cc.go
|
@ -1744,11 +1744,13 @@ func (ctx *moduleContextImpl) getVndkExtendsModuleName() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *moduleContextImpl) isForPlatform() bool {
|
func (ctx *moduleContextImpl) isForPlatform() bool {
|
||||||
return ctx.ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
apexInfo, _ := android.ModuleProvider(ctx.ctx, android.ApexInfoProvider)
|
||||||
|
return apexInfo.IsForPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *moduleContextImpl) apexVariationName() string {
|
func (ctx *moduleContextImpl) apexVariationName() string {
|
||||||
return ctx.ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).ApexVariationName
|
apexInfo, _ := android.ModuleProvider(ctx.ctx, android.ApexInfoProvider)
|
||||||
|
return apexInfo.ApexVariationName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *moduleContextImpl) apexSdkVersion() android.ApiLevel {
|
func (ctx *moduleContextImpl) apexSdkVersion() android.ApiLevel {
|
||||||
|
@ -1991,7 +1993,7 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Properties.SubName = GetSubnameProperty(actx, c)
|
c.Properties.SubName = GetSubnameProperty(actx, c)
|
||||||
apexInfo := actx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(actx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
c.hideApexVariantFromMake = true
|
c.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
@ -2982,7 +2984,7 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
||||||
depPaths.ReexportedGeneratedHeaders = append(depPaths.ReexportedGeneratedHeaders, exporter.GeneratedHeaders...)
|
depPaths.ReexportedGeneratedHeaders = append(depPaths.ReexportedGeneratedHeaders, exporter.GeneratedHeaders...)
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
c.apexSdkVersion = findApexSdkVersion(ctx, apexInfo)
|
c.apexSdkVersion = findApexSdkVersion(ctx, apexInfo)
|
||||||
|
|
||||||
skipModuleList := map[string]bool{}
|
skipModuleList := map[string]bool{}
|
||||||
|
@ -3402,7 +3404,7 @@ func ShouldUseStubForApex(ctx android.ModuleContext, dep android.Module) bool {
|
||||||
bootstrap = linkable.Bootstrap()
|
bootstrap = linkable.Bootstrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
|
||||||
useStubs := false
|
useStubs := false
|
||||||
|
|
||||||
|
@ -3436,7 +3438,7 @@ func ShouldUseStubForApex(ctx android.ModuleContext, dep android.Module) bool {
|
||||||
// Another exception: if this module is a test for an APEX, then
|
// Another exception: if this module is a test for an APEX, then
|
||||||
// it is linked with the non-stub variant of a module in the APEX
|
// it is linked with the non-stub variant of a module in the APEX
|
||||||
// as if this is part of the APEX.
|
// as if this is part of the APEX.
|
||||||
testFor := ctx.Provider(android.ApexTestForInfoProvider).(android.ApexTestForInfo)
|
testFor, _ := android.ModuleProvider(ctx, android.ApexTestForInfoProvider)
|
||||||
for _, apexContents := range testFor.ApexContents {
|
for _, apexContents := range testFor.ApexContents {
|
||||||
if apexContents.DirectlyInApex(depName) {
|
if apexContents.DirectlyInApex(depName) {
|
||||||
useStubs = false
|
useStubs = false
|
||||||
|
|
|
@ -194,8 +194,8 @@ func shouldCreateSourceAbiDumpForLibrary(ctx android.BaseModuleContext) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
isPlatformVariant := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if isPlatformVariant {
|
if apexInfo.IsForPlatform() {
|
||||||
// Bionic libraries that are installed to the bootstrap directory are not ABI checked.
|
// Bionic libraries that are installed to the bootstrap directory are not ABI checked.
|
||||||
// Only the runtime APEX variants, which are the implementation libraries of bionic NDK stubs,
|
// Only the runtime APEX variants, which are the implementation libraries of bionic NDK stubs,
|
||||||
// are checked.
|
// are checked.
|
||||||
|
|
|
@ -1627,7 +1627,7 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
|
||||||
|
|
||||||
addStaticDeps := func(dep string, hideSymbols bool) {
|
addStaticDeps := func(dep string, hideSymbols bool) {
|
||||||
// If we're using snapshots, redirect to snapshot whenever possible
|
// If we're using snapshots, redirect to snapshot whenever possible
|
||||||
snapshot := mctx.Provider(SnapshotInfoProvider).(SnapshotInfo)
|
snapshot, _ := android.ModuleProvider(mctx, SnapshotInfoProvider)
|
||||||
if lib, ok := snapshot.StaticLibs[dep]; ok {
|
if lib, ok := snapshot.StaticLibs[dep]; ok {
|
||||||
dep = lib
|
dep = lib
|
||||||
}
|
}
|
||||||
|
@ -1714,7 +1714,7 @@ func sanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
|
||||||
addStaticDeps(runtimeSharedLibrary, true)
|
addStaticDeps(runtimeSharedLibrary, true)
|
||||||
} else if !c.static() && !c.Header() {
|
} else if !c.static() && !c.Header() {
|
||||||
// If we're using snapshots, redirect to snapshot whenever possible
|
// If we're using snapshots, redirect to snapshot whenever possible
|
||||||
snapshot := mctx.Provider(SnapshotInfoProvider).(SnapshotInfo)
|
snapshot, _ := android.ModuleProvider(mctx, SnapshotInfoProvider)
|
||||||
if lib, ok := snapshot.SharedLibs[runtimeSharedLibrary]; ok {
|
if lib, ok := snapshot.SharedLibs[runtimeSharedLibrary]; ok {
|
||||||
runtimeSharedLibrary = lib
|
runtimeSharedLibrary = lib
|
||||||
}
|
}
|
||||||
|
|
|
@ -805,7 +805,8 @@ func (a *AndroidLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
a.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
a.hideApexVariantFromMake = !apexInfo.IsForPlatform()
|
||||||
|
|
||||||
a.stem = proptools.StringDefault(a.overridableDeviceProperties.Stem, ctx.ModuleName())
|
a.stem = proptools.StringDefault(a.overridableDeviceProperties.Stem, ctx.ModuleName())
|
||||||
|
|
||||||
|
@ -1106,7 +1107,8 @@ func (a *AARImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
a.sdkVersion = a.SdkVersion(ctx)
|
a.sdkVersion = a.SdkVersion(ctx)
|
||||||
a.minSdkVersion = a.MinSdkVersion(ctx)
|
a.minSdkVersion = a.MinSdkVersion(ctx)
|
||||||
|
|
||||||
a.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
a.hideApexVariantFromMake = !apexInfo.IsForPlatform()
|
||||||
|
|
||||||
aarName := ctx.ModuleName() + ".aar"
|
aarName := ctx.ModuleName() + ".aar"
|
||||||
a.aarPath = android.PathForModuleSrc(ctx, a.properties.Aars[0])
|
a.aarPath = android.PathForModuleSrc(ctx, a.properties.Aars[0])
|
||||||
|
|
|
@ -411,7 +411,7 @@ func (a *AndroidApp) useEmbeddedNativeLibs(ctx android.ModuleContext) bool {
|
||||||
ctx.PropertyErrorf("min_sdk_version", "invalid value %q: %s", a.MinSdkVersion(ctx), err)
|
ctx.PropertyErrorf("min_sdk_version", "invalid value %q: %s", a.MinSdkVersion(ctx), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
return (minSdkVersion.FinalOrFutureInt() >= 23 && Bool(a.appProperties.Use_embedded_native_libs)) ||
|
return (minSdkVersion.FinalOrFutureInt() >= 23 && Bool(a.appProperties.Use_embedded_native_libs)) ||
|
||||||
!apexInfo.IsForPlatform()
|
!apexInfo.IsForPlatform()
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,7 @@ func (a *AndroidApp) shouldUncompressDex(ctx android.ModuleContext) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AndroidApp) shouldEmbedJnis(ctx android.BaseModuleContext) bool {
|
func (a *AndroidApp) shouldEmbedJnis(ctx android.BaseModuleContext) bool {
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
return ctx.Config().UnbundledBuild() || Bool(a.appProperties.Use_embedded_native_libs) ||
|
return ctx.Config().UnbundledBuild() || Bool(a.appProperties.Use_embedded_native_libs) ||
|
||||||
!apexInfo.IsForPlatform() || a.appProperties.AlwaysPackageNativeLibs
|
!apexInfo.IsForPlatform() || a.appProperties.AlwaysPackageNativeLibs
|
||||||
}
|
}
|
||||||
|
@ -745,7 +745,8 @@ func (a *AndroidApp) createPrivappAllowlist(ctx android.ModuleContext) android.P
|
||||||
func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
var apkDeps android.Paths
|
var apkDeps android.Paths
|
||||||
|
|
||||||
if !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform() {
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
if !apexInfo.IsForPlatform() {
|
||||||
a.hideApexVariantFromMake = true
|
a.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -890,8 +891,6 @@ func (a *AndroidApp) generateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
a.privAppAllowlist = android.OptionalPathForPath(allowlist)
|
a.privAppAllowlist = android.OptionalPathForPath(allowlist)
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
|
||||||
|
|
||||||
// Install the app package.
|
// Install the app package.
|
||||||
shouldInstallAppPackage := (Bool(a.Module.properties.Installable) || ctx.Host()) && apexInfo.IsForPlatform() && !a.appProperties.PreventInstall
|
shouldInstallAppPackage := (Bool(a.Module.properties.Installable) || ctx.Host()) && apexInfo.IsForPlatform() && !a.appProperties.PreventInstall
|
||||||
if shouldInstallAppPackage {
|
if shouldInstallAppPackage {
|
||||||
|
|
|
@ -257,7 +257,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext
|
||||||
ctx.ModuleErrorf("prebuilt_framework-res found. This used to have special handling in soong, but was removed due to prebuilt_framework-res no longer existing. This check is to ensure it doesn't come back without readding the special handling.")
|
ctx.ModuleErrorf("prebuilt_framework-res found. This used to have special handling in soong, but was removed due to prebuilt_framework-res no longer existing. This check is to ensure it doesn't come back without readding the special handling.")
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
a.hideApexVariantFromMake = true
|
a.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -685,7 +685,7 @@ func (j *Module) shouldInstrumentInApex(ctx android.BaseModuleContext) bool {
|
||||||
// Force enable the instrumentation for java code that is built for APEXes ...
|
// Force enable the instrumentation for java code that is built for APEXes ...
|
||||||
// except for the jacocoagent itself (because instrumenting jacocoagent using jacocoagent
|
// except for the jacocoagent itself (because instrumenting jacocoagent using jacocoagent
|
||||||
// doesn't make sense) or framework libraries (e.g. libraries found in the InstrumentFrameworkModules list) unless EMMA_INSTRUMENT_FRAMEWORK is true.
|
// doesn't make sense) or framework libraries (e.g. libraries found in the InstrumentFrameworkModules list) unless EMMA_INSTRUMENT_FRAMEWORK is true.
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
isJacocoAgent := ctx.ModuleName() == "jacocoagent"
|
isJacocoAgent := ctx.ModuleName() == "jacocoagent"
|
||||||
if j.DirectlyInAnyApex() && !isJacocoAgent && !apexInfo.IsForPlatform() {
|
if j.DirectlyInAnyApex() && !isJacocoAgent && !apexInfo.IsForPlatform() {
|
||||||
if !inList(ctx.ModuleName(), config.InstrumentFrameworkModules) {
|
if !inList(ctx.ModuleName(), config.InstrumentFrameworkModules) {
|
||||||
|
@ -1572,7 +1572,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
|
||||||
|
|
||||||
// Enable dex compilation for the APEX variants, unless it is disabled explicitly
|
// Enable dex compilation for the APEX variants, unless it is disabled explicitly
|
||||||
compileDex := j.dexProperties.Compile_dex
|
compileDex := j.dexProperties.Compile_dex
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if j.DirectlyInAnyApex() && !apexInfo.IsForPlatform() {
|
if j.DirectlyInAnyApex() && !apexInfo.IsForPlatform() {
|
||||||
if compileDex == nil {
|
if compileDex == nil {
|
||||||
compileDex = proptools.BoolPtr(true)
|
compileDex = proptools.BoolPtr(true)
|
||||||
|
|
|
@ -512,7 +512,7 @@ func (b *BootclasspathFragmentModule) getProfileProviderApex(ctx android.BaseMod
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bootclasspath fragment modules that are for the platform do not produce boot related files.
|
// Bootclasspath fragment modules that are for the platform do not produce boot related files.
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
for _, apex := range apexInfo.InApexVariants {
|
for _, apex := range apexInfo.InApexVariants {
|
||||||
if isProfileProviderApex(ctx, apex) {
|
if isProfileProviderApex(ctx, apex) {
|
||||||
return apex
|
return apex
|
||||||
|
|
|
@ -166,12 +166,12 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func isApexVariant(ctx android.BaseModuleContext) bool {
|
func isApexVariant(ctx android.BaseModuleContext) bool {
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
return !apexInfo.IsForPlatform()
|
return !apexInfo.IsForPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
func forPrebuiltApex(ctx android.BaseModuleContext) bool {
|
func forPrebuiltApex(ctx android.BaseModuleContext) bool {
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
return apexInfo.ForPrebuiltApex
|
return apexInfo.ForPrebuiltApex
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
11
java/java.go
11
java/java.go
|
@ -647,7 +647,7 @@ func (j *Library) PermittedPackagesForUpdatableBootJars() []string {
|
||||||
|
|
||||||
func shouldUncompressDex(ctx android.ModuleContext, dexpreopter *dexpreopter) bool {
|
func shouldUncompressDex(ctx android.ModuleContext, dexpreopter *dexpreopter) bool {
|
||||||
// Store uncompressed (and aligned) any dex files from jars in APEXes.
|
// Store uncompressed (and aligned) any dex files from jars in APEXes.
|
||||||
if apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo); !apexInfo.IsForPlatform() {
|
if apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider); !apexInfo.IsForPlatform() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -695,7 +695,7 @@ func (j *Library) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
writeCombinedProguardFlagsFile(ctx, combinedExportedProguardFlagFile, exportedProguardFlagsFiles)
|
writeCombinedProguardFlagsFile(ctx, combinedExportedProguardFlagFile, exportedProguardFlagsFiles)
|
||||||
j.combinedExportedProguardFlagsFile = combinedExportedProguardFlagFile
|
j.combinedExportedProguardFlagsFile = combinedExportedProguardFlagFile
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
j.hideApexVariantFromMake = true
|
j.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
@ -2188,7 +2188,8 @@ func (j *Import) commonBuildActions(ctx android.ModuleContext) {
|
||||||
j.sdkVersion = j.SdkVersion(ctx)
|
j.sdkVersion = j.SdkVersion(ctx)
|
||||||
j.minSdkVersion = j.MinSdkVersion(ctx)
|
j.minSdkVersion = j.MinSdkVersion(ctx)
|
||||||
|
|
||||||
if !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform() {
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
if !apexInfo.IsForPlatform() {
|
||||||
j.hideApexVariantFromMake = true
|
j.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2247,7 +2248,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
// If this is a variant created for a prebuilt_apex then use the dex implementation jar
|
// If this is a variant created for a prebuilt_apex then use the dex implementation jar
|
||||||
// obtained from the associated deapexer module.
|
// obtained from the associated deapexer module.
|
||||||
ai := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
ai, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if ai.ForPrebuiltApex {
|
if ai.ForPrebuiltApex {
|
||||||
// Get the path of the dex implementation jar from the `deapexer` module.
|
// Get the path of the dex implementation jar from the `deapexer` module.
|
||||||
di := android.FindDeapexerProviderForModule(ctx)
|
di := android.FindDeapexerProviderForModule(ctx)
|
||||||
|
@ -2570,7 +2571,7 @@ func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
ctx.PropertyErrorf("jars", "exactly one jar must be provided")
|
ctx.PropertyErrorf("jars", "exactly one jar must be provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
j.hideApexVariantFromMake = true
|
j.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
|
|
@ -2036,7 +2036,7 @@ func PrebuiltJars(ctx android.BaseModuleContext, baseName string, s android.SdkS
|
||||||
// If either this or the other module are on the platform then this will return
|
// If either this or the other module are on the platform then this will return
|
||||||
// false.
|
// false.
|
||||||
func withinSameApexesAs(ctx android.BaseModuleContext, other android.Module) bool {
|
func withinSameApexesAs(ctx android.BaseModuleContext, other android.Module) bool {
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
otherApexInfo := ctx.OtherModuleProvider(other, android.ApexInfoProvider).(android.ApexInfo)
|
otherApexInfo := ctx.OtherModuleProvider(other, android.ApexInfoProvider).(android.ApexInfo)
|
||||||
return len(otherApexInfo.InApexVariants) > 0 && reflect.DeepEqual(apexInfo.InApexVariants, otherApexInfo.InApexVariants)
|
return len(otherApexInfo.InApexVariants) > 0 && reflect.DeepEqual(apexInfo.InApexVariants, otherApexInfo.InApexVariants)
|
||||||
}
|
}
|
||||||
|
@ -2693,7 +2693,7 @@ func (module *SdkLibraryImport) GenerateAndroidBuildActions(ctx android.ModuleCo
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
// If this is a variant created for a prebuilt_apex then use the dex implementation jar
|
// If this is a variant created for a prebuilt_apex then use the dex implementation jar
|
||||||
// obtained from the associated deapexer module.
|
// obtained from the associated deapexer module.
|
||||||
ai := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
ai, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if ai.ForPrebuiltApex {
|
if ai.ForPrebuiltApex {
|
||||||
// Get the path of the dex implementation jar from the `deapexer` module.
|
// Get the path of the dex implementation jar from the `deapexer` module.
|
||||||
di := android.FindDeapexerProviderForModule(ctx)
|
di := android.FindDeapexerProviderForModule(ctx)
|
||||||
|
@ -2960,7 +2960,7 @@ func (module *sdkLibraryXml) ShouldSupportSdkVersion(ctx android.BaseModuleConte
|
||||||
// File path to the runtime implementation library
|
// File path to the runtime implementation library
|
||||||
func (module *sdkLibraryXml) implPath(ctx android.ModuleContext) string {
|
func (module *sdkLibraryXml) implPath(ctx android.ModuleContext) string {
|
||||||
implName := proptools.String(module.properties.Lib_name)
|
implName := proptools.String(module.properties.Lib_name)
|
||||||
if apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo); !apexInfo.IsForPlatform() {
|
if apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider); !apexInfo.IsForPlatform() {
|
||||||
// TODO(b/146468504): ApexVariationName() is only a soong module name, not apex name.
|
// TODO(b/146468504): ApexVariationName() is only a soong module name, not apex name.
|
||||||
// In most cases, this works fine. But when apex_name is set or override_apex is used
|
// In most cases, this works fine. But when apex_name is set or override_apex is used
|
||||||
// this can be wrong.
|
// this can be wrong.
|
||||||
|
@ -3067,7 +3067,8 @@ func (module *sdkLibraryXml) permissionsContents(ctx android.ModuleContext) stri
|
||||||
}
|
}
|
||||||
|
|
||||||
func (module *sdkLibraryXml) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
func (module *sdkLibraryXml) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||||
module.hideApexVariantFromMake = !ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).IsForPlatform()
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
module.hideApexVariantFromMake = !apexInfo.IsForPlatform()
|
||||||
|
|
||||||
libName := proptools.String(module.properties.Lib_name)
|
libName := proptools.String(module.properties.Lib_name)
|
||||||
module.selfValidate(ctx)
|
module.selfValidate(ctx)
|
||||||
|
|
|
@ -747,7 +747,8 @@ func (mod *Module) installable(apexInfo android.ApexInfo) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx moduleContext) apexVariationName() string {
|
func (ctx moduleContext) apexVariationName() string {
|
||||||
return ctx.Provider(android.ApexInfoProvider).(android.ApexInfo).ApexVariationName
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
|
return apexInfo.ApexVariationName
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ cc.LinkableInterface = (*Module)(nil)
|
var _ cc.LinkableInterface = (*Module)(nil)
|
||||||
|
@ -897,7 +898,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||||
ModuleContext: actx,
|
ModuleContext: actx,
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := actx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(actx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
mod.hideApexVariantFromMake = true
|
mod.hideApexVariantFromMake = true
|
||||||
}
|
}
|
||||||
|
@ -978,7 +979,7 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apexInfo := actx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(actx, android.ApexInfoProvider)
|
||||||
if !proptools.BoolDefault(mod.Installable(), mod.EverInstallable()) && !mod.ProcMacro() {
|
if !proptools.BoolDefault(mod.Installable(), mod.EverInstallable()) && !mod.ProcMacro() {
|
||||||
// If the module has been specifically configure to not be installed then
|
// If the module has been specifically configure to not be installed then
|
||||||
// hide from make as otherwise it will break when running inside make as the
|
// hide from make as otherwise it will break when running inside make as the
|
||||||
|
@ -1148,7 +1149,7 @@ func (mod *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
|
||||||
|
|
||||||
// For the dependency from platform to apex, use the latest stubs
|
// For the dependency from platform to apex, use the latest stubs
|
||||||
mod.apexSdkVersion = android.FutureApiLevel
|
mod.apexSdkVersion = android.FutureApiLevel
|
||||||
apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo)
|
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||||
if !apexInfo.IsForPlatform() {
|
if !apexInfo.IsForPlatform() {
|
||||||
mod.apexSdkVersion = apexInfo.MinSdkVersion
|
mod.apexSdkVersion = apexInfo.MinSdkVersion
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,7 +270,7 @@ func rustSanitizerRuntimeMutator(mctx android.BottomUpMutatorContext) {
|
||||||
}
|
}
|
||||||
// If we're using snapshots, redirect to snapshot whenever possible
|
// If we're using snapshots, redirect to snapshot whenever possible
|
||||||
// TODO(b/178470649): clean manual snapshot redirections
|
// TODO(b/178470649): clean manual snapshot redirections
|
||||||
snapshot := mctx.Provider(cc.SnapshotInfoProvider).(cc.SnapshotInfo)
|
snapshot, _ := android.ModuleProvider(mctx, cc.SnapshotInfoProvider)
|
||||||
if lib, ok := snapshot.StaticLibs[noteDep]; ok {
|
if lib, ok := snapshot.StaticLibs[noteDep]; ok {
|
||||||
noteDep = lib
|
noteDep = lib
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue