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
This commit is contained in:
@@ -163,7 +163,7 @@ func (p *PackagingBase) CopyDepsToZip(ctx ModuleContext, zipOut OutputPath) (ent
|
||||
return true
|
||||
})
|
||||
|
||||
builder := NewRuleBuilder()
|
||||
builder := NewRuleBuilder(pctx, ctx)
|
||||
|
||||
dir := PathForModuleOut(ctx, ".zip").OutputPath
|
||||
builder.Command().Text("rm").Flag("-rf").Text(dir.String())
|
||||
@@ -190,13 +190,13 @@ func (p *PackagingBase) CopyDepsToZip(ctx ModuleContext, zipOut OutputPath) (ent
|
||||
}
|
||||
|
||||
builder.Command().
|
||||
BuiltTool(ctx, "soong_zip").
|
||||
BuiltTool("soong_zip").
|
||||
FlagWithOutput("-o ", zipOut).
|
||||
FlagWithArg("-C ", dir.String()).
|
||||
Flag("-L 0"). // no compression because this will be unzipped soon
|
||||
FlagWithArg("-D ", dir.String())
|
||||
builder.Command().Text("rm").Flag("-rf").Text(dir.String())
|
||||
|
||||
builder.Build(pctx, ctx, "zip_deps", fmt.Sprintf("Zipping deps for %s", ctx.ModuleName()))
|
||||
builder.Build("zip_deps", fmt.Sprintf("Zipping deps for %s", ctx.ModuleName()))
|
||||
return entries
|
||||
}
|
||||
|
Reference in New Issue
Block a user