diff options
author | Colin Cross <ccross@android.com> | 2019-03-05 22:25:09 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2019-03-20 19:36:13 +0000 |
commit | 8a49795df1ed87a4889f267dbd8d28c5832bb897 (patch) | |
tree | e769fe1ab955ab4420d1edf68355c2ff9a4b470e /java/droiddoc.go | |
parent | 07e51619a2752d6a36bd149c8938b5d7cae5baa7 (diff) | |
download | android_build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.tar.gz android_build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.tar.bz2 android_build_soong-8a49795df1ed87a4889f267dbd8d28c5832bb897.zip |
Replace ctx.ExpandSources with android.PathsForModuleSrc
Move the logic from ctx.ExpandSources into android.PathsForModuleSrc
and ctx.ExpandSource into android.PathForModuleSrc, and deprecate
them. When combined with the pathDepsMutator this will let all
properties that take source paths also take filegroups or genrule
outputs, as long as they are tagged with `android:"path"`.
Test: All soong tests
Change-Id: I01625e76b5da19240e9649bf26a014eeeafcab8f
Diffstat (limited to 'java/droiddoc.go')
-rw-r--r-- | java/droiddoc.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go index a85da0ef..e163617e 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -696,7 +696,7 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps { }) // do not pass exclude_srcs directly when expanding srcFiles since exclude_srcs // may contain filegroup or genrule. - srcFiles := ctx.ExpandSources(j.properties.Srcs, j.properties.Exclude_srcs) + srcFiles := android.PathsForModuleSrcExcludes(ctx, j.properties.Srcs, j.properties.Exclude_srcs) flags := j.collectAidlFlags(ctx, deps) srcFiles = j.genSources(ctx, srcFiles, flags) @@ -715,12 +715,12 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps { } j.sourcepaths = android.PathsForModuleSrc(ctx, j.properties.Local_sourcepaths) - j.argFiles = ctx.ExpandSources(j.properties.Arg_files, nil) + j.argFiles = android.PathsForModuleSrc(ctx, j.properties.Arg_files) argFilesMap := map[string]string{} argFileLabels := []string{} for _, label := range j.properties.Arg_files { - var paths = ctx.ExpandSources([]string{label}, nil) + var paths = android.PathsForModuleSrc(ctx, []string{label}) if _, exists := argFilesMap[label]; !exists { argFilesMap[label] = strings.Join(paths.Strings(), " ") argFileLabels = append(argFileLabels, label) @@ -936,13 +936,13 @@ func (d *Droiddoc) collectDoclavaDocsFlags(ctx android.ModuleContext, implicits if len(d.properties.Html_dirs) > 0 { htmlDir := d.properties.Html_dirs[0] - *implicits = append(*implicits, ctx.ExpandSources([]string{filepath.Join(d.properties.Html_dirs[0], "**/*")}, nil)...) + *implicits = append(*implicits, android.PathsForModuleSrc(ctx, []string{filepath.Join(d.properties.Html_dirs[0], "**/*")})...) args = args + " -htmldir " + htmlDir } if len(d.properties.Html_dirs) > 1 { htmlDir2 := d.properties.Html_dirs[1] - *implicits = append(*implicits, ctx.ExpandSources([]string{filepath.Join(htmlDir2, "**/*")}, nil)...) + *implicits = append(*implicits, android.PathsForModuleSrc(ctx, []string{filepath.Join(htmlDir2, "**/*")})...) args = args + " -htmldir2 " + htmlDir2 } @@ -950,7 +950,7 @@ func (d *Droiddoc) collectDoclavaDocsFlags(ctx android.ModuleContext, implicits ctx.PropertyErrorf("html_dirs", "Droiddoc only supports up to 2 html dirs") } - knownTags := ctx.ExpandSources(d.properties.Knowntags, nil) + knownTags := android.PathsForModuleSrc(ctx, d.properties.Knowntags) *implicits = append(*implicits, knownTags...) for _, kt := range knownTags { @@ -1415,12 +1415,12 @@ func (d *Droidstubs) collectAnnotationsFlags(ctx android.ModuleContext, "has to be non-empty if annotations was enabled (unless validating nullability)") } if migratingNullability { - previousApi := ctx.ExpandSource(String(d.properties.Previous_api), "previous_api") + previousApi := android.PathForModuleSrc(ctx, String(d.properties.Previous_api)) *implicits = append(*implicits, previousApi) flags += " --migrate-nullness " + previousApi.String() } if s := String(d.properties.Validate_nullability_from_list); s != "" { - flags += " --validate-nullability-from-list " + ctx.ExpandSource(s, "validate_nullability_from_list").String() + flags += " --validate-nullability-from-list " + android.PathForModuleSrc(ctx, s).String() } if validatingNullability { d.nullabilityWarningsFile = android.PathForModuleOut(ctx, ctx.ModuleName()+"_nullability_warnings.txt") @@ -1793,7 +1793,7 @@ func (d *ExportedDroiddocDir) DepsMutator(android.BottomUpMutatorContext) {} func (d *ExportedDroiddocDir) GenerateAndroidBuildActions(ctx android.ModuleContext) { path := String(d.properties.Path) d.dir = android.PathForModuleSrc(ctx, path) - d.deps = ctx.ExpandSources([]string{filepath.Join(path, "**/*")}, nil) + d.deps = android.PathsForModuleSrc(ctx, []string{filepath.Join(path, "**/*")}) } // |