Merge "Make cmake_snapshot output reproducible" into main
This commit is contained in:
@@ -147,11 +147,7 @@ func parseTemplate(templateContents string) *template.Template {
|
|||||||
return list.String()
|
return list.String()
|
||||||
},
|
},
|
||||||
"toStrings": func(files android.Paths) []string {
|
"toStrings": func(files android.Paths) []string {
|
||||||
strings := make([]string, len(files))
|
return files.Strings()
|
||||||
for idx, file := range files {
|
|
||||||
strings[idx] = file.String()
|
|
||||||
}
|
|
||||||
return strings
|
|
||||||
},
|
},
|
||||||
"concat5": func(list1 []string, list2 []string, list3 []string, list4 []string, list5 []string) []string {
|
"concat5": func(list1 []string, list2 []string, list3 []string, list4 []string, list5 []string) []string {
|
||||||
return append(append(append(append(list1, list2...), list3...), list4...), list5...)
|
return append(append(append(append(list1, list2...), list3...), list4...), list5...)
|
||||||
@@ -399,7 +395,8 @@ func (m *CmakeSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
|
|
||||||
// Merging CMakeLists.txt contents for every module directory
|
// Merging CMakeLists.txt contents for every module directory
|
||||||
var makefilesList android.Paths
|
var makefilesList android.Paths
|
||||||
for moduleDir, fragments := range moduleDirs {
|
for _, moduleDir := range android.SortedKeys(moduleDirs) {
|
||||||
|
fragments := moduleDirs[moduleDir]
|
||||||
moduleCmakePath := android.PathForModuleGen(ctx, moduleDir, "CMakeLists.txt")
|
moduleCmakePath := android.PathForModuleGen(ctx, moduleDir, "CMakeLists.txt")
|
||||||
makefilesList = append(makefilesList, moduleCmakePath)
|
makefilesList = append(makefilesList, moduleCmakePath)
|
||||||
sort.Strings(fragments)
|
sort.Strings(fragments)
|
||||||
@@ -439,8 +436,9 @@ func (m *CmakeSnapshot) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||||||
// Packaging all sources into the zip file
|
// Packaging all sources into the zip file
|
||||||
if m.Properties.Include_sources {
|
if m.Properties.Include_sources {
|
||||||
var sourcesList android.Paths
|
var sourcesList android.Paths
|
||||||
for _, file := range sourceFiles {
|
for _, file := range android.SortedKeys(sourceFiles) {
|
||||||
sourcesList = append(sourcesList, file)
|
path := sourceFiles[file]
|
||||||
|
sourcesList = append(sourcesList, path)
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesRspFile := android.PathForModuleObj(ctx, ctx.ModuleName()+"_sources.rsp")
|
sourcesRspFile := android.PathForModuleObj(ctx, ctx.ModuleName()+"_sources.rsp")
|
||||||
|
Reference in New Issue
Block a user