Skip to content

Commit 108e65f

Browse files
Pass types.Context down into compilation helpers
Previously, the verbose, logger and sometimes warningFlags were extracted from the Context by the top-level runner and passed down separately. Since this causes a lot of variable-passing of what is essentially global state, it is clearer to just pass a types.Context down and let the helpers get the data they need from that state. This prepared for a next commit where ExecRecipe will be refactored and needs access to the Context. Since the next commit will heavily change ExecRecipe anyway, this commit does not actually change ExecRecipe to accept the Context. This commit should not change any behaviour. Signed-off-by: Matthijs Kooijman <[email protected]>
1 parent b861a84 commit 108e65f

File tree

6 files changed

+52
-61
lines changed

6 files changed

+52
-61
lines changed

builder_utils/utils.go

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ import (
4040

4141
"github.com/arduino/arduino-builder/constants"
4242
"github.com/arduino/arduino-builder/i18n"
43+
"github.com/arduino/arduino-builder/types"
4344
"github.com/arduino/arduino-builder/utils"
4445
"github.com/arduino/go-properties-map"
4546
)
4647

47-
func CompileFilesRecursive(objectFiles []string, sourcePath string, buildPath string, buildProperties properties.Map, includes []string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
48-
objectFiles, err := CompileFiles(objectFiles, sourcePath, false, buildPath, buildProperties, includes, verbose, warningsLevel, logger)
48+
func CompileFilesRecursive(ctx *types.Context, objectFiles []string, sourcePath string, buildPath string, buildProperties properties.Map, includes []string) ([]string, error) {
49+
objectFiles, err := CompileFiles(ctx, objectFiles, sourcePath, false, buildPath, buildProperties, includes)
4950
if err != nil {
5051
return nil, i18n.WrapError(err)
5152
}
@@ -56,7 +57,7 @@ func CompileFilesRecursive(objectFiles []string, sourcePath string, buildPath st
5657
}
5758

5859
for _, folder := range folders {
59-
objectFiles, err = CompileFilesRecursive(objectFiles, filepath.Join(sourcePath, folder.Name()), filepath.Join(buildPath, folder.Name()), buildProperties, includes, verbose, warningsLevel, logger)
60+
objectFiles, err = CompileFilesRecursive(ctx, objectFiles, filepath.Join(sourcePath, folder.Name()), filepath.Join(buildPath, folder.Name()), buildProperties, includes)
6061
if err != nil {
6162
return nil, i18n.WrapError(err)
6263
}
@@ -65,28 +66,28 @@ func CompileFilesRecursive(objectFiles []string, sourcePath string, buildPath st
6566
return objectFiles, nil
6667
}
6768

68-
func CompileFiles(objectFiles []string, sourcePath string, recurse bool, buildPath string, buildProperties properties.Map, includes []string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
69-
objectFiles, err := compileFilesWithExtensionWithRecipe(objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".S", constants.RECIPE_S_PATTERN, verbose, warningsLevel, logger)
69+
func CompileFiles(ctx *types.Context, objectFiles []string, sourcePath string, recurse bool, buildPath string, buildProperties properties.Map, includes []string) ([]string, error) {
70+
objectFiles, err := compileFilesWithExtensionWithRecipe(ctx, objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".S", constants.RECIPE_S_PATTERN)
7071
if err != nil {
7172
return nil, i18n.WrapError(err)
7273
}
73-
objectFiles, err = compileFilesWithExtensionWithRecipe(objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".c", constants.RECIPE_C_PATTERN, verbose, warningsLevel, logger)
74+
objectFiles, err = compileFilesWithExtensionWithRecipe(ctx, objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".c", constants.RECIPE_C_PATTERN)
7475
if err != nil {
7576
return nil, i18n.WrapError(err)
7677
}
77-
objectFiles, err = compileFilesWithExtensionWithRecipe(objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".cpp", constants.RECIPE_CPP_PATTERN, verbose, warningsLevel, logger)
78+
objectFiles, err = compileFilesWithExtensionWithRecipe(ctx, objectFiles, sourcePath, recurse, buildPath, buildProperties, includes, ".cpp", constants.RECIPE_CPP_PATTERN)
7879
if err != nil {
7980
return nil, i18n.WrapError(err)
8081
}
8182
return objectFiles, nil
8283
}
8384

84-
func compileFilesWithExtensionWithRecipe(objectFiles []string, sourcePath string, recurse bool, buildPath string, buildProperties properties.Map, includes []string, extension string, recipe string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
85+
func compileFilesWithExtensionWithRecipe(ctx *types.Context, objectFiles []string, sourcePath string, recurse bool, buildPath string, buildProperties properties.Map, includes []string, extension string, recipe string) ([]string, error) {
8586
sources, err := findFilesInFolder(sourcePath, extension, recurse)
8687
if err != nil {
8788
return nil, i18n.WrapError(err)
8889
}
89-
return compileFilesWithRecipe(objectFiles, sourcePath, sources, buildPath, buildProperties, includes, recipe, verbose, warningsLevel, logger)
90+
return compileFilesWithRecipe(ctx, objectFiles, sourcePath, sources, buildPath, buildProperties, includes, recipe)
9091
}
9192

9293
func findFilesInFolder(sourcePath string, extension string, recurse bool) ([]string, error) {
@@ -145,9 +146,9 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
145146
return sources, nil
146147
}
147148

148-
func compileFilesWithRecipe(objectFiles []string, sourcePath string, sources []string, buildPath string, buildProperties properties.Map, includes []string, recipe string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
149+
func compileFilesWithRecipe(ctx *types.Context, objectFiles []string, sourcePath string, sources []string, buildPath string, buildProperties properties.Map, includes []string, recipe string) ([]string, error) {
149150
for _, source := range sources {
150-
objectFile, err := compileFileWithRecipe(sourcePath, source, buildPath, buildProperties, includes, recipe, verbose, warningsLevel, logger)
151+
objectFile, err := compileFileWithRecipe(ctx, sourcePath, source, buildPath, buildProperties, includes, recipe)
151152
if err != nil {
152153
return nil, i18n.WrapError(err)
153154
}
@@ -157,9 +158,10 @@ func compileFilesWithRecipe(objectFiles []string, sourcePath string, sources []s
157158
return objectFiles, nil
158159
}
159160

160-
func compileFileWithRecipe(sourcePath string, source string, buildPath string, buildProperties properties.Map, includes []string, recipe string, verbose bool, warningsLevel string, logger i18n.Logger) (string, error) {
161+
func compileFileWithRecipe(ctx *types.Context, sourcePath string, source string, buildPath string, buildProperties properties.Map, includes []string, recipe string) (string, error) {
162+
logger := ctx.GetLogger()
161163
properties := buildProperties.Clone()
162-
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+warningsLevel]
164+
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+ctx.WarningsLevel]
163165
properties[constants.BUILD_PROPERTIES_INCLUDES] = strings.Join(includes, constants.SPACE)
164166
properties[constants.BUILD_PROPERTIES_SOURCE_FILE] = source
165167
relativeSource, err := filepath.Rel(sourcePath, source)
@@ -179,11 +181,11 @@ func compileFileWithRecipe(sourcePath string, source string, buildPath string, b
179181
}
180182

181183
if !objIsUpToDate {
182-
_, err = ExecRecipe(properties, recipe, false, verbose, verbose, logger)
184+
_, err = ExecRecipe(properties, recipe, false, ctx.Verbose, ctx.Verbose, logger)
183185
if err != nil {
184186
return "", i18n.WrapError(err)
185187
}
186-
} else if verbose {
188+
} else if ctx.Verbose {
187189
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_USING_PREVIOUS_COMPILED_FILE, properties[constants.BUILD_PROPERTIES_OBJECT_FILE])
188190
}
189191

@@ -309,7 +311,8 @@ func CoreOrReferencedCoreHasChanged(corePath, targetCorePath, targetFile string)
309311
return true
310312
}
311313

312-
func ArchiveCompiledFiles(buildPath string, archiveFile string, objectFiles []string, buildProperties properties.Map, verbose bool, logger i18n.Logger) (string, error) {
314+
func ArchiveCompiledFiles(ctx *types.Context, buildPath string, archiveFile string, objectFiles []string, buildProperties properties.Map) (string, error) {
315+
logger := ctx.GetLogger()
313316
archiveFilePath := filepath.Join(buildPath, archiveFile)
314317

315318
rebuildArchive := false
@@ -332,7 +335,7 @@ func ArchiveCompiledFiles(buildPath string, archiveFile string, objectFiles []st
332335
return "", i18n.WrapError(err)
333336
}
334337
} else {
335-
if verbose {
338+
if ctx.Verbose {
336339
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_USING_PREVIOUS_COMPILED_FILE, archiveFilePath)
337340
}
338341
return archiveFilePath, nil
@@ -345,7 +348,7 @@ func ArchiveCompiledFiles(buildPath string, archiveFile string, objectFiles []st
345348
properties[constants.BUILD_PROPERTIES_ARCHIVE_FILE_PATH] = archiveFilePath
346349
properties[constants.BUILD_PROPERTIES_OBJECT_FILE] = objectFile
347350

348-
_, err := ExecRecipe(properties, constants.RECIPE_AR_PATTERN, false, verbose, verbose, logger)
351+
_, err := ExecRecipe(properties, constants.RECIPE_AR_PATTERN, false, ctx.Verbose, ctx.Verbose, logger)
349352
if err != nil {
350353
return "", i18n.WrapError(err)
351354
}

phases/core_builder.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ func (s *CoreBuilder) Run(ctx *types.Context) error {
4646
coreBuildPath := ctx.CoreBuildPath
4747
coreBuildCachePath := ctx.CoreBuildCachePath
4848
buildProperties := ctx.BuildProperties
49-
verbose := ctx.Verbose
50-
warningsLevel := ctx.WarningsLevel
51-
logger := ctx.GetLogger()
5249

5350
err := utils.EnsureFolderExists(coreBuildPath)
5451
if err != nil {
@@ -62,7 +59,7 @@ func (s *CoreBuilder) Run(ctx *types.Context) error {
6259
}
6360
}
6461

65-
archiveFile, objectFiles, err := compileCore(coreBuildPath, coreBuildCachePath, buildProperties, verbose, warningsLevel, logger)
62+
archiveFile, objectFiles, err := compileCore(ctx, coreBuildPath, coreBuildCachePath, buildProperties)
6663
if err != nil {
6764
return i18n.WrapError(err)
6865
}
@@ -73,7 +70,8 @@ func (s *CoreBuilder) Run(ctx *types.Context) error {
7370
return nil
7471
}
7572

76-
func compileCore(buildPath string, buildCachePath string, buildProperties properties.Map, verbose bool, warningsLevel string, logger i18n.Logger) (string, []string, error) {
73+
func compileCore(ctx *types.Context, buildPath string, buildCachePath string, buildProperties properties.Map) (string, []string, error) {
74+
logger := ctx.GetLogger()
7775
coreFolder := buildProperties[constants.BUILD_PROPERTIES_BUILD_CORE_PATH]
7876
variantFolder := buildProperties[constants.BUILD_PROPERTIES_BUILD_VARIANT_PATH]
7977

@@ -90,7 +88,7 @@ func compileCore(buildPath string, buildCachePath string, buildProperties proper
9088

9189
variantObjectFiles := []string{}
9290
if variantFolder != constants.EMPTY_STRING {
93-
variantObjectFiles, err = builder_utils.CompileFiles(variantObjectFiles, variantFolder, true, buildPath, buildProperties, includes, verbose, warningsLevel, logger)
91+
variantObjectFiles, err = builder_utils.CompileFiles(ctx, variantObjectFiles, variantFolder, true, buildPath, buildProperties, includes)
9492
if err != nil {
9593
return "", nil, i18n.WrapError(err)
9694
}
@@ -107,26 +105,26 @@ func compileCore(buildPath string, buildCachePath string, buildProperties proper
107105

108106
if canUseArchivedCore {
109107
// use archived core
110-
if verbose {
108+
if ctx.Verbose {
111109
logger.Println(constants.LOG_LEVEL_INFO, "Using precompiled core: {0}", targetArchivedCore)
112110
}
113111
return targetArchivedCore, variantObjectFiles, nil
114112
}
115113
}
116114

117-
coreObjectFiles, err := builder_utils.CompileFiles([]string{}, coreFolder, true, buildPath, buildProperties, includes, verbose, warningsLevel, logger)
115+
coreObjectFiles, err := builder_utils.CompileFiles(ctx, []string{}, coreFolder, true, buildPath, buildProperties, includes)
118116
if err != nil {
119117
return "", nil, i18n.WrapError(err)
120118
}
121119

122-
archiveFile, err := builder_utils.ArchiveCompiledFiles(buildPath, "core.a", coreObjectFiles, buildProperties, verbose, logger)
120+
archiveFile, err := builder_utils.ArchiveCompiledFiles(ctx, buildPath, "core.a", coreObjectFiles, buildProperties)
123121
if err != nil {
124122
return "", nil, i18n.WrapError(err)
125123
}
126124

127125
// archive core.a
128126
if targetArchivedCore != "" {
129-
if verbose {
127+
if ctx.Verbose {
130128
logger.Println(constants.LOG_LEVEL_INFO, constants.MSG_ARCHIVING_CORE_CACHE, targetArchivedCore)
131129
}
132130
builder_utils.CopyFile(archiveFile, targetArchivedCore)

phases/libraries_builder.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,13 @@ func (s *LibrariesBuilder) Run(ctx *types.Context) error {
5252
includes := ctx.IncludeFolders
5353
includes = utils.Map(includes, utils.WrapWithHyphenI)
5454
libraries := ctx.ImportedLibraries
55-
verbose := ctx.Verbose
56-
warningsLevel := ctx.WarningsLevel
57-
logger := ctx.GetLogger()
5855

5956
err := utils.EnsureFolderExists(librariesBuildPath)
6057
if err != nil {
6158
return i18n.WrapError(err)
6259
}
6360

64-
objectFiles, err := compileLibraries(libraries, librariesBuildPath, buildProperties, includes, verbose, warningsLevel, logger)
61+
objectFiles, err := compileLibraries(ctx, libraries, librariesBuildPath, buildProperties, includes)
6562
if err != nil {
6663
return i18n.WrapError(err)
6764
}
@@ -99,10 +96,10 @@ func fixLDFLAGforPrecompiledLibraries(ctx *types.Context, libraries []*types.Lib
9996
return nil
10097
}
10198

102-
func compileLibraries(libraries []*types.Library, buildPath string, buildProperties properties.Map, includes []string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
99+
func compileLibraries(ctx *types.Context, libraries []*types.Library, buildPath string, buildProperties properties.Map, includes []string) ([]string, error) {
103100
objectFiles := []string{}
104101
for _, library := range libraries {
105-
libraryObjectFiles, err := compileLibrary(library, buildPath, buildProperties, includes, verbose, warningsLevel, logger)
102+
libraryObjectFiles, err := compileLibrary(ctx, library, buildPath, buildProperties, includes)
106103
if err != nil {
107104
return nil, i18n.WrapError(err)
108105
}
@@ -113,8 +110,9 @@ func compileLibraries(libraries []*types.Library, buildPath string, buildPropert
113110

114111
}
115112

116-
func compileLibrary(library *types.Library, buildPath string, buildProperties properties.Map, includes []string, verbose bool, warningsLevel string, logger i18n.Logger) ([]string, error) {
117-
if verbose {
113+
func compileLibrary(ctx *types.Context, library *types.Library, buildPath string, buildProperties properties.Map, includes []string) ([]string, error) {
114+
logger := ctx.GetLogger()
115+
if ctx.Verbose {
118116
logger.Println(constants.LOG_LEVEL_INFO, "Compiling library \"{0}\"", library.Name)
119117
}
120118
libraryBuildPath := filepath.Join(buildPath, library.Name)
@@ -144,12 +142,12 @@ func compileLibrary(library *types.Library, buildPath string, buildProperties pr
144142
}
145143

146144
if library.Layout == types.LIBRARY_RECURSIVE {
147-
objectFiles, err = builder_utils.CompileFilesRecursive(objectFiles, library.SrcFolder, libraryBuildPath, buildProperties, includes, verbose, warningsLevel, logger)
145+
objectFiles, err = builder_utils.CompileFilesRecursive(ctx, objectFiles, library.SrcFolder, libraryBuildPath, buildProperties, includes)
148146
if err != nil {
149147
return nil, i18n.WrapError(err)
150148
}
151149
if library.DotALinkage {
152-
archiveFile, err := builder_utils.ArchiveCompiledFiles(libraryBuildPath, library.Name+".a", objectFiles, buildProperties, verbose, logger)
150+
archiveFile, err := builder_utils.ArchiveCompiledFiles(ctx, libraryBuildPath, library.Name+".a", objectFiles, buildProperties)
153151
if err != nil {
154152
return nil, i18n.WrapError(err)
155153
}
@@ -159,14 +157,14 @@ func compileLibrary(library *types.Library, buildPath string, buildProperties pr
159157
if library.UtilityFolder != "" {
160158
includes = append(includes, utils.WrapWithHyphenI(library.UtilityFolder))
161159
}
162-
objectFiles, err = builder_utils.CompileFiles(objectFiles, library.SrcFolder, false, libraryBuildPath, buildProperties, includes, verbose, warningsLevel, logger)
160+
objectFiles, err = builder_utils.CompileFiles(ctx, objectFiles, library.SrcFolder, false, libraryBuildPath, buildProperties, includes)
163161
if err != nil {
164162
return nil, i18n.WrapError(err)
165163
}
166164

167165
if library.UtilityFolder != "" {
168166
utilityBuildPath := filepath.Join(libraryBuildPath, constants.LIBRARY_FOLDER_UTILITY)
169-
objectFiles, err = builder_utils.CompileFiles(objectFiles, library.UtilityFolder, false, utilityBuildPath, buildProperties, includes, verbose, warningsLevel, logger)
167+
objectFiles, err = builder_utils.CompileFiles(ctx, objectFiles, library.UtilityFolder, false, utilityBuildPath, buildProperties, includes)
170168
if err != nil {
171169
return nil, i18n.WrapError(err)
172170
}

phases/linker.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,29 @@ func (s *Linker) Run(ctx *types.Context) error {
6161
}
6262

6363
buildProperties := ctx.BuildProperties
64-
verbose := ctx.Verbose
65-
warningsLevel := ctx.WarningsLevel
66-
logger := ctx.GetLogger()
6764

68-
err = link(objectFiles, coreDotARelPath, coreArchiveFilePath, buildProperties, verbose, warningsLevel, logger)
65+
err = link(ctx, objectFiles, coreDotARelPath, coreArchiveFilePath, buildProperties)
6966
if err != nil {
7067
return i18n.WrapError(err)
7168
}
7269

7370
return nil
7471
}
7572

76-
func link(objectFiles []string, coreDotARelPath string, coreArchiveFilePath string, buildProperties properties.Map, verbose bool, warningsLevel string, logger i18n.Logger) error {
73+
func link(ctx *types.Context, objectFiles []string, coreDotARelPath string, coreArchiveFilePath string, buildProperties properties.Map) error {
7774
optRelax := addRelaxTrickIfATMEGA2560(buildProperties)
7875

7976
objectFiles = utils.Map(objectFiles, wrapWithDoubleQuotes)
8077
objectFileList := strings.Join(objectFiles, constants.SPACE)
8178

8279
properties := buildProperties.Clone()
8380
properties[constants.BUILD_PROPERTIES_COMPILER_C_ELF_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_C_ELF_FLAGS] + optRelax
84-
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+warningsLevel]
81+
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+ctx.WarningsLevel]
8582
properties[constants.BUILD_PROPERTIES_ARCHIVE_FILE] = coreDotARelPath
8683
properties[constants.BUILD_PROPERTIES_ARCHIVE_FILE_PATH] = coreArchiveFilePath
8784
properties[constants.BUILD_PROPERTIES_OBJECT_FILES] = objectFileList
8885

89-
_, err := builder_utils.ExecRecipe(properties, constants.RECIPE_C_COMBINE_PATTERN, false, verbose, verbose, logger)
86+
_, err := builder_utils.ExecRecipe(properties, constants.RECIPE_C_COMBINE_PATTERN, false, ctx.Verbose, ctx.Verbose, ctx.GetLogger())
9087
return err
9188
}
9289

phases/sizer.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,20 @@ func (s *Sizer) Run(ctx *types.Context) error {
5252
}
5353

5454
buildProperties := ctx.BuildProperties
55-
verbose := ctx.Verbose
56-
warningsLevel := ctx.WarningsLevel
57-
logger := ctx.GetLogger()
5855

59-
err := checkSize(buildProperties, verbose, warningsLevel, logger)
56+
err := checkSize(ctx, buildProperties)
6057
if err != nil {
6158
return i18n.WrapError(err)
6259
}
6360

6461
return nil
6562
}
6663

67-
func checkSize(buildProperties properties.Map, verbose bool, warningsLevel string, logger i18n.Logger) error {
64+
func checkSize(ctx *types.Context, buildProperties properties.Map) error {
65+
logger := ctx.GetLogger()
6866

6967
properties := buildProperties.Clone()
70-
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+warningsLevel]
68+
properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS] = properties[constants.BUILD_PROPERTIES_COMPILER_WARNING_FLAGS+"."+ctx.WarningsLevel]
7169

7270
maxTextSizeString := properties[constants.PROPERTY_UPLOAD_MAX_SIZE]
7371
maxDataSizeString := properties[constants.PROPERTY_UPLOAD_MAX_DATA_SIZE]
@@ -89,7 +87,7 @@ func checkSize(buildProperties properties.Map, verbose bool, warningsLevel strin
8987
}
9088
}
9189

92-
textSize, dataSize, _, err := execSizeRecipe(properties, logger)
90+
textSize, dataSize, _, err := execSizeRecipe(ctx, properties)
9391
if err != nil {
9492
logger.Println(constants.LOG_LEVEL_WARN, constants.MSG_SIZER_ERROR_NO_RULE)
9593
return nil
@@ -127,8 +125,8 @@ func checkSize(buildProperties properties.Map, verbose bool, warningsLevel strin
127125
return nil
128126
}
129127

130-
func execSizeRecipe(properties properties.Map, logger i18n.Logger) (textSize int, dataSize int, eepromSize int, resErr error) {
131-
out, err := builder_utils.ExecRecipe(properties, constants.RECIPE_SIZE_PATTERN, false, false, false, logger)
128+
func execSizeRecipe(ctx *types.Context, properties properties.Map) (textSize int, dataSize int, eepromSize int, resErr error) {
129+
out, err := builder_utils.ExecRecipe(properties, constants.RECIPE_SIZE_PATTERN, false, false, false, ctx.GetLogger())
132130
if err != nil {
133131
resErr = errors.New("Error while determining sketch size: " + err.Error())
134132
return

0 commit comments

Comments
 (0)