Relocate llndk.libraries.txt into system
llndk.libraries.txt file is currently located within the VNDK APEX.
However, this file is still required even if VNDK APEX is deprecated.
This change removes llndk.libraries.txt from VNDK APEX, so it can be
installed within the system image.
Bug: 290160925
Test: aosp_cf build succeeded with llndk.libraries.txt in the system
image
Change-Id: I09a0a43babaa58ff16fc04ea71ab41ab68b54b70
diff --git a/cc/vndk.go b/cc/vndk.go
index 7a2286e..95a5a4f 100644
--- a/cc/vndk.go
+++ b/cc/vndk.go
@@ -39,25 +39,34 @@
vndkUsingCoreVariantLibrariesTxt = "vndkcorevariant.libraries.txt"
)
-func VndkLibrariesTxtModules(vndkVersion string) []string {
+func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
if vndkVersion == "current" {
- return []string{
- llndkLibrariesTxt,
+ result := []string{
vndkCoreLibrariesTxt,
vndkSpLibrariesTxt,
vndkPrivateLibrariesTxt,
vndkProductLibrariesTxt,
}
+
+ // TODO(b/290159430) This part will not be required once deprecation of VNDK
+ // is handled with 'ro.vndk.version' property
+ if !ctx.Config().IsVndkDeprecated() {
+ result = append(result, llndkLibrariesTxt)
+ }
+
+ return result
}
// Snapshot vndks have their own *.libraries.VER.txt files.
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
- return []string{
- insertVndkVersion(llndkLibrariesTxt, vndkVersion),
+ result := []string{
insertVndkVersion(vndkCoreLibrariesTxt, vndkVersion),
insertVndkVersion(vndkSpLibrariesTxt, vndkVersion),
insertVndkVersion(vndkPrivateLibrariesTxt, vndkVersion),
insertVndkVersion(vndkProductLibrariesTxt, vndkVersion),
+ insertVndkVersion(llndkLibrariesTxt, vndkVersion),
}
+
+ return result
}
type VndkProperties struct {
@@ -519,11 +528,15 @@
}
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
- var filename string
- if BoolDefault(txt.properties.Insert_vndk_version, true) {
+ filename := txt.Name()
+
+ shouldInsertVndkVersion := BoolDefault(txt.properties.Insert_vndk_version, true)
+ // llndk.libraries.txt file installed in the system image should not contain version info.
+ if ctx.Config().IsVndkDeprecated() && txt.Name() == llndkLibrariesTxt {
+ shouldInsertVndkVersion = false
+ }
+ if shouldInsertVndkVersion {
filename = insertVndkVersion(txt.Name(), ctx.DeviceConfig().PlatformVndkVersion())
- } else {
- filename = txt.Name()
}
txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath