Merge "Teach Soong to use a custom Delve binary." am: a40c817727
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1490596
Change-Id: I26c200522c12013fdb4b0f5e8d917babba98e0b4
diff --git a/android/env.go b/android/env.go
index c7c96d5..c2a09aa 100644
--- a/android/env.go
+++ b/android/env.go
@@ -41,7 +41,10 @@
// access originalEnv with dependencies. Store the value where soong_build can find it, it will manually
// ensure the dependencies are created.
soongDelveListen = os.Getenv("SOONG_DELVE")
- soongDelvePath, _ = exec.LookPath("dlv")
+ soongDelvePath = os.Getenv("SOONG_DELVE_PATH")
+ if soongDelvePath == "" {
+ soongDelvePath, _ = exec.LookPath("dlv")
+ }
originalEnv = make(map[string]string)
soongDelveEnv = []string{}
@@ -49,7 +52,7 @@
idx := strings.IndexRune(env, '=')
if idx != -1 {
originalEnv[env[:idx]] = env[idx+1:]
- if env[:idx] != "SOONG_DELVE" {
+ if env[:idx] != "SOONG_DELVE" && env[:idx] != "SOONG_DELVE_PATH" {
soongDelveEnv = append(soongDelveEnv, env)
}
}