Skip to content

Commit 3d364fc

Browse files
committed
legacy: removed constants.MSG_PATTERN_MISSING from i18n
1 parent e8ef82a commit 3d364fc

File tree

7 files changed

+8
-15
lines changed

7 files changed

+8
-15
lines changed

legacy/builder/builder_utils/utils.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"sync"
2626

2727
"github.com/arduino/arduino-cli/legacy/builder/constants"
28-
"github.com/arduino/arduino-cli/legacy/builder/i18n"
2928
"github.com/arduino/arduino-cli/legacy/builder/types"
3029
"github.com/arduino/arduino-cli/legacy/builder/utils"
3130
"github.com/arduino/go-paths-helper"
@@ -490,7 +489,7 @@ func ArchiveCompiledFiles(ctx *types.Context, buildPath *paths.Path, archiveFile
490489

491490
func ExecRecipe(ctx *types.Context, buildProperties *properties.Map, recipe string, stdout int, stderr int) ([]byte, []byte, error) {
492491
// See util.ExecCommand for stdout/stderr arguments
493-
command, err := PrepareCommandForRecipe(ctx, buildProperties, recipe, false)
492+
command, err := PrepareCommandForRecipe(buildProperties, recipe, false)
494493
if err != nil {
495494
return nil, nil, errors.WithStack(err)
496495
}
@@ -500,11 +499,10 @@ func ExecRecipe(ctx *types.Context, buildProperties *properties.Map, recipe stri
500499

501500
const COMMANDLINE_LIMIT = 30000
502501

503-
func PrepareCommandForRecipe(ctx *types.Context, buildProperties *properties.Map, recipe string, removeUnsetProperties bool) (*exec.Cmd, error) {
504-
logger := ctx.GetLogger()
502+
func PrepareCommandForRecipe(buildProperties *properties.Map, recipe string, removeUnsetProperties bool) (*exec.Cmd, error) {
505503
pattern := buildProperties.Get(recipe)
506504
if pattern == "" {
507-
return nil, i18n.ErrorfWithLogger(logger, constants.MSG_PATTERN_MISSING, recipe)
505+
return nil, errors.Errorf("%s pattern is missing", recipe)
508506
}
509507

510508
commandLine := buildProperties.ExpandPropsInString(pattern)

legacy/builder/constants/constants.go

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ const MSG_LOOKING_FOR_RECIPES = "Looking for recipes like {0}*{1}"
100100
const MSG_MISSING_BUILD_BOARD = "Warning: Board {0}:{1}:{2} doesn''t define a ''build.board'' preference. Auto-set to: {3}"
101101
const MSG_MISSING_CORE_FOR_BOARD = "Selected board depends on '{0}' core (not installed)."
102102
const MSG_PACKAGE_UNKNOWN = "{0}: Unknown package"
103-
const MSG_PATTERN_MISSING = "{0} pattern is missing"
104103
const MSG_PLATFORM_UNKNOWN = "Platform {0} (package {1}) is unknown"
105104
const MSG_PROGRESS = "Progress {0}"
106105
const MSG_PROP_IN_LIBRARY = "Missing '{0}' from library in {1}"

legacy/builder/create_cmake_rule.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ func canExportCmakeProject(ctx *types.Context) bool {
241241
}
242242

243243
func extractCompileFlags(ctx *types.Context, receipe string, defines, dynamicLibs, linkerflags, linkDirectories *[]string, logger i18n.Logger) {
244-
command, _ := builder_utils.PrepareCommandForRecipe(ctx, ctx.BuildProperties, receipe, true)
244+
command, _ := builder_utils.PrepareCommandForRecipe(ctx.BuildProperties, receipe, true)
245245

246246
for _, arg := range command.Args {
247247
if strings.HasPrefix(arg, "-D") {

legacy/builder/ctags_runner.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package builder
1818
import (
1919
"github.com/arduino/arduino-cli/legacy/builder/constants"
2020
"github.com/arduino/arduino-cli/legacy/builder/ctags"
21-
"github.com/arduino/arduino-cli/legacy/builder/i18n"
2221
"github.com/arduino/arduino-cli/legacy/builder/types"
2322
"github.com/arduino/arduino-cli/legacy/builder/utils"
2423
"github.com/pkg/errors"
@@ -29,15 +28,14 @@ type CTagsRunner struct{}
2928
func (s *CTagsRunner) Run(ctx *types.Context) error {
3029
buildProperties := ctx.BuildProperties
3130
ctagsTargetFilePath := ctx.CTagsTargetFile
32-
logger := ctx.GetLogger()
3331

3432
properties := buildProperties.Clone()
3533
properties.Merge(buildProperties.SubTree(constants.BUILD_PROPERTIES_TOOLS_KEY).SubTree(constants.CTAGS))
3634
properties.SetPath(constants.BUILD_PROPERTIES_SOURCE_FILE, ctagsTargetFilePath)
3735

3836
pattern := properties.Get(constants.BUILD_PROPERTIES_PATTERN)
3937
if pattern == constants.EMPTY_STRING {
40-
return i18n.ErrorfWithLogger(logger, constants.MSG_PATTERN_MISSING, constants.CTAGS)
38+
return errors.Errorf("%s pattern is missing", constants.CTAGS)
4139
}
4240

4341
commandLine := properties.ExpandPropsInString(pattern)

legacy/builder/gcc_preproc_runner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func prepareGCCPreprocRecipeProperties(ctx *types.Context, sourceFilePath *paths
6969
properties.Set(constants.RECIPE_PREPROC_MACROS, GeneratePreprocPatternFromCompile(properties.Get(constants.RECIPE_CPP_PATTERN)))
7070
}
7171

72-
cmd, err := builder_utils.PrepareCommandForRecipe(ctx, properties, constants.RECIPE_PREPROC_MACROS, true)
72+
cmd, err := builder_utils.PrepareCommandForRecipe(properties, constants.RECIPE_PREPROC_MACROS, true)
7373
if err != nil {
7474
return nil, errors.WithStack(err)
7575
}

legacy/builder/phases/libraries_builder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func findExpectedPrecompiledLibFolder(ctx *types.Context, library *libraries.Lib
5858
// Add fpu specifications if they exist
5959
// To do so, resolve recipe.cpp.o.pattern,
6060
// search for -mfpu=xxx -mfloat-abi=yyy and add to a subfolder
61-
command, _ := builder_utils.PrepareCommandForRecipe(ctx, ctx.BuildProperties, constants.RECIPE_CPP_PATTERN, true)
61+
command, _ := builder_utils.PrepareCommandForRecipe(ctx.BuildProperties, constants.RECIPE_CPP_PATTERN, true)
6262
fpuSpecs := ""
6363
for _, el := range strings.Split(command.String(), " ") {
6464
if strings.Contains(el, FPU_CFLAG) {

legacy/builder/preprocess_sketch.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424

2525
bldr "github.com/arduino/arduino-cli/arduino/builder"
2626
"github.com/arduino/arduino-cli/legacy/builder/constants"
27-
"github.com/arduino/arduino-cli/legacy/builder/i18n"
2827
"github.com/arduino/arduino-cli/legacy/builder/types"
2928
"github.com/arduino/arduino-cli/legacy/builder/utils"
3029
properties "github.com/arduino/go-properties-orderedmap"
@@ -78,7 +77,6 @@ type ArduinoPreprocessorRunner struct{}
7877
func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
7978
buildProperties := ctx.BuildProperties
8079
targetFilePath := ctx.PreprocPath.Join(constants.FILE_CTAGS_TARGET_FOR_GCC_MINUS_E)
81-
logger := ctx.GetLogger()
8280

8381
properties := buildProperties.Clone()
8482
toolProps := buildProperties.SubTree("tools").SubTree("arduino-preprocessor")
@@ -102,7 +100,7 @@ func (s *ArduinoPreprocessorRunner) Run(ctx *types.Context) error {
102100

103101
pattern := properties.Get(constants.BUILD_PROPERTIES_PATTERN)
104102
if pattern == constants.EMPTY_STRING {
105-
return i18n.ErrorfWithLogger(logger, constants.MSG_PATTERN_MISSING, "arduino-preprocessor")
103+
return errors.New("arduino-preprocessor pattern is missing")
106104
}
107105

108106
commandLine := properties.ExpandPropsInString(pattern)

0 commit comments

Comments
 (0)