@@ -23,7 +23,6 @@ import (
23
23
"github.com/arduino/arduino-cli/i18n"
24
24
"github.com/arduino/arduino-cli/legacy/builder/phases"
25
25
"github.com/arduino/arduino-cli/legacy/builder/types"
26
- "github.com/arduino/arduino-cli/legacy/builder/utils"
27
26
"github.com/pkg/errors"
28
27
"github.com/sirupsen/logrus"
29
28
)
@@ -51,26 +50,26 @@ func (s *Builder) Run(ctx *types.Context) error {
51
50
return _err
52
51
}),
53
52
54
- utils . LogIfVerbose (false , tr ("Detecting libraries used..." )),
53
+ logIfVerbose (false , tr ("Detecting libraries used..." )),
55
54
findIncludes (ctx ),
56
55
57
56
& WarnAboutArchIncompatibleLibraries {},
58
57
59
- utils . LogIfVerbose (false , tr ("Generating function prototypes..." )),
58
+ logIfVerbose (false , tr ("Generating function prototypes..." )),
60
59
types .BareCommand (PreprocessSketch ),
61
60
62
- utils . LogIfVerbose (false , tr ("Compiling sketch..." )),
61
+ logIfVerbose (false , tr ("Compiling sketch..." )),
63
62
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.sketch.prebuild" , Suffix : ".pattern" },
64
63
& phases.SketchBuilder {},
65
64
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.sketch.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
66
65
67
- utils . LogIfVerbose (false , tr ("Compiling libraries..." )),
66
+ logIfVerbose (false , tr ("Compiling libraries..." )),
68
67
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.libraries.prebuild" , Suffix : ".pattern" },
69
68
& UnusedCompiledLibrariesRemover {},
70
69
& phases.LibrariesBuilder {},
71
70
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.libraries.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
72
71
73
- utils . LogIfVerbose (false , tr ("Compiling core..." )),
72
+ logIfVerbose (false , tr ("Compiling core..." )),
74
73
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.core.prebuild" , Suffix : ".pattern" },
75
74
76
75
types .BareCommand (func (ctx * types.Context ) error {
@@ -98,7 +97,7 @@ func (s *Builder) Run(ctx *types.Context) error {
98
97
99
98
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.core.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
100
99
101
- utils . LogIfVerbose (false , tr ("Linking everything together..." )),
100
+ logIfVerbose (false , tr ("Linking everything together..." )),
102
101
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.linking.prelink" , Suffix : ".pattern" },
103
102
& phases.Linker {},
104
103
& RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.linking.postlink" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
@@ -255,3 +254,17 @@ func findIncludes(ctx *types.Context) types.BareCommand {
255
254
)
256
255
})
257
256
}
257
+
258
+ func logIfVerbose (warn bool , msg string ) types.BareCommand {
259
+ return types .BareCommand (func (ctx * types.Context ) error {
260
+ if ! ctx .Verbose {
261
+ return nil
262
+ }
263
+ if warn {
264
+ ctx .Warn (msg )
265
+ } else {
266
+ ctx .Info (msg )
267
+ }
268
+ return nil
269
+ })
270
+ }
0 commit comments