diff options
author | 2020-11-16 17:32:30 -0800 | |
---|---|---|
committer | 2020-12-01 16:22:16 -0800 | |
commit | f1a035e6be35d5678ce2e86bf3bc83fd5e4b4dc2 (patch) | |
tree | 097d3f1f4bf617eb5596166ee1803e3fd4b738c4 /java/lint.go | |
parent | 33e17630944359f752cb4abcc80f79b2273645b8 (diff) |
Pass pctx and ctx to NewRuleBuilder
Enable the RuleBuilder and RuleBuilderCommand methods to access
the BuilderContext by passing it to NewRuleBuilder instead of
RuleBuilder.Build.
Test: genrule_test.go
Test: rule_builder_test.go
Test: m checkbuild
Change-Id: I63e6597e19167393876dc2259d6f521363b7dabc
Diffstat (limited to 'java/lint.go')
-rw-r--r-- | java/lint.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/java/lint.go b/java/lint.go index 11f92e502..cd2a904d6 100644 --- a/java/lint.go +++ b/java/lint.go @@ -176,9 +176,9 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, // we can't use the rsp file because it is already being used for srcs. // Insert a second rule to write out the list of resources to a file. resourcesList = android.PathForModuleOut(ctx, "lint", "resources.list") - resListRule := android.NewRuleBuilder() + resListRule := android.NewRuleBuilder(pctx, ctx) resListRule.Command().Text("cp").FlagWithRspFileInputList("", l.resources).Output(resourcesList) - resListRule.Build(pctx, ctx, "lint_resources_list", "lint resources list") + resListRule.Build("lint_resources_list", "lint resources list") deps = append(deps, l.resources...) } @@ -192,7 +192,7 @@ func (l *linter) writeLintProjectXML(ctx android.ModuleContext, srcJarList := zipSyncCmd(ctx, rule, srcJarDir, l.srcJars) cmd := rule.Command(). - BuiltTool(ctx, "lint-project-xml"). + BuiltTool("lint-project-xml"). FlagWithOutput("--project_out ", projectXMLPath). FlagWithOutput("--config_out ", configXMLPath). FlagWithArg("--name ", ctx.ModuleName()) @@ -284,7 +284,7 @@ func (l *linter) lint(ctx android.ModuleContext) { } } - rule := android.NewRuleBuilder() + rule := android.NewRuleBuilder(pctx, ctx) if l.manifest == nil { manifest := l.generateManifest(ctx, rule) @@ -347,7 +347,7 @@ func (l *linter) lint(ctx android.ModuleContext) { rule.Command().Text("rm -rf").Flag(cacheDir.String()).Flag(homeDir.String()) - rule.Build(pctx, ctx, "lint", "lint") + rule.Build("lint", "lint") l.outputs = lintOutputs{ html: html, @@ -511,12 +511,12 @@ func lintZip(ctx android.BuilderContext, paths android.Paths, outputPath android return paths[i].String() < paths[j].String() }) - rule := android.NewRuleBuilder() + rule := android.NewRuleBuilder(pctx, ctx) - rule.Command().BuiltTool(ctx, "soong_zip"). + rule.Command().BuiltTool("soong_zip"). FlagWithOutput("-o ", outputPath). FlagWithArg("-C ", android.PathForIntermediates(ctx).String()). FlagWithRspFileInputList("-r ", paths) - rule.Build(pctx, ctx, outputPath.Base(), outputPath.Base()) + rule.Build(outputPath.Base(), outputPath.Base()) } |