From 4e7d1c43e27cc484cf598a7d683b0a41363d6f97 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Fri, 13 May 2022 13:12:19 +0000 Subject: Add apexes property to sdk Specifying an apex in the apexes propety will cause all the *classpath_fragments that are contents of the APEX to be automatically added as members of the sdk and appear in the snapshot. The purpose of this change is to dedup the APEX and sdk definitions and try and avoid some of the issues that we have been finding while attempting to build against the prebuilts. Two tests, one each for bootclasspath_fragment and systemserverclasspath_fragment, have been refactored to compare the output when adding the *fragment to the sdk directly of via the APEX. That ensures switching to use the APEX will not change the sdk snapshot unless it was previously missing a *fragment. There was also a slight difference in where the hidden API flags were copied from. That should have no impact on the output as the flags are identical. The sdk snapshot generation needed some tweaks to avoid generating a prebuilt for the APEX. Bug: 232401814 Test: m nothing Change-Id: I7aaf16a3a0ab4bebf97765d1484215cc008dc4b8 --- java/systemserver_classpath_fragment.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'java/systemserver_classpath_fragment.go') diff --git a/java/systemserver_classpath_fragment.go b/java/systemserver_classpath_fragment.go index 79d2ee9f7..a2cd2619a 100644 --- a/java/systemserver_classpath_fragment.go +++ b/java/systemserver_classpath_fragment.go @@ -24,15 +24,7 @@ import ( func init() { registerSystemserverClasspathBuildComponents(android.InitRegistrationContext) - android.RegisterSdkMemberType(&systemServerClasspathFragmentMemberType{ - SdkMemberTypeBase: android.SdkMemberTypeBase{ - PropertyName: "systemserverclasspath_fragments", - SupportsSdk: true, - - // This was only added in Tiramisu. - SupportedBuildReleaseSpecification: "Tiramisu+", - }, - }) + android.RegisterSdkMemberType(SystemServerClasspathFragmentSdkMemberType) } func registerSystemserverClasspathBuildComponents(ctx android.RegistrationContext) { @@ -41,6 +33,17 @@ func registerSystemserverClasspathBuildComponents(ctx android.RegistrationContex ctx.RegisterModuleType("prebuilt_systemserverclasspath_fragment", prebuiltSystemServerClasspathModuleFactory) } +var SystemServerClasspathFragmentSdkMemberType = &systemServerClasspathFragmentMemberType{ + SdkMemberTypeBase: android.SdkMemberTypeBase{ + PropertyName: "systemserverclasspath_fragments", + SupportsSdk: true, + + // Support for adding systemserverclasspath_fragments to the sdk snapshot was only added in + // Tiramisu. + SupportedBuildReleaseSpecification: "Tiramisu+", + }, +} + type platformSystemServerClasspathModule struct { android.ModuleBase -- cgit v1.2.3-59-g8ed1b