diff options
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/android/module.go b/android/module.go index 3295e93be..55dd119e0 100644 --- a/android/module.go +++ b/android/module.go @@ -1898,7 +1898,7 @@ type CommonModuleInfo struct { SkipAndroidMkProcessing bool BaseModuleName string CanHaveApexVariants bool - MinSdkVersion string + MinSdkVersion ApiLevelOrPlatform SdkVersion string NotAvailableForPlatform bool // There some subtle differences between this one and the one above. @@ -1914,6 +1914,11 @@ type CommonModuleInfo struct { Host bool } +type ApiLevelOrPlatform struct { + ApiLevel *ApiLevel + IsPlatform bool +} + var CommonModuleInfoKey = blueprint.NewProvider[CommonModuleInfo]() type PrebuiltModuleInfo struct { @@ -2255,11 +2260,16 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) MinSdkVersion(ctx EarlyModuleContext) ApiLevel }); ok { ver := mm.MinSdkVersion(ctx) - if !ver.IsNone() { - commonData.MinSdkVersion = ver.String() - } + commonData.MinSdkVersion.ApiLevel = &ver } else if mm, ok := m.module.(interface{ MinSdkVersion() string }); ok { - commonData.MinSdkVersion = mm.MinSdkVersion() + ver := mm.MinSdkVersion() + // Compile against the current platform + if ver == "" { + commonData.MinSdkVersion.IsPlatform = true + } else { + api := ApiLevelFrom(ctx, ver) + commonData.MinSdkVersion.ApiLevel = &api + } } if mm, ok := m.module.(interface { @@ -3001,6 +3011,9 @@ func AddAncestors(ctx SingletonContext, dirMap map[string]Paths, mmName func(str func (c *buildTargetSingleton) GenerateBuildActions(ctx SingletonContext) { var checkbuildDeps Paths + // Create a top level partialcompileclean target for modules to add dependencies to. + ctx.Phony("partialcompileclean") + mmTarget := func(dir string) string { return "MODULES-IN-" + strings.Replace(filepath.Clean(dir), "/", "-", -1) } |