Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66905ed6 authored by Paul Duffin's avatar Paul Duffin
Browse files

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
parent 7264c698
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -274,29 +274,29 @@ func (s *sdk) buildSnapshot(ctx android.ModuleContext) android.OutputPath {
	bp.Printfln("sdk_snapshot {")
	bp.Indent()
	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.Indent()
		for _, m := range javaLibs {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name()))
		for _, m := range s.properties.Java_libs {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
		}
		bp.Dedent()
		bp.Printfln("],") // java_libs
	}
	if len(stubsSources) > 0 {
	if len(s.properties.Stubs_sources) > 0 {
		bp.Printfln("stubs_sources: [")
		bp.Indent()
		for _, m := range stubsSources {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(m.Name()))
		for _, m := range s.properties.Stubs_sources {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
		}
		bp.Dedent()
		bp.Printfln("],") // stubs_sources
	}
	if len(nativeLibInfos) > 0 {
	if len(s.properties.Native_shared_libs) > 0 {
		bp.Printfln("native_shared_libs: [")
		bp.Indent()
		for _, info := range nativeLibInfos {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(info.name))
		for _, m := range s.properties.Native_shared_libs {
			bp.Printfln("%q,", builder.VersionedSdkMemberName(m))
		}
		bp.Dedent()
		bp.Printfln("],") // native_shared_libs