diff options
| author | 2020-06-16 17:32:19 +0800 | |
|---|---|---|
| committer | 2020-06-16 17:33:57 +0800 | |
| commit | 12d9f7a103897e561bd380031aba69b2c4d1702b (patch) | |
| tree | f6a71f0f4c3cec0617f03a9c9434f6c71a0f6612 | |
| parent | 000aef69b547b20553ac779d1bc8726af4b5c1d9 (diff) | |
Don't emit superfluous LOCAL_OVERRIDES_MODULES
Don't emit an empty LOCAL_OVERRIDES_MODULES line if APEX is not
overriding any module.
Test: TH noop
Change-Id: I7abbaccd54bf2ffa25a6c798260c81284ea5ecb2
| -rw-r--r-- | apex/androidmk.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apex/androidmk.go b/apex/androidmk.go index 774b62d99..91a405c58 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -233,8 +233,9 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo for _, o := range a.overridableProperties.Overrides { patterns = append(patterns, "%."+o+a.suffix) } - fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(patterns, " ")) - + if len(patterns) > 0 { + fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(patterns, " ")) + } if len(a.compatSymlinks) > 0 { // For flattened apexes, compat symlinks are attached to apex_manifest.json which is guaranteed for every apex postInstallCommands = append(postInstallCommands, a.compatSymlinks...) @@ -307,7 +308,9 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", a.installDir.ToMakePath().String()) fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+apexType.suffix()) fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable()) - fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(a.overridableProperties.Overrides, " ")) + if len(a.overridableProperties.Overrides) > 0 { + fmt.Fprintln(w, "LOCAL_OVERRIDES_MODULES :=", strings.Join(a.overridableProperties.Overrides, " ")) + } if len(moduleNames) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(moduleNames, " ")) } |