Allow disabling implicit resource_dirs and asset_dirs

Specifying [] for resource_dirs or asset_dirs will prevent using
the default "res" or "assets" directories.

Test: TestResourceDirs
Bug: 124035856
Change-Id: I96e38ac1319260db43950299a8b1774da68ea85e
This commit is contained in:
Colin Cross
2019-02-07 15:30:01 -08:00
parent 7cf14099b7
commit 0ddae7fddd
3 changed files with 64 additions and 4 deletions

View File

@@ -263,9 +263,9 @@ func pathsForModuleSrcFromFullPath(ctx ModuleContext, paths []string, incDirs bo
}
// PathsWithOptionalDefaultForModuleSrc returns Paths rooted from the module's
// local source directory. If none are provided, use the default if it exists.
// local source directory. If input is nil, use the default if it exists. If input is empty, returns nil.
func PathsWithOptionalDefaultForModuleSrc(ctx ModuleContext, input []string, def string) Paths {
if len(input) > 0 {
if input != nil {
return PathsForModuleSrc(ctx, input)
}
// Use Glob so that if the default doesn't exist, a dependency is added so that when it