summaryrefslogtreecommitdiff
path: root/apex/apex.go
diff options
context:
space:
mode:
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go40
1 files changed, 19 insertions, 21 deletions
diff --git a/apex/apex.go b/apex/apex.go
index 62013cf63..b3398156d 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -34,6 +34,7 @@ import (
prebuilt_etc "android/soong/etc"
"android/soong/filesystem"
"android/soong/java"
+ "android/soong/multitree"
"android/soong/python"
"android/soong/rust"
"android/soong/sh"
@@ -159,12 +160,6 @@ type apexBundleProperties struct {
// or else conflicting build rules may be created.
Multi_install_skip_symbol_files *bool
- // List of SDKs that are used to build this APEX. A reference to an SDK should be either
- // `name#version` or `name` which is an alias for `name#current`. If left empty,
- // `platform#current` is implied. This value affects all modules included in this APEX. In
- // other words, they are also built with the SDKs specified here.
- Uses_sdks []string
-
// The type of APEX to build. Controls what the APEX payload is. Either 'image', 'zip' or
// 'both'. When set to image, contents are stored in a filesystem image inside a zip
// container. When set to zip, contents are stored in a zip container directly. This type is
@@ -359,6 +354,7 @@ type apexBundle struct {
android.OverridableModuleBase
android.SdkBase
android.BazelModuleBase
+ multitree.ExportableModuleBase
// Properties
properties apexBundleProperties
@@ -790,19 +786,6 @@ func (a *apexBundle) DepsMutator(ctx android.BottomUpMutatorContext) {
commonVariation := ctx.Config().AndroidCommonTarget.Variations()
ctx.AddFarVariationDependencies(commonVariation, fsTag, a.properties.Filesystems...)
ctx.AddFarVariationDependencies(commonVariation, compatConfigTag, a.properties.Compat_configs...)
-
- // Marks that this APEX (in fact all the modules in it) has to be built with the given SDKs.
- // This field currently isn't used.
- // TODO(jiyong): consider dropping this feature
- // TODO(jiyong): ensure that all apexes are with non-empty uses_sdks
- if len(a.properties.Uses_sdks) > 0 {
- sdkRefs := []android.SdkRef{}
- for _, str := range a.properties.Uses_sdks {
- parsed := android.ParseSdkRef(ctx, str, "uses_sdks")
- sdkRefs = append(sdkRefs, parsed)
- }
- a.BuildWithSdks(sdkRefs)
- }
}
// DepsMutator for the overridden properties.
@@ -967,7 +950,6 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
apexInfo := android.ApexInfo{
ApexVariationName: apexVariationName,
MinSdkVersion: minSdkVersion,
- RequiredSdks: a.RequiredSdks(),
Updatable: a.Updatable(),
UsePlatformApis: a.UsePlatformApis(),
InApexVariants: []string{apexVariationName},
@@ -1360,6 +1342,21 @@ func (a *apexBundle) OutputFiles(tag string) (android.Paths, error) {
}
}
+var _ multitree.Exportable = (*apexBundle)(nil)
+
+func (a *apexBundle) Exportable() bool {
+ if a.properties.ApexType == flattenedApex {
+ return false
+ }
+ return true
+}
+
+func (a *apexBundle) TaggedOutputs() map[string]android.Paths {
+ ret := make(map[string]android.Paths)
+ ret["apex"] = android.Paths{a.outputFile}
+ return ret
+}
+
var _ cc.Coverage = (*apexBundle)(nil)
// Implements cc.Coverage
@@ -2386,6 +2383,7 @@ func newApexBundle() *apexBundle {
android.InitSdkAwareModule(module)
android.InitOverridableModule(module, &module.overridableProperties.Overrides)
android.InitBazelModule(module)
+ multitree.InitExportableModule(module)
return module
}
@@ -3519,7 +3517,7 @@ func (a *apexBundle) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
props := bazel.BazelTargetModuleProperties{
Rule_class: "apex",
- Bzl_load_location: "//build/bazel/rules:apex.bzl",
+ Bzl_load_location: "//build/bazel/rules/apex:apex.bzl",
}
ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: a.Name()}, attrs)