aboutsummaryrefslogtreecommitdiff
path: root/android/sdk.go
diff options
context:
space:
mode:
authormosimchah <mosimchah@gmail.com>2025-12-02 09:27:38 -0500
committermosimchah <mosimchah@gmail.com>2025-12-02 09:27:38 -0500
commitc7bade461dc55726f62997d13a48582f7c4b4655 (patch)
treeea0588da76060a2038f54f67efd046ca77634b10 /android/sdk.go
parent0f5414d19317805e8bbbe7c4db5f0fd78769bad5 (diff)
parent89d78cff8b00d3b20a90074635c3fe5a2ee49474 (diff)
Merge branch 'lineage-23.1' of https://github.com/LineageOS/android_build_soong into HEADw16.1
* 'lineage-23.1' of https://github.com/LineageOS/android_build_soong: (528 commits) Revert "install_symlink: Make symlink target configurable" Reapply "Clear as much of cc.Module as possible after GenerateBuildActions" Revert "rust: config: Fix missing CPU variant LD flags in Rust" Rename build-flag in outdir Revert^4 "cipd: Default CIPD proxy server to on, add opt-out" Convert check-vintf-all to phony with actions Create a partial implementation of check-vintf-all for soong-only Configure RBE rust pool based on build variant Revert^3 "Add sdk version check to arr" Add jdk.internal.invoke to the allowlist Make droid always depend on symbols zip Import Device and Odm skus Don't install gob_gen in Soong Remove bazel reference from run_integration_tests.sh Fix bootstrap_test.sh Don't panic in aconfig libraries when AllowMissingDependencies is set Avoid returning nil paths from PathForModuleSrc Revert "Flag controled clang version" Rework module target dependencies on required deps Revert^2 "Add sdk version check to arr" ... Change-Id: I6e9a63fa14fda917a42e426e5dcebbad7f67e1de
Diffstat (limited to 'android/sdk.go')
-rw-r--r--android/sdk.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/android/sdk.go b/android/sdk.go
index ab9a91ccb..007fa2980 100644
--- a/android/sdk.go
+++ b/android/sdk.go
@@ -23,6 +23,8 @@ import (
"github.com/google/blueprint/proptools"
)
+//go:generate go run ../../blueprint/gobtools/codegen/gob_gen.go
+
// minApiLevelForSdkSnapshot provides access to the min_sdk_version for MinApiLevelForSdkSnapshot
type minApiLevelForSdkSnapshot interface {
MinSdkVersion(ctx EarlyModuleContext) ApiLevel
@@ -31,14 +33,14 @@ type minApiLevelForSdkSnapshot interface {
// MinApiLevelForSdkSnapshot returns the ApiLevel of the min_sdk_version of the supplied module.
//
// If the module does not provide a min_sdk_version then it defaults to 1.
-func MinApiLevelForSdkSnapshot(ctx EarlyModuleContext, module Module) ApiLevel {
+func MinApiLevelForSdkSnapshot(commonInfo *CommonModuleInfo) ApiLevel {
minApiLevel := NoneApiLevel
- if m, ok := module.(minApiLevelForSdkSnapshot); ok {
- minApiLevel = m.MinSdkVersion(ctx)
+ if commonInfo.MinSdkVersion.ApiLevel != nil {
+ minApiLevel = *commonInfo.MinSdkVersion.ApiLevel
}
if minApiLevel == NoneApiLevel {
// The default min API level is 1.
- minApiLevel = uncheckedFinalApiLevel(1)
+ minApiLevel = UncheckedFinalApiLevel(1)
}
return minApiLevel
}
@@ -410,7 +412,7 @@ type SdkMember interface {
Name() string
// Variants returns all the variants of this module depended upon by the SDK.
- Variants() []Module
+ Variants() []ModuleProxy
}
// SdkMemberDependencyTag is the interface that a tag must implement in order to allow the
@@ -422,7 +424,7 @@ type SdkMemberDependencyTag interface {
// to the sdk.
//
// Returning nil will prevent the module being added to the sdk.
- SdkMemberType(child Module) SdkMemberType
+ SdkMemberType(ctx ModuleContext, child ModuleProxy) SdkMemberType
// ExportMember determines whether a module added to the sdk through this tag will be exported
// from the sdk or not.
@@ -449,7 +451,7 @@ type sdkMemberDependencyTag struct {
export bool
}
-func (t *sdkMemberDependencyTag) SdkMemberType(_ Module) SdkMemberType {
+func (t *sdkMemberDependencyTag) SdkMemberType(_ ModuleContext, _ ModuleProxy) SdkMemberType {
return t.memberType
}
@@ -534,7 +536,7 @@ type SdkMemberType interface {
// This is used to check the type of each variant before added to the SdkMember. Returning false
// will cause an error to be logged explaining that the module is not allowed in whichever sdk
// property it was added.
- IsInstance(module Module) bool
+ IsInstance(ctx ModuleContext, module ModuleProxy) bool
// UsesSourceModuleTypeInSnapshot returns true when the AddPrebuiltModule() method returns a
// source module type.
@@ -611,6 +613,7 @@ type SdkDependencyContext interface {
// SdkMemberTypeBase is the base type for SdkMemberType implementations and must be embedded in any
// struct that implements SdkMemberType.
+// @auto-generate: gob
type SdkMemberTypeBase struct {
PropertyName string
@@ -800,7 +803,7 @@ type SdkMemberProperties interface {
// PopulateFromVariant populates this structure with information from a module variant.
//
// It will typically be called once for each variant of a member module that the SDK depends upon.
- PopulateFromVariant(ctx SdkMemberContext, variant Module)
+ PopulateFromVariant(ctx SdkMemberContext, variant ModuleProxy)
// AddToPropertySet adds the information from this structure to the property set.
//