Loading android/sdk.go +10 −0 Original line number Diff line number Diff line Loading @@ -513,6 +513,9 @@ type SdkMemberType interface { // SupportedLinkages returns the names of the linkage variants supported by this module. SupportedLinkages() []string // DisablesStrip returns true if the stripping needs to be disabled for this module. DisablesStrip() bool // ArePrebuiltsRequired returns true if prebuilts are required in the sdk snapshot, false // otherwise. ArePrebuiltsRequired() bool Loading Loading @@ -618,6 +621,9 @@ type SdkMemberTypeBase struct { // The names of linkage variants supported by this module. SupportedLinkageNames []string // StripDisabled returns true if the stripping needs to be disabled for this module. StripDisabled bool // When set to true BpPropertyNotRequired indicates that the member type does not require the // property to be specifiable in an Android.bp file. BpPropertyNotRequired bool Loading Loading @@ -689,6 +695,10 @@ func (b *SdkMemberTypeBase) SupportedLinkages() []string { return b.SupportedLinkageNames } func (b *SdkMemberTypeBase) DisablesStrip() bool { return b.StripDisabled } // registeredModuleExportsMemberTypes is the set of registered SdkMemberTypes for module_exports // modules. var registeredModuleExportsMemberTypes = &sdkRegistry{} Loading cc/library_sdk_member.go +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ var sharedLibrarySdkMemberType = &librarySdkMemberType{ SupportsSdk: true, HostOsDependent: true, SupportedLinkageNames: []string{"shared"}, StripDisabled: true, }, prebuiltModuleType: "cc_prebuilt_library_shared", } Loading sdk/cc_sdk_test.go +54 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -368,6 +371,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -455,6 +461,9 @@ cc_prebuilt_library_shared { }, }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -697,6 +706,9 @@ cc_prebuilt_library_shared { srcs: ["x86_64/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -824,6 +836,9 @@ cc_prebuilt_library_shared { export_include_dirs: ["arm/include_gen/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -932,6 +947,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -950,6 +968,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/myothernativelib.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -967,6 +988,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mysystemnativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -1041,6 +1065,9 @@ cc_prebuilt_library_shared { export_include_dirs: ["x86/include_gen/mynativelib/linux_glibc_x86_shared/gen/aidl"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -1127,6 +1154,9 @@ cc_prebuilt_library_shared { srcs: ["windows/x86_64/lib/mynativelib.dll"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -2021,6 +2051,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslnil.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -2038,6 +2071,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslempty.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -2055,6 +2091,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslnonempty.so"], }, }, strip: { none: true, }, } `)) Loading Loading @@ -2114,6 +2153,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/sslvariants.so"], }, }, strip: { none: true, }, } `), ) Loading Loading @@ -2171,6 +2213,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/stubslib.so"], }, }, strip: { none: true, }, } `)) } Loading Loading @@ -2242,6 +2287,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/stubslib.so"], }, }, strip: { none: true, }, } `), ) Loading Loading @@ -2298,6 +2346,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/mylib-host.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -2355,6 +2406,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading sdk/update.go +8 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,14 @@ 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)) // Set stripper to none to skip stripping for generated snapshots. // Mainline prebuilts (cc_prebuilt_library_shared) are not strippable in older platforms. // Thus, stripping should be skipped when being used as prebuilts. if memberType.DisablesStrip() { stripPropertySet := prebuiltModule.(*bpModule).AddPropertySet("strip") stripPropertySet.AddProperty("none", true) } if member.memberType != android.LicenseModuleSdkMemberType && !builder.isInternalMember(member.name) { // More exceptions // 1. Skip BCP and SCCP fragments Loading Loading
android/sdk.go +10 −0 Original line number Diff line number Diff line Loading @@ -513,6 +513,9 @@ type SdkMemberType interface { // SupportedLinkages returns the names of the linkage variants supported by this module. SupportedLinkages() []string // DisablesStrip returns true if the stripping needs to be disabled for this module. DisablesStrip() bool // ArePrebuiltsRequired returns true if prebuilts are required in the sdk snapshot, false // otherwise. ArePrebuiltsRequired() bool Loading Loading @@ -618,6 +621,9 @@ type SdkMemberTypeBase struct { // The names of linkage variants supported by this module. SupportedLinkageNames []string // StripDisabled returns true if the stripping needs to be disabled for this module. StripDisabled bool // When set to true BpPropertyNotRequired indicates that the member type does not require the // property to be specifiable in an Android.bp file. BpPropertyNotRequired bool Loading Loading @@ -689,6 +695,10 @@ func (b *SdkMemberTypeBase) SupportedLinkages() []string { return b.SupportedLinkageNames } func (b *SdkMemberTypeBase) DisablesStrip() bool { return b.StripDisabled } // registeredModuleExportsMemberTypes is the set of registered SdkMemberTypes for module_exports // modules. var registeredModuleExportsMemberTypes = &sdkRegistry{} Loading
cc/library_sdk_member.go +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ var sharedLibrarySdkMemberType = &librarySdkMemberType{ SupportsSdk: true, HostOsDependent: true, SupportedLinkageNames: []string{"shared"}, StripDisabled: true, }, prebuiltModuleType: "cc_prebuilt_library_shared", } Loading
sdk/cc_sdk_test.go +54 −0 Original line number Diff line number Diff line Loading @@ -148,6 +148,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -368,6 +371,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -455,6 +461,9 @@ cc_prebuilt_library_shared { }, }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -697,6 +706,9 @@ cc_prebuilt_library_shared { srcs: ["x86_64/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -824,6 +836,9 @@ cc_prebuilt_library_shared { export_include_dirs: ["arm/include_gen/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -932,6 +947,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -950,6 +968,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/myothernativelib.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -967,6 +988,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mysystemnativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -1041,6 +1065,9 @@ cc_prebuilt_library_shared { export_include_dirs: ["x86/include_gen/mynativelib/linux_glibc_x86_shared/gen/aidl"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -1127,6 +1154,9 @@ cc_prebuilt_library_shared { srcs: ["windows/x86_64/lib/mynativelib.dll"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -2021,6 +2051,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslnil.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -2038,6 +2071,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslempty.so"], }, }, strip: { none: true, }, } cc_prebuilt_library_shared { Loading @@ -2055,6 +2091,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/sslnonempty.so"], }, }, strip: { none: true, }, } `)) Loading Loading @@ -2114,6 +2153,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/sslvariants.so"], }, }, strip: { none: true, }, } `), ) Loading Loading @@ -2171,6 +2213,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/stubslib.so"], }, }, strip: { none: true, }, } `)) } Loading Loading @@ -2242,6 +2287,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/stubslib.so"], }, }, strip: { none: true, }, } `), ) Loading Loading @@ -2298,6 +2346,9 @@ cc_prebuilt_library_shared { srcs: ["linux_glibc/x86/lib/mylib-host.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading Loading @@ -2355,6 +2406,9 @@ cc_prebuilt_library_shared { srcs: ["arm/lib/mynativelib.so"], }, }, strip: { none: true, }, } `), checkAllCopyRules(` Loading
sdk/update.go +8 −0 Original line number Diff line number Diff line Loading @@ -434,6 +434,14 @@ 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)) // Set stripper to none to skip stripping for generated snapshots. // Mainline prebuilts (cc_prebuilt_library_shared) are not strippable in older platforms. // Thus, stripping should be skipped when being used as prebuilts. if memberType.DisablesStrip() { stripPropertySet := prebuiltModule.(*bpModule).AddPropertySet("strip") stripPropertySet.AddProperty("none", true) } if member.memberType != android.LicenseModuleSdkMemberType && !builder.isInternalMember(member.name) { // More exceptions // 1. Skip BCP and SCCP fragments Loading