Fix RuleBuilder.Restat am: baa676f671 am: ee3c74b457

am: d4c4cd24ca

Change-Id: Ic1340df1f9d22de22104d9807fe2266ba67f341c
This commit is contained in:
Colin Cross 2019-03-04 19:39:46 -08:00 committed by android-build-merger
commit 84e8518011
2 changed files with 7 additions and 0 deletions

View file

@ -242,6 +242,7 @@ func (r *RuleBuilder) Build(pctx PackageContext, ctx BuilderContext, name string
Rule: ctx.Rule(pctx, name, blueprint.RuleParams{
Command: strings.Join(proptools.NinjaEscapeList(r.Commands()), " && "),
CommandDeps: r.Tools().Strings(),
Restat: r.restat,
}),
Implicits: r.Inputs(),
Outputs: r.Outputs(),

View file

@ -331,6 +331,8 @@ func testRuleBuilder_Build(ctx BuilderContext, in Path, out WritablePath) {
rule.Command().Tool(PathForSource(ctx, "cp")).Input(in).Output(out)
rule.Restat()
rule.Build(pctx, ctx, "rule", "desc")
}
@ -376,6 +378,10 @@ func TestRuleBuilder_Build(t *testing.T) {
if len(params.Outputs) != 1 || params.Outputs[0].String() != wantOutput {
t.Errorf("want Outputs = [%q], got %q", wantOutput, params.Outputs.Strings())
}
if !params.RuleParams.Restat {
t.Errorf("want RuleParams.Restat = true, got %v", params.RuleParams.Restat)
}
}
t.Run("module", func(t *testing.T) {