From 03ce63eaa6a630613d7902105dd9d4472c66dfe0 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 29 Sep 2016 12:17:49 -0700 Subject: [PATCH] Trigger binary installation in Soong from Make We prepended Soong's binary installation path to PATH, but now rebuilding binaries that are in Soong and exported to Make produces inconsistent results. From an empty out directory: Run `m -j hidl-gen`, PATH will get a hidl-gen binary in out/host/... Run `m -j android.hardware.tests.foo@1.0`, PATH will get a new hidl-gen binary in out/soong/host/... Make a change to hidl-gen, then run `m -j hidl-gen`. The hidl-gen first in PATH is still the one without the changes. Bug: 31742855 Test: m -j hidl-gen showcommands Change-Id: If01a76d10d786dac6f16f31d1142634af4964228 --- cc/androidmk.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cc/androidmk.go b/cc/androidmk.go index f446333db..676ae300c 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -192,6 +192,12 @@ func (packer *relocationPacker) AndroidMk(ctx AndroidMkContext, ret *android.And } func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) { + // Soong installation is only supported for host modules. Have Make + // installation trigger Soong installation. + if ctx.Target().Os.Class == android.Host { + ret.OutputFile = android.OptionalPathForPath(installer.path) + } + ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error { path := installer.path.RelPathString() dir, file := filepath.Split(path)