Refactor android/paths.go to allow reuse
Extracts out the relevant pieces of ModuleContext into a minimal interfaces necessary for path handling for Modules. This will allow reuse in queryview by allowing it to implement only the parts of the module interface necessary for path expansion in order to properly handle path properties. Test: go test soong tests Change-Id: Iea39a365e5a2ff55071e435fb64f9e6464bbcafd
This commit is contained in:
@@ -1885,19 +1885,11 @@ type earlyModuleContext struct {
|
||||
}
|
||||
|
||||
func (e *earlyModuleContext) Glob(globPattern string, excludes []string) Paths {
|
||||
ret, err := e.GlobWithDeps(globPattern, excludes)
|
||||
if err != nil {
|
||||
e.ModuleErrorf("glob: %s", err.Error())
|
||||
}
|
||||
return pathsForModuleSrcFromFullPath(e, ret, true)
|
||||
return Glob(e, globPattern, excludes)
|
||||
}
|
||||
|
||||
func (e *earlyModuleContext) GlobFiles(globPattern string, excludes []string) Paths {
|
||||
ret, err := e.GlobWithDeps(globPattern, excludes)
|
||||
if err != nil {
|
||||
e.ModuleErrorf("glob: %s", err.Error())
|
||||
}
|
||||
return pathsForModuleSrcFromFullPath(e, ret, false)
|
||||
return GlobFiles(e, globPattern, excludes)
|
||||
}
|
||||
|
||||
func (b *earlyModuleContext) IsSymlink(path Path) bool {
|
||||
|
Reference in New Issue
Block a user