Loading android/sdk.go +13 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,10 @@ type SdkMemberType interface { // the module is not allowed in whichever sdk property it was added. IsInstance(module Module) bool // UsesSourceModuleTypeInSnapshot returns true when the AddPrebuiltModule() method returns a // source module type. UsesSourceModuleTypeInSnapshot() bool // Add a prebuilt module that the sdk will populate. // // The sdk module code generates the snapshot as follows: Loading Loading @@ -451,6 +455,11 @@ type SdkMemberTypeBase struct { PropertyName string SupportsSdk bool HostOsDependent bool // When set to true UseSourceModuleTypeInSnapshot indicates that the member type creates a source // module type in its SdkMemberType.AddPrebuiltModule() method. That prevents the sdk snapshot // code from automatically adding a prefer: true flag. UseSourceModuleTypeInSnapshot bool } func (b *SdkMemberTypeBase) SdkPropertyName() string { Loading @@ -465,6 +474,10 @@ func (b *SdkMemberTypeBase) IsHostOsDependent() bool { return b.HostOsDependent } func (b *SdkMemberTypeBase) UsesSourceModuleTypeInSnapshot() bool { return b.UseSourceModuleTypeInSnapshot } // Encapsulates the information about registered SdkMemberTypes. type SdkMemberTypesRegistry struct { // The list of types sorted by property name. Loading sdk/update.go +14 −11 Original line number Diff line number Diff line Loading @@ -1370,6 +1370,8 @@ func (s *sdk) createMemberSnapshot(ctx *memberContext, member *sdkMember, bpModu memberType := member.memberType // Do not add the prefer property if the member snapshot module is a source module type. if !memberType.UsesSourceModuleTypeInSnapshot() { // Set the prefer based on the environment variable. This is a temporary work around to allow a // snapshot to be created that sets prefer: true. // TODO(b/174997203): Remove once the ability to select the modules to prefer can be done Loading @@ -1381,6 +1383,7 @@ func (s *sdk) createMemberSnapshot(ctx *memberContext, member *sdkMember, bpModu // check the behavior when a prebuilt is preferred. It also makes it explicit what the default // behavior is for the module. bpModule.insertAfter("name", "prefer", prefer) } // Group the variants by os type. variantsByOsType := make(map[android.OsType][]android.Module) Loading Loading
android/sdk.go +13 −0 Original line number Diff line number Diff line Loading @@ -405,6 +405,10 @@ type SdkMemberType interface { // the module is not allowed in whichever sdk property it was added. IsInstance(module Module) bool // UsesSourceModuleTypeInSnapshot returns true when the AddPrebuiltModule() method returns a // source module type. UsesSourceModuleTypeInSnapshot() bool // Add a prebuilt module that the sdk will populate. // // The sdk module code generates the snapshot as follows: Loading Loading @@ -451,6 +455,11 @@ type SdkMemberTypeBase struct { PropertyName string SupportsSdk bool HostOsDependent bool // When set to true UseSourceModuleTypeInSnapshot indicates that the member type creates a source // module type in its SdkMemberType.AddPrebuiltModule() method. That prevents the sdk snapshot // code from automatically adding a prefer: true flag. UseSourceModuleTypeInSnapshot bool } func (b *SdkMemberTypeBase) SdkPropertyName() string { Loading @@ -465,6 +474,10 @@ func (b *SdkMemberTypeBase) IsHostOsDependent() bool { return b.HostOsDependent } func (b *SdkMemberTypeBase) UsesSourceModuleTypeInSnapshot() bool { return b.UseSourceModuleTypeInSnapshot } // Encapsulates the information about registered SdkMemberTypes. type SdkMemberTypesRegistry struct { // The list of types sorted by property name. Loading
sdk/update.go +14 −11 Original line number Diff line number Diff line Loading @@ -1370,6 +1370,8 @@ func (s *sdk) createMemberSnapshot(ctx *memberContext, member *sdkMember, bpModu memberType := member.memberType // Do not add the prefer property if the member snapshot module is a source module type. if !memberType.UsesSourceModuleTypeInSnapshot() { // Set the prefer based on the environment variable. This is a temporary work around to allow a // snapshot to be created that sets prefer: true. // TODO(b/174997203): Remove once the ability to select the modules to prefer can be done Loading @@ -1381,6 +1383,7 @@ func (s *sdk) createMemberSnapshot(ctx *memberContext, member *sdkMember, bpModu // check the behavior when a prebuilt is preferred. It also makes it explicit what the default // behavior is for the module. bpModule.insertAfter("name", "prefer", prefer) } // Group the variants by os type. variantsByOsType := make(map[android.OsType][]android.Module) Loading