@@ -24,7 +24,6 @@ import (
2424 "github.com/arduino/arduino-cli/arduino/sketch"
2525 "github.com/arduino/arduino-cli/i18n"
2626 "github.com/arduino/arduino-cli/legacy/builder/builder_utils"
27- "github.com/arduino/arduino-cli/legacy/builder/constants"
2827 "github.com/arduino/arduino-cli/legacy/builder/phases"
2928 "github.com/arduino/arduino-cli/legacy/builder/types"
3029 "github.com/arduino/arduino-cli/legacy/builder/utils"
@@ -55,46 +54,46 @@ func (s *Builder) Run(ctx *types.Context) error {
5554
5655 & WarnAboutPlatformRewrites {},
5756
58- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
57+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.prebuild" , Suffix : ".pattern" },
5958
6059 & ContainerMergeCopySketchFiles {},
6160
62- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Detecting libraries used..." )),
61+ utils .LogIfVerbose ("info" , tr ("Detecting libraries used..." )),
6362 & ContainerFindIncludes {},
6463
6564 & WarnAboutArchIncompatibleLibraries {},
6665
67- utils .LogIfVerbose (constants . LOG_LEVEL_INFO , tr ("Generating function prototypes..." )),
66+ utils .LogIfVerbose ("info" , tr ("Generating function prototypes..." )),
6867 & PreprocessSketch {},
6968
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" },
7271 & 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 },
7473
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" },
7776 & UnusedCompiledLibrariesRemover {},
7877 & 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 },
8079
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" },
8382 & 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 },
8584
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" },
8887 & 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 },
9089
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 },
9493
9594 & MergeSketchWithBootloader {},
9695
97- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_POSTBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
96+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.postbuild" , Suffix : ".pattern" , SkipIfOnlyUpdatingCompilationDatabase : true },
9897 }
9998
10099 mainErr := runCommands (ctx , commands )
@@ -149,7 +148,7 @@ func (s *Preprocess) Run(ctx *types.Context) error {
149148
150149 & ContainerBuildOptions {},
151150
152- & RecipeByPrefixSuffixRunner {Prefix : constants . HOOKS_PREBUILD , Suffix : constants . HOOKS_PATTERN_SUFFIX },
151+ & RecipeByPrefixSuffixRunner {Prefix : "recipe.hooks.prebuild" , Suffix : ".pattern" },
153152
154153 & ContainerMergeCopySketchFiles {},
155154
@@ -203,7 +202,7 @@ func runCommands(ctx *types.Context, commands []types.Command) error {
203202
204203func PrintRingNameIfDebug (ctx * types.Context , command types.Command ) {
205204 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 ())
207206 }
208207}
209208
0 commit comments