Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 848e00ed authored by Lukacs T. Berki's avatar Lukacs T. Berki
Browse files

Teach Soong to use a custom Delve binary.

If SOONG_DELVE_PATH=<path> is set, Soong will use that as the path to
dlv. Otherwise, it will use the one on $PATH as usual.

Test: Manual.
Change-Id: Id4334f05d077a911750f601865bd3096d852d69c
parent 1a3922bf
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -41,7 +41,10 @@ func init() {
	// 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 = os.Getenv("SOONG_DELVE_PATH")
	if soongDelvePath == "" {
		soongDelvePath, _ = exec.LookPath("dlv")
	}

	originalEnv = make(map[string]string)
	soongDelveEnv = []string{}
@@ -49,7 +52,7 @@ func init() {
		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)
			}
		}