summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2020-05-30 08:12:24 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2020-05-30 08:12:24 +0000
commitbd7f9485074f026eae57c09f968e703fb91f193f (patch)
tree9ed822140c9a7ed5227f83ed2c9b0514ec0283b4
parent8eb051e91836d970c832a13fa422227482cb94c0 (diff)
parent9980c6e111b6f441eac8a437d6f963b25de67953 (diff)
Merge "Notice file embededd in APEX is deterministic" am: 9980c6e111
Change-Id: I25651a62edfcfc111af3591433e2f525b168158e
-rw-r--r--android/paths.go9
-rw-r--r--apex/builder.go2
2 files changed, 10 insertions, 1 deletions
diff --git a/android/paths.go b/android/paths.go
index fcea65c55..3ad27acbe 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -485,6 +485,15 @@ func FirstUniquePaths(list Paths) Paths {
return firstUniquePathsList(list)
}
+// SortedUniquePaths returns what its name says
+func SortedUniquePaths(list Paths) Paths {
+ unique := FirstUniquePaths(list)
+ sort.Slice(unique, func(i, j int) bool {
+ return unique[i].String() < unique[j].String()
+ })
+ return unique
+}
+
func firstUniquePathsList(list Paths) Paths {
k := 0
outer:
diff --git a/apex/builder.go b/apex/builder.go
index a6a347b5f..a7053dcf1 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -247,7 +247,7 @@ func (a *apexBundle) buildNoticeFiles(ctx android.ModuleContext, apexFileName st
return android.NoticeOutputs{}
}
- return android.BuildNoticeOutput(ctx, a.installDir, apexFileName, android.FirstUniquePaths(noticeFiles))
+ return android.BuildNoticeOutput(ctx, a.installDir, apexFileName, android.SortedUniquePaths(noticeFiles))
}
func (a *apexBundle) buildInstalledFilesFile(ctx android.ModuleContext, builtApex android.Path, imageDir android.Path) android.OutputPath {