Skip to content

Commit 54fa790

Browse files
committed
Inlined call to compileFilesWithRecipe
1 parent 5fdf4f7 commit 54fa790

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

legacy/builder/builder_utils/utils.go

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,6 @@ import (
3636

3737
var tr = i18n.Tr
3838

39-
func CompileFiles(ctx *types.Context, sourcePath *paths.Path, recurse bool, buildPath *paths.Path, buildProperties *properties.Map, includes []string) (paths.PathList, error) {
40-
var sources paths.PathList
41-
var err error
42-
if recurse {
43-
sources, err = sourcePath.ReadDirRecursive()
44-
} else {
45-
sources, err = sourcePath.ReadDir()
46-
}
47-
if err != nil {
48-
return nil, err
49-
}
50-
51-
validExtensions := []string{".S", ".c", ".cpp"}
52-
53-
sources.FilterSuffix(validExtensions...)
54-
ctx.Progress.AddSubSteps(len(sources))
55-
defer ctx.Progress.RemoveSubSteps()
56-
57-
return compileFilesWithRecipe(ctx, sourcePath, sources, buildPath, buildProperties, includes, validExtensions)
58-
}
59-
6039
func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
6140
files, err := utils.ReadDirFiltered(sourcePath, utils.FilterFiles())
6241
if err != nil {
@@ -88,12 +67,29 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
8867
return sources, nil
8968
}
9069

91-
func compileFilesWithRecipe(ctx *types.Context, sourcePath *paths.Path, sources paths.PathList, buildPath *paths.Path, buildProperties *properties.Map, includes []string, validExtensions []string) (paths.PathList, error) {
70+
func CompileFiles(ctx *types.Context, sourcePath *paths.Path, recurse bool, buildPath *paths.Path, buildProperties *properties.Map, includes []string) (paths.PathList, error) {
71+
var sources paths.PathList
72+
var err error
73+
if recurse {
74+
sources, err = sourcePath.ReadDirRecursive()
75+
} else {
76+
sources, err = sourcePath.ReadDir()
77+
}
78+
if err != nil {
79+
return nil, err
80+
}
81+
82+
validExtensions := []string{".S", ".c", ".cpp"}
83+
84+
sources.FilterSuffix(validExtensions...)
85+
ctx.Progress.AddSubSteps(len(sources))
86+
defer ctx.Progress.RemoveSubSteps()
87+
9288
objectFiles := paths.NewPathList()
89+
var objectFilesMux sync.Mutex
9390
if len(sources) == 0 {
9491
return objectFiles, nil
9592
}
96-
var objectFilesMux sync.Mutex
9793
var errorsList []error
9894
var errorsMux sync.Mutex
9995

0 commit comments

Comments
 (0)