From f4857cf3dd412e9d85612a43ec43a66da3913266 Mon Sep 17 00:00:00 2001 From: Alex Light Date: Fri, 22 Feb 2019 13:00:04 -0800 Subject: Include symlinks in flattened apexs Flattened apexs were not including symlinks. This could cause expected files not to be present. Test: lunch aosp_marlin-userdebug m droid stat $OUT/system/apex/com.android.runtime.debug/bin/dalvikvm Bug: 124924906 Change-Id: I04e696602b776b383bf7198eb19220353df74192 --- apex/apex.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'apex') diff --git a/apex/apex.go b/apex/apex.go index 8f89ca6e..9ab51875 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1006,7 +1006,10 @@ func (a *apexBundle) buildFlattenedApex(ctx android.ModuleContext) { if ctx.Config().FlattenApex() { for _, fi := range a.filesInfo { dir := filepath.Join("apex", ctx.ModuleName(), fi.installDir) - ctx.InstallFile(android.PathForModuleInstall(ctx, dir), fi.builtFile.Base(), fi.builtFile) + target := ctx.InstallFile(android.PathForModuleInstall(ctx, dir), fi.builtFile.Base(), fi.builtFile) + for _, sym := range fi.symlinks { + ctx.InstallSymlink(android.PathForModuleInstall(ctx, dir), sym, target) + } } } } @@ -1045,6 +1048,9 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, name, moduleDir string, apex // /system/apex//{lib|framework|...} fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(OUT_DIR)", a.installDir.RelPathString(), name, fi.installDir)) + if len(fi.symlinks) > 0 { + fmt.Fprintln(w, "LOCAL_MODULE_SYMLINKS :=", strings.Join(fi.symlinks, " ")) + } } else { // /apex//{lib|framework|...} fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(PRODUCT_OUT)", -- cgit v1.2.3