From 4fab2dc673c1468eea5e4eac4d70c538ad3bfcda Mon Sep 17 00:00:00 2001 From: Alice Wang Date: Fri, 20 Oct 2023 12:05:08 +0000 Subject: [PATCH] [apex] Add support for prebuilt_etc types in ApexNativeDependencies This cl adds support for prebuilt_etc types in ApexNativeDependencies, this enables us to include rialto only in the arm64 environment. Test: atest sign_virt_apex_test Bug: 279886264 Change-Id: If25e726721ed6867858880bc6907a0a3c0cb252d --- apex/apex.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apex/apex.go b/apex/apex.go index 42a7d73e7..a41ed4234 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -235,6 +235,9 @@ type ApexNativeDependencies struct { // List of filesystem images that are embedded inside this APEX bundle. Filesystems []string + // List of prebuilt_etcs that are embedded inside this APEX bundle. + Prebuilts []string + // List of native libraries to exclude from this APEX. Exclude_native_shared_libs []string @@ -252,6 +255,9 @@ type ApexNativeDependencies struct { // List of filesystem images to exclude from this APEX bundle. Exclude_filesystems []string + + // List of prebuilt_etcs to exclude from this APEX bundle. + Exclude_prebuilts []string } // Merge combines another ApexNativeDependencies into this one @@ -262,6 +268,7 @@ func (a *ApexNativeDependencies) Merge(b ApexNativeDependencies) { a.Binaries = append(a.Binaries, b.Binaries...) a.Tests = append(a.Tests, b.Tests...) a.Filesystems = append(a.Filesystems, b.Filesystems...) + a.Prebuilts = append(a.Prebuilts, b.Prebuilts...) a.Exclude_native_shared_libs = append(a.Exclude_native_shared_libs, b.Exclude_native_shared_libs...) a.Exclude_jni_libs = append(a.Exclude_jni_libs, b.Exclude_jni_libs...) @@ -269,6 +276,7 @@ func (a *ApexNativeDependencies) Merge(b ApexNativeDependencies) { a.Exclude_binaries = append(a.Exclude_binaries, b.Exclude_binaries...) a.Exclude_tests = append(a.Exclude_tests, b.Exclude_tests...) a.Exclude_filesystems = append(a.Exclude_filesystems, b.Exclude_filesystems...) + a.Exclude_prebuilts = append(a.Exclude_prebuilts, b.Exclude_prebuilts...) } type apexMultilibProperties struct { @@ -711,6 +719,8 @@ func addDependenciesForNativeModules(ctx android.BottomUpMutatorContext, nativeM android.RemoveListFromList(nativeModules.Rust_dyn_libs, nativeModules.Exclude_rust_dyn_libs)...) ctx.AddFarVariationDependencies(target.Variations(), fsTag, android.RemoveListFromList(nativeModules.Filesystems, nativeModules.Exclude_filesystems)...) + ctx.AddFarVariationDependencies(target.Variations(), prebuiltTag, + android.RemoveListFromList(nativeModules.Prebuilts, nativeModules.Exclude_prebuilts)...) } func (a *apexBundle) combineProperties(ctx android.BottomUpMutatorContext) {