summaryrefslogtreecommitdiff
path: root/filesystem/filesystem.go
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-17 15:55:38 -0800
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2025-01-17 15:55:38 -0800
commit3fc1942a80feffb0a12aa4573db9cfb8791e1857 (patch)
treebd6d92af46100f4932ce150cc943424a71f3fc90 /filesystem/filesystem.go
parent4c6323c89ab6a21ff701d37626f6b8fe834a7e7c (diff)
parente03ab89d8a11d78ff6f0e4fb7cb98d91a634693d (diff)
Merge "Sort lines in property file" into main
Diffstat (limited to 'filesystem/filesystem.go')
-rw-r--r--filesystem/filesystem.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index cf38bfdad..68cbee95f 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -20,6 +20,7 @@ import (
"io"
"path/filepath"
"slices"
+ "sort"
"strconv"
"strings"
@@ -746,12 +747,9 @@ func (f *filesystem) buildFileContexts(ctx android.ModuleContext) android.Path {
func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, android.Paths) {
var deps android.Paths
- var propFileString strings.Builder
+ var lines []string
addStr := func(name string, value string) {
- propFileString.WriteString(name)
- propFileString.WriteRune('=')
- propFileString.WriteString(value)
- propFileString.WriteRune('\n')
+ lines = append(lines, fmt.Sprintf("%s=%s", name, value))
}
addPath := func(name string, path android.Path) {
addStr(name, path.String())
@@ -880,8 +878,10 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (android.Path, and
addStr("needs_compress", "1")
}
+ sort.Strings(lines)
+
propFilePreProcessing := android.PathForModuleOut(ctx, "prop_pre_processing")
- android.WriteFileRuleVerbatim(ctx, propFilePreProcessing, propFileString.String())
+ android.WriteFileRule(ctx, propFilePreProcessing, strings.Join(lines, "\n"))
propFile := android.PathForModuleOut(ctx, "prop")
ctx.Build(pctx, android.BuildParams{
Rule: textFileProcessorRule,