Simplify sdk_snapshot module member list generation

When generating the list of members the names of the resolved
modules are used in the case of java_libs and stubs_source whereas
the name stored in the nativeLibInfo is used for native_shared_libs.

Those names are identical to the names provided in the corresponding
sdk property so this switches to use those instead as it is more
consistent and simplifies future refactorings.

Bug: 143678475
Test: m nothing
Change-Id: I9c08a8175fa9a37bb0cd89a361ef4c0f613b0dab
This commit is contained in:
Paul Duffin
2019-11-28 13:44:47 +00:00
parent 7264c69892
commit 66905ed6cf

View File

@@ -274,29 +274,29 @@ func (s *sdk) buildSnapshot(ctx android.ModuleContext) android.OutputPath {
bp.Printfln("sdk_snapshot {") bp.Printfln("sdk_snapshot {")
bp.Indent() bp.Indent()
bp.Printfln("name: %q,", ctx.ModuleName()+string(android.SdkVersionSeparator)+builder.version) bp.Printfln("name: %q,", ctx.ModuleName()+string(android.SdkVersionSeparator)+builder.version)
if len(javaLibs) > 0 { if len(s.properties.Java_libs) > 0 {
bp.Printfln("java_libs: [") bp.Printfln("java_libs: [")
bp.Indent() bp.Indent()
for _, m := range javaLibs { for _, m := range s.properties.Java_libs {
bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name())) bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
} }
bp.Dedent() bp.Dedent()
bp.Printfln("],") // java_libs bp.Printfln("],") // java_libs
} }
if len(stubsSources) > 0 { if len(s.properties.Stubs_sources) > 0 {
bp.Printfln("stubs_sources: [") bp.Printfln("stubs_sources: [")
bp.Indent() bp.Indent()
for _, m := range stubsSources { for _, m := range s.properties.Stubs_sources {
bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name())) bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
} }
bp.Dedent() bp.Dedent()
bp.Printfln("],") // stubs_sources bp.Printfln("],") // stubs_sources
} }
if len(nativeLibInfos) > 0 { if len(s.properties.Native_shared_libs) > 0 {
bp.Printfln("native_shared_libs: [") bp.Printfln("native_shared_libs: [")
bp.Indent() bp.Indent()
for _, info := range nativeLibInfos { for _, m := range s.properties.Native_shared_libs {
bp.Printfln("%q,", builder.VersionedSdkMemberName(info.name)) bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
} }
bp.Dedent() bp.Dedent()
bp.Printfln("],") // native_shared_libs bp.Printfln("],") // native_shared_libs