diff options
Diffstat (limited to 'apex/androidmk.go')
| -rw-r--r-- | apex/androidmk.go | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/apex/androidmk.go b/apex/androidmk.go index 0b114f83b..e7f8b7ff1 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -63,16 +63,6 @@ func (class apexFileClass) nameInMake() string { } } -// Return the full module name for a dependency module, which appends the apex module name unless re-using a system lib. -func (a *apexBundle) fullModuleName(apexBundleName string, fi *apexFile) string { - linkToSystemLib := a.linkToSystemLib && fi.transitiveDep && fi.availableToPlatform() - - if linkToSystemLib { - return fi.androidMkModuleName - } - return fi.androidMkModuleName + "." + apexBundleName + a.suffix -} - func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, moduleDir string, apexAndroidMkData android.AndroidMkData) []string { @@ -124,7 +114,12 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo linkToSystemLib := a.linkToSystemLib && fi.transitiveDep && fi.availableToPlatform() - moduleName := a.fullModuleName(apexBundleName, &fi) + var moduleName string + if linkToSystemLib { + moduleName = fi.androidMkModuleName + } else { + moduleName = fi.androidMkModuleName + "." + apexBundleName + a.suffix + } if !android.InList(moduleName, moduleNames) { moduleNames = append(moduleNames, moduleName) @@ -316,16 +311,14 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo return moduleNames } -func (a *apexBundle) writeRequiredModules(w io.Writer, apexBundleName string) { +func (a *apexBundle) writeRequiredModules(w io.Writer) { var required []string var targetRequired []string var hostRequired []string - installMapSet := make(map[string]bool) // set of dependency module:location mappings for _, fi := range a.filesInfo { required = append(required, fi.requiredModuleNames...) targetRequired = append(targetRequired, fi.targetRequiredModuleNames...) hostRequired = append(hostRequired, fi.hostRequiredModuleNames...) - installMapSet[a.fullModuleName(apexBundleName, &fi)+":"+fi.installDir+"/"+fi.builtFile.Base()] = true } if len(required) > 0 { @@ -337,11 +330,6 @@ func (a *apexBundle) writeRequiredModules(w io.Writer, apexBundleName string) { if len(hostRequired) > 0 { fmt.Fprintln(w, "LOCAL_HOST_REQUIRED_MODULES +=", strings.Join(hostRequired, " ")) } - if len(installMapSet) > 0 { - var installs []string - installs = append(installs, android.SortedStringKeys(installMapSet)...) - fmt.Fprintln(w, "LOCAL_LICENSE_INSTALL_MAP +=", strings.Join(installs, " ")) - } } func (a *apexBundle) androidMkForType() android.AndroidMkData { @@ -359,18 +347,16 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) fmt.Fprintln(w, "LOCAL_MODULE :=", name+a.suffix) - data.Entries.WriteLicenseVariables(w) if len(moduleNames) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(moduleNames, " ")) } - a.writeRequiredModules(w, name) + a.writeRequiredModules(w) fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)") } else { fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)") fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir) fmt.Fprintln(w, "LOCAL_MODULE :=", name+a.suffix) - data.Entries.WriteLicenseVariables(w) fmt.Fprintln(w, "LOCAL_MODULE_CLASS := ETC") // do we need a new class? fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", a.outputFile.String()) fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", a.installDir.ToMakePath().String()) @@ -403,7 +389,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData { if len(a.requiredDeps) > 0 { fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(a.requiredDeps, " ")) } - a.writeRequiredModules(w, name) + a.writeRequiredModules(w) var postInstallCommands []string if a.prebuiltFileToDelete != "" { postInstallCommands = append(postInstallCommands, "rm -rf "+ |