diff options
| author | 2023-03-31 15:23:25 +0000 | |
|---|---|---|
| committer | 2023-03-31 15:23:25 +0000 | |
| commit | dad03f387cd554d7431e5359a5bdada3c978621f (patch) | |
| tree | 98bdfc6e4adaccda2d1c59b81de43cd8f3647163 /android/namespace.go | |
| parent | d44721ce7ec21a4de995ab96c6abb612f1e35335 (diff) | |
| parent | b72610665cea143f470e02b2230b3e8f198acbd2 (diff) | |
Merge "improve error handling for SourceRootDirs" am: b72610665c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2516015
Change-Id: I859195c9f3cd860da4163c7329fdd65715cebb44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'android/namespace.go')
| -rw-r--r-- | android/namespace.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/android/namespace.go b/android/namespace.go index f357ca7b7..c47a1c593 100644 --- a/android/namespace.go +++ b/android/namespace.go @@ -245,6 +245,10 @@ func (r *NameResolver) AllModules() []blueprint.ModuleGroup { return allModules } +func (r *NameResolver) SkippedModuleFromName(moduleName string, namespace blueprint.Namespace) (skipInfos []blueprint.SkippedModuleInfo, skipped bool) { + return r.rootNamespace.moduleContainer.SkippedModuleFromName(moduleName, namespace) +} + // parses a fully-qualified path (like "//namespace_path:module_name") into a namespace name and a // module name func (r *NameResolver) parseFullyQualifiedName(name string) (namespaceName string, moduleName string, ok bool) { @@ -333,11 +337,16 @@ func (r *NameResolver) MissingDependencyError(depender string, dependerNamespace // determine which namespaces the module can be found in foundInNamespaces := []string{} + skippedDepErrors := []error{} for _, namespace := range r.sortedNamespaces.sortedItems() { _, found := namespace.moduleContainer.ModuleFromName(depName, nil) if found { foundInNamespaces = append(foundInNamespaces, namespace.Path) } + _, skipped := namespace.moduleContainer.SkippedModuleFromName(depName, nil) + if skipped { + skippedDepErrors = append(skippedDepErrors, namespace.moduleContainer.MissingDependencyError(depender, dependerNamespace, depName)) + } } if len(foundInNamespaces) > 0 { // determine which namespaces are visible to dependerNamespace @@ -350,6 +359,9 @@ func (r *NameResolver) MissingDependencyError(depender string, dependerNamespace text += fmt.Sprintf("\nModule %q is defined in namespace %q which can read these %v namespaces: %q", depender, dependerNs.Path, len(importedNames), importedNames) text += fmt.Sprintf("\nModule %q can be found in these namespaces: %q", depName, foundInNamespaces) } + for _, err := range skippedDepErrors { + text += fmt.Sprintf("\n%s", err.Error()) + } return fmt.Errorf(text) } |