From 07e51619a2752d6a36bd149c8938b5d7cae5baa7 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 5 Mar 2019 12:46:40 -0800 Subject: Remove ModuleSrcPath ModuleSrcPath was designed as a type that ensured that modules only referenced sources inside the directory that contained the Android.bp file. In practice they don't work very well, because allowing filegroups and genrules as inputs to any module that takes a source path means that the path might end up being to a file in another source directory or to a generated file in the output directory. Remove ModuleSrcPath, replacing it with SourcePath in the places that need to explicitly refer to a path in the source tree, or Path where it may be a source path or a generated path. Make PathForModuleSrc return a Path instead of a SourcePath in preparation for consolidation with ctx.ExpandSources, which will make it possibly return paths to generated files. Test: All soong tests Change-Id: I973a78470ed14307eea5f6d0cc93942775a65715 --- java/java_resources.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'java/java_resources.go') diff --git a/java/java_resources.go b/java/java_resources.go index 6c1fd39d0..462296302 100644 --- a/java/java_resources.go +++ b/java/java_resources.go @@ -39,10 +39,10 @@ func ResourceDirsToJarArgs(ctx android.ModuleContext, var excludeFiles []string for _, exclude := range excludeResourceDirs { - dirs := ctx.Glob(android.PathForModuleSrc(ctx).Join(ctx, exclude).String(), nil) + dirs := ctx.Glob(android.PathForSource(ctx, ctx.ModuleDir()).Join(ctx, exclude).String(), nil) for _, dir := range dirs { excludeDirs = append(excludeDirs, dir.String()) - excludeFiles = append(excludeFiles, dir.(android.ModuleSrcPath).Join(ctx, "**/*").String()) + excludeFiles = append(excludeFiles, dir.(android.SourcePath).Join(ctx, "**/*").String()) } } @@ -52,7 +52,7 @@ func ResourceDirsToJarArgs(ctx android.ModuleContext, for _, resourceDir := range resourceDirs { // resourceDir may be a glob, resolve it first - dirs := ctx.Glob(android.PathForModuleSrc(ctx).Join(ctx, resourceDir).String(), excludeDirs) + dirs := ctx.Glob(android.PathForSource(ctx, ctx.ModuleDir()).Join(ctx, resourceDir).String(), excludeDirs) for _, dir := range dirs { files := ctx.GlobFiles(filepath.Join(dir.String(), "**/*"), excludeFiles) -- cgit v1.2.3-59-g8ed1b