Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0008cf8b authored by Chris Parsons's avatar Chris Parsons
Browse files

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
parent 82a9e8fe
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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)
	}