From 9dbd1fdf3c0ef8581878b456c1df794462c7c00e Mon Sep 17 00:00:00 2001 From: bigbiff Date: Wed, 1 Sep 2021 19:38:54 -0400 Subject: [PATCH] twres: change how build directory is determined Change-Id: I1af103bc276828e9ec07e20becf9df59c9535478 --- soong/copy.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/soong/copy.go b/soong/copy.go index c6b07b4e..6b3a7667 100755 --- a/soong/copy.go +++ b/soong/copy.go @@ -7,6 +7,8 @@ import ( "io/ioutil" "os" "path" + "runtime" + "path/filepath" "strings" ) @@ -15,9 +17,10 @@ func getRecoveryAbsDir(ctx android.BaseContext) string { } func getBuildAbsDir(ctx android.BaseContext) string { - outDir := ctx.Config().Getenv("OUT") - absIndex := strings.Index(outDir, "out") - return string(outDir[0:absIndex]) + var b string + _, b, _, _ = runtime.Caller(0) + absIndex := strings.Index(filepath.Dir(b), "bootable") + return string(b[0:absIndex]) } func copyDir(src string, dest string) error {