@@ -24,7 +24,6 @@ import (
24
24
"github.com/arduino/arduino-cli/arduino/sketch"
25
25
"github.com/arduino/arduino-cli/i18n"
26
26
"github.com/arduino/arduino-cli/legacy/builder/builder_utils"
27
- "github.com/arduino/arduino-cli/legacy/builder/constants"
28
27
"github.com/arduino/arduino-cli/legacy/builder/phases"
29
28
"github.com/arduino/arduino-cli/legacy/builder/types"
30
29
"github.com/arduino/arduino-cli/legacy/builder/utils"
@@ -55,46 +54,46 @@ func (s *Builder) Run(ctx *types.Context) error {
55
54
56
55
& WarnAboutPlatformRewrites {},
57
56
58
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
57
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.prebuild" , Suffix : ".pattern" },
59
58
60
59
& ContainerMergeCopySketchFiles {},
61
60
62
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Detecting libraries used..." )),
61
+ utils .LogIfVerbose ("info" , tr ("Detecting libraries used..." )),
63
62
& ContainerFindIncludes {},
64
63
65
64
& WarnAboutArchIncompatibleLibraries {},
66
65
67
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Generating function prototypes..." )),
66
+ utils .LogIfVerbose ("info" , tr ("Generating function prototypes..." )),
68
67
& PreprocessSketch {},
69
68
70
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Compiling sketch..." )),
71
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_SKETCH_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
69
+ utils .LogIfVerbose ("info" , tr ("Compiling sketch..." )),
70
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.sketch.prebuild" , Suffix : ".pattern" },
72
71
& phases.SketchBuilder {},
73
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_SKETCH_POSTBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
72
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.sketch.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
74
73
75
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Compiling libraries..." )),
76
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_LIBRARIES_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
74
+ utils .LogIfVerbose ("info" , tr ("Compiling libraries..." )),
75
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.libraries.prebuild" , Suffix : ".pattern" },
77
76
& UnusedCompiledLibrariesRemover {},
78
77
& phases.LibrariesBuilder {},
79
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_LIBRARIES_POSTBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
78
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.libraries.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
80
79
81
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Compiling core..." )),
82
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_CORE_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
80
+ utils .LogIfVerbose ("info" , tr ("Compiling core..." )),
81
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.core.prebuild" , Suffix : ".pattern" },
83
82
& phases.CoreBuilder {},
84
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_CORE_POSTBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
83
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.core.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
85
84
86
- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Linking everything together..." )),
87
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_LINKING_PRELINK , Suffix : constants . HOOKS_PATTERN_SUFFIX },
85
+ utils .LogIfVerbose ("info" , tr ("Linking everything together..." )),
86
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.linking.prelink" , Suffix : ".pattern" },
88
87
& phases.Linker {},
89
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_LINKING_POSTLINK , Suffix : constants . HOOKS_PATTERN_SUFFIX },
88
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.linking.postlink" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
90
89
91
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_OBJCOPY_PREOBJCOPY , Suffix : constants . HOOKS_PATTERN_SUFFIX },
92
- & RecipeByPrefixSuffixRunner {Prefix : "recipe.objcopy." , Suffix : constants . HOOKS_PATTERN_SUFFIX },
93
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_OBJCOPY_POSTOBJCOPY , Suffix : constants . HOOKS_PATTERN_SUFFIX },
90
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.objcopy.preobjcopy" , Suffix : ".pattern" },
91
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.objcopy." , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
92
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.objcopy.postobjcopy" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
94
93
95
94
& MergeSketchWithBootloader {},
96
95
97
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_POSTBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
96
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
98
97
}
99
98
100
99
mainErr := runCommands (ctx , commands )
@@ -149,7 +148,7 @@ func (s *Preprocess) Run(ctx *types.Context) error {
149
148
150
149
& ContainerBuildOptions {},
151
150
152
- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
151
+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.prebuild" , Suffix : ".pattern" },
153
152
154
153
& ContainerMergeCopySketchFiles {},
155
154
@@ -203,7 +202,7 @@ func runCommands(ctx *types.Context, commands []types.Command) error {
203
202
204
203
func PrintRingNameIfDebug (ctx * types.Context , command types.Command ) {
205
204
if ctx .DebugLevel >= 10 {
206
- ctx .GetLogger ().Fprintln (os .Stdout , constants . LOG_LEVEL_DEBUG , "Ts: {0} - Running: {1}" , strconv .FormatInt (time .Now ().Unix (), 10 ), reflect .Indirect (reflect .ValueOf (command )).Type ().Name ())
205
+ ctx .GetLogger ().Fprintln (os .Stdout , "debug" , "Ts: {0} - Running: {1}" , strconv .FormatInt (time .Now ().Unix (), 10 ), reflect .Indirect (reflect .ValueOf (command )).Type ().Name ())
207
206
}
208
207
}
209
208
0 commit comments