summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go35
1 files changed, 18 insertions, 17 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 8e35e07c0..0108c0f0d 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -565,7 +565,6 @@ func makeApexAvailableBaseline() map[string][]string {
"libdebuggerd_handler_fallback",
"libdexfile_external_headers",
"libdexfile_support",
- "libdexfile_support_static",
"libdl_static",
"libjemalloc5",
"liblinker_main",
@@ -795,7 +794,7 @@ func apexDepsMutator(mctx android.TopDownMutatorContext) {
}
apexInfo := android.ApexInfo{
ApexVariationName: mctx.ModuleName(),
- MinSdkVersion: a.minSdkVersion(mctx),
+ MinSdkVersionStr: a.minSdkVersion(mctx).String(),
RequiredSdks: a.RequiredSdks(),
Updatable: a.Updatable(),
InApexes: []string{mctx.ModuleName()},
@@ -1499,6 +1498,12 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
}
}
for i, target := range targets {
+ if target.HostCross {
+ // Don't include artifats for the host cross targets because there is no way
+ // for us to run those artifacts natively on host
+ continue
+ }
+
// When multilib.* is omitted for native_shared_libs/jni_libs/tests, it implies
// multilib.both
addDependenciesForNativeModules(ctx,
@@ -1952,27 +1957,21 @@ func (a *apexBundle) WalkPayloadDeps(ctx android.ModuleContext, do android.Paylo
})
}
-func (a *apexBundle) minSdkVersion(ctx android.BaseModuleContext) int {
+func (a *apexBundle) minSdkVersion(ctx android.BaseModuleContext) android.ApiLevel {
ver := proptools.String(a.properties.Min_sdk_version)
if ver == "" {
return android.FutureApiLevel
}
- // Treat the current codenames as "current", which means future API version (10000)
- // Otherwise, ApiStrToNum converts codename(non-finalized) to a value from [9000...]
- // and would fail to build against "current".
- if android.InList(ver, ctx.Config().PlatformVersionActiveCodenames()) {
- return android.FutureApiLevel
- }
- // In "REL" branch, "current" is mapped to finalized sdk version
- if ctx.Config().PlatformSdkCodename() == "REL" && ver == "current" {
- return ctx.Config().PlatformSdkVersionInt()
- }
- // Finalized codenames are OKAY and will be converted to int
- intVer, err := android.ApiStrToNum(ctx, ver)
+ apiLevel, err := android.ApiLevelFromUser(ctx, ver)
if err != nil {
ctx.PropertyErrorf("min_sdk_version", "%s", err.Error())
+ return android.NoneApiLevel
+ }
+ if apiLevel.IsPreview() {
+ // All codenames should build against "current".
+ return android.FutureApiLevel
}
- return intVer
+ return apiLevel
}
func (a *apexBundle) Updatable() bool {
@@ -2046,7 +2045,9 @@ func (a *apexBundle) checkMinSdkVersion(ctx android.ModuleContext) {
if proptools.Bool(a.properties.Use_vendor) && ctx.DeviceConfig().VndkVersion() == "" {
return
}
- android.CheckMinSdkVersion(a, ctx, a.minSdkVersion(ctx))
+ // apexBundle::minSdkVersion reports its own errors.
+ minSdkVersion := a.minSdkVersion(ctx)
+ android.CheckMinSdkVersion(a, ctx, minSdkVersion)
}
// Ensures that a lib providing stub isn't statically linked