Skip to content

Commit 48c0180

Browse files
committed
Migrated verbosity parameters into Context
Signed-off-by: Cristian Maglie <[email protected]>
1 parent 559454c commit 48c0180

26 files changed

+63
-109
lines changed

src/arduino.cc/builder/add_additional_entries_to_context.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ func (s *AddAdditionalEntriesToContext) Run(context map[string]interface{}, ctx
6969
context[constants.CTX_WARNINGS_LEVEL] = DEFAULT_WARNINGS_LEVEL
7070
}
7171

72-
if !utils.MapHas(context, constants.CTX_VERBOSE) {
73-
context[constants.CTX_VERBOSE] = false
74-
}
75-
7672
sourceFiles := &types.UniqueStringQueue{}
7773
context[constants.CTX_COLLECTED_SOURCE_FILES_QUEUE] = sourceFiles
7874
foldersWithSources := &types.UniqueSourceFolderQueue{}

src/arduino.cc/builder/coan_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ type CoanRunner struct{}
4747
func (s *CoanRunner) Run(context map[string]interface{}, ctx *types.Context) error {
4848
source := context[constants.CTX_SOURCE].(string)
4949
source += "\n"
50-
verbose := context[constants.CTX_VERBOSE].(bool)
50+
verbose := ctx.Verbose
5151

5252
preprocPath := context[constants.CTX_PREPROC_PATH].(string)
5353
err := utils.EnsureFolderExists(preprocPath)

src/arduino.cc/builder/constants/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ const CTX_CTAGS_OF_PREPROC_SOURCE = "ctagsOfPreprocSource"
8989
const CTX_CTAGS_OF_SOURCE = "ctagsOfSource"
9090
const CTX_CTAGS_OUTPUT = "ctagsOutput"
9191
const CTX_CTAGS_TEMP_FILE_PATH = "ctagsTempFilePath"
92-
const CTX_DEBUG_PREPROCESSOR = "debugPreprocessor"
9392
const CTX_FILE_PATH_TO_READ = "filePathToRead"
9493
const CTX_FOLDERS_WITH_SOURCES_QUEUE = "foldersWithSourcesQueue"
9594
const CTX_GCC_MINUS_E_SOURCE = "gccMinusESource"
@@ -121,7 +120,6 @@ const CTX_TARGET_BOARD = "targetBoard"
121120
const CTX_TARGET_PACKAGE = "targetPackage"
122121
const CTX_TARGET_PLATFORM = "targetPlatform"
123122
const CTX_TOOLS = "tools"
124-
const CTX_VERBOSE = "verbose"
125123
const CTX_VIDPID = "VIDPID"
126124
const CTX_WARNINGS_LEVEL = "warningLevel"
127125
const EMPTY_STRING = ""

src/arduino.cc/builder/ctags/ctags_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (s *CTagsRunner) Run(context map[string]interface{}, ctx *types.Context) er
6060
return i18n.WrapError(err)
6161
}
6262

63-
verbose := context[constants.CTX_VERBOSE].(bool)
63+
verbose := ctx.Verbose
6464
if verbose {
6565
fmt.Println(commandLine)
6666
}

src/arduino.cc/builder/gcc_preproc_runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (s *GCCPreprocRunner) Run(context map[string]interface{}, ctx *types.Contex
5757
properties[constants.RECIPE_PREPROC_MACROS] = GeneratePreprocPatternFromCompile(properties[constants.RECIPE_CPP_PATTERN])
5858
}
5959

60-
verbose := context[constants.CTX_VERBOSE].(bool)
60+
verbose := ctx.Verbose
6161
logger := ctx.GetLogger()
6262
_, err = builder_utils.ExecRecipe(properties, constants.RECIPE_PREPROC_MACROS, true, verbose, false, logger)
6363
if err != nil {
@@ -80,7 +80,7 @@ func (s *GCCPreprocRunnerForDiscoveringIncludes) Run(context map[string]interfac
8080
return i18n.WrapError(err)
8181
}
8282

83-
verbose := context[constants.CTX_VERBOSE].(bool)
83+
verbose := ctx.Verbose
8484
logger := ctx.GetLogger()
8585

8686
if properties[constants.RECIPE_PREPROC_MACROS] == constants.EMPTY_STRING {

src/arduino.cc/builder/includes_finder_with_gcc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (s *IncludesFinderWithGCC) Run(context map[string]interface{}, ctx *types.C
4848
if p, ok := context[constants.CTX_BUILD_PROPERTIES]; ok {
4949
buildProperties = p.(props.PropertiesMap).Clone()
5050
}
51-
verbose := context[constants.CTX_VERBOSE].(bool)
51+
verbose := ctx.Verbose
5252
logger := ctx.GetLogger()
5353

5454
includesParams := constants.EMPTY_STRING

src/arduino.cc/builder/includes_to_include_folders.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (s *IncludesToIncludeFolders) Run(context map[string]interface{}, ctx *type
7979
context[constants.CTX_IMPORTED_LIBRARIES] = importedLibraries
8080

8181
buildProperties := context[constants.CTX_BUILD_PROPERTIES].(props.PropertiesMap)
82-
verbose := context[constants.CTX_VERBOSE].(bool)
82+
verbose := ctx.Verbose
8383
includeFolders := resolveIncludeFolders(newlyImportedLibraries, buildProperties, verbose)
8484
context[constants.CTX_INCLUDE_FOLDERS] = includeFolders
8585

src/arduino.cc/builder/phases/core_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type CoreBuilder struct{}
4343
func (s *CoreBuilder) Run(context map[string]interface{}, ctx *types.Context) error {
4444
coreBuildPath := context[constants.CTX_CORE_BUILD_PATH].(string)
4545
buildProperties := context[constants.CTX_BUILD_PROPERTIES].(props.PropertiesMap)
46-
verbose := context[constants.CTX_VERBOSE].(bool)
46+
verbose := ctx.Verbose
4747
warningsLevel := context[constants.CTX_WARNINGS_LEVEL].(string)
4848
logger := ctx.GetLogger()
4949

src/arduino.cc/builder/phases/libraries_builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (s *LibrariesBuilder) Run(context map[string]interface{}, ctx *types.Contex
4848
includes := context[constants.CTX_INCLUDE_FOLDERS].([]string)
4949
includes = utils.Map(includes, utils.WrapWithHyphenI)
5050
libraries := context[constants.CTX_IMPORTED_LIBRARIES].([]*types.Library)
51-
verbose := context[constants.CTX_VERBOSE].(bool)
51+
verbose := ctx.Verbose
5252
warningsLevel := context[constants.CTX_WARNINGS_LEVEL].(string)
5353
logger := ctx.GetLogger()
5454

src/arduino.cc/builder/phases/linker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (s *Linker) Run(context map[string]interface{}, ctx *types.Context) error {
6060
}
6161

6262
buildProperties := context[constants.CTX_BUILD_PROPERTIES].(props.PropertiesMap)
63-
verbose := context[constants.CTX_VERBOSE].(bool)
63+
verbose := ctx.Verbose
6464
warningsLevel := context[constants.CTX_WARNINGS_LEVEL].(string)
6565
logger := ctx.GetLogger()
6666

0 commit comments

Comments
 (0)