Write product config files only if changed.
Test: Manually verified artifact timestamps are unchanged on a second invocation of `m nothing` (with bp changes) Test: Presubmits Change-Id: I6bdf106a464597a07ac290cb575425d700721ffe
This commit is contained in:
@@ -397,11 +397,13 @@ product_var_constraints = _product_var_constraints
|
||||
arch_variant_product_var_constraints = _arch_variant_product_var_constraints
|
||||
`,
|
||||
}
|
||||
err = os.WriteFile(filepath.Join(dir, "product_variables.bzl"), []byte(strings.Join(bzl, "\n")), 0644)
|
||||
err = pathtools.WriteFileIfChanged(filepath.Join(dir, "product_variables.bzl"),
|
||||
[]byte(strings.Join(bzl, "\n")), 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not write .bzl config file %s", err)
|
||||
}
|
||||
err = os.WriteFile(filepath.Join(dir, "BUILD"), []byte(bazel.GeneratedBazelFileWarning), 0644)
|
||||
err = pathtools.WriteFileIfChanged(filepath.Join(dir, "BUILD"),
|
||||
[]byte(bazel.GeneratedBazelFileWarning), 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Could not write BUILD config file %s", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user