Copy shared_libs and system_shared_libs to module snapshot
This change ensures that the runtime dependencies between a binary/shared library are correctly specified in the snapshot so that the build can ensure that shared libraries are built before the targets that use them. It adds support for differentiating between references that are required to refer to another sdk member (required) and those that may refer to either an sdk member or a non-sdk member (optional). The latter is used for shared library references as the libraries used by an sdk member may be provided from outside the sdk. e.g. liblog is not part of the ART module but is used by some members of the ART sdk. Bug: 142935992 Bug: 153306490 Test: m nothing Merged-In: Ia8509ffe79b208c23beba1880fe9c8a92b732685 Change-Id: Ia8509ffe79b208c23beba1880fe9c8a92b732685
This commit is contained in:
26
sdk/sdk.go
26
sdk/sdk.go
@@ -50,9 +50,6 @@ type sdk struct {
|
||||
// list properties, e.g. java_libs.
|
||||
dynamicMemberTypeListProperties interface{}
|
||||
|
||||
// The set of exported members.
|
||||
exportedMembers map[string]struct{}
|
||||
|
||||
// Information about the OsType specific member variants associated with this variant.
|
||||
//
|
||||
// Set by OsType specific variants when their GenerateAndroidBuildActions is invoked
|
||||
@@ -233,26 +230,19 @@ func (s *sdk) memberListProperties() []*sdkMemberListProperty {
|
||||
}
|
||||
|
||||
func (s *sdk) getExportedMembers() map[string]struct{} {
|
||||
if s.exportedMembers == nil {
|
||||
// Collect all the exported members.
|
||||
s.exportedMembers = make(map[string]struct{})
|
||||
// Collect all the exported members.
|
||||
exportedMembers := make(map[string]struct{})
|
||||
|
||||
for _, memberListProperty := range s.memberListProperties() {
|
||||
names := memberListProperty.getter(s.dynamicMemberTypeListProperties)
|
||||
for _, memberListProperty := range s.memberListProperties() {
|
||||
names := memberListProperty.getter(s.dynamicMemberTypeListProperties)
|
||||
|
||||
// Every member specified explicitly in the properties is exported by the sdk.
|
||||
for _, name := range names {
|
||||
s.exportedMembers[name] = struct{}{}
|
||||
}
|
||||
// Every member specified explicitly in the properties is exported by the sdk.
|
||||
for _, name := range names {
|
||||
exportedMembers[name] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
return s.exportedMembers
|
||||
}
|
||||
|
||||
func (s *sdk) isInternalMember(memberName string) bool {
|
||||
_, ok := s.getExportedMembers()[memberName]
|
||||
return !ok
|
||||
return exportedMembers
|
||||
}
|
||||
|
||||
func (s *sdk) snapshot() bool {
|
||||
|
Reference in New Issue
Block a user