summaryrefslogtreecommitdiff
path: root/sdk/update.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-03-06 14:04:36 +0000
committer Spandan Das <spandandas@google.com> 2024-03-20 21:41:57 +0000
commita5e26d3cd6ce66d7b3eab9ab19c3fd57deee938b (patch)
treed4184a363c1315f2e3e58acf09e4cc05a0bef23a /sdk/update.go
parent159b264873828b870685ff9af19bbbf417bbaccd (diff)
Add an apex_contributions_defaults module to module sdk
This metadata module will contain a flattened list of all the soong modules contributed by this module to the rest of the build. This is supported in V and above. Bug: 326246905 Test: m art-module-host-exports Test: unzip -p out/soong/mainline-sdks/art-module-host-exports-current.zip Android.bp | grep -A 15 apex_contributions_defaults apex_contributions_defaults { name: "art-module-host-exports.contributions", contents: [ "prebuilt_art.module.api.annotations", "prebuilt_dex2oat", "prebuilt_dex2oatd", "prebuilt_dexdump", "prebuilt_hiddenapi", "prebuilt_oatdump", "prebuilt_profman", "prebuilt_veridex", "prebuilt_libartpalette", "prebuilt_libartbase", ], } Change-Id: Iba43a9da5430adfc0a5fd9b5dc27b5d89c5eacb8
Diffstat (limited to 'sdk/update.go')
-rw-r--r--sdk/update.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/sdk/update.go b/sdk/update.go
index a731414ee..b8ae38a33 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -24,6 +24,7 @@ import (
"android/soong/apex"
"android/soong/cc"
+ "android/soong/java"
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
@@ -388,6 +389,7 @@ be unnecessary as every module in the sdk already has its own licenses property.
// Create the prebuilt modules for each of the member modules.
traits := s.gatherTraits()
+ memberNames := []string{} // soong module names of the members. contains the prebuilt_ prefix.
for _, member := range members {
memberType := member.memberType
if !memberType.ArePrebuiltsRequired() {
@@ -409,6 +411,38 @@ be unnecessary as every module in the sdk already has its own licenses property.
prebuiltModule := memberType.AddPrebuiltModule(memberCtx, member)
s.createMemberSnapshot(memberCtx, member, prebuiltModule.(*bpModule))
+
+ if member.memberType != android.LicenseModuleSdkMemberType && !builder.isInternalMember(member.name) {
+ // More exceptions
+ // 1. Skip BCP and SCCP fragments
+ // 2. Skip non-sdk contents of BCP and SCCP fragments
+ //
+ // The non-sdk contents of BCP/SSCP fragments should only be used for dexpreopt and hiddenapi,
+ // and are not available to the rest of the build.
+ if android.InList(member.memberType,
+ []android.SdkMemberType{
+ // bcp
+ java.BootclasspathFragmentSdkMemberType,
+ java.JavaBootLibsSdkMemberType,
+ // sscp
+ java.SystemServerClasspathFragmentSdkMemberType,
+ java.JavaSystemserverLibsSdkMemberType,
+ },
+ ) {
+ continue
+ }
+
+ memberNames = append(memberNames, android.PrebuiltNameFromSource(member.name))
+ }
+ }
+
+ // create an apex_contributions_defaults for this module's sdk.
+ // this module type is supported in V and above.
+ if targetApiLevel.GreaterThan(android.ApiLevelUpsideDownCake) {
+ ac := newModule("apex_contributions_defaults")
+ ac.AddProperty("name", s.Name()+".contributions")
+ ac.AddProperty("contents", memberNames)
+ bpFile.AddModule(ac)
}
// Create a transformer that will transform a module by replacing any references