Generate unversioned cc_prebuilt_library_shared
Without this the generated snapshot build file will not load.
Bug: 143678475
Test: m nothing and check output for dummy sdk
Change-Id: I252ed01280aeceb4ff40b2d9de2bc2bf88858ea9
diff --git a/sdk/update.go b/sdk/update.go
index 7daede3..6d7b3ec 100644
--- a/sdk/update.go
+++ b/sdk/update.go
@@ -401,11 +401,26 @@
}
}
+ info.generatePrebuiltLibrary(ctx, builder, true)
+
+ // This module is for the case when the source tree for the unversioned module
+ // doesn't exist (i.e. building in an unbundled tree). "prefer:" is set to false
+ // so that this module does not eclipse the unversioned module if it exists.
+ info.generatePrebuiltLibrary(ctx, builder, false)
+}
+
+func (info *nativeLibInfo) generatePrebuiltLibrary(ctx android.ModuleContext, builder android.SnapshotBuilder, versioned bool) {
bp := builder.AndroidBpFile()
bp.Printfln("cc_prebuilt_library_shared {")
bp.Indent()
- bp.Printfln("name: %q,", builder.VersionedSdkMemberName(info.name))
- bp.Printfln("sdk_member_name: %q,", info.name)
+ name := info.name
+ if versioned {
+ bp.Printfln("name: %q,", builder.VersionedSdkMemberName(name))
+ bp.Printfln("sdk_member_name: %q,", name)
+ } else {
+ bp.Printfln("name: %q,", name)
+ bp.Printfln("prefer: false,")
+ }
// a function for emitting include dirs
printExportedDirsForNativeLibs := func(lib archSpecificNativeLibInfo, systemInclude bool) {