Skip to content

Commit 32e0d95

Browse files
committed
Revert back a function
1 parent 96ea15d commit 32e0d95

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Diff for: legacy/builder/types/context.go

+16
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,22 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map {
187187
return opts
188188
}
189189

190+
func (ctx *Context) InjectBuildOptions(opts *properties.Map) {
191+
ctx.HardwareDirs = paths.NewPathList(strings.Split(opts.Get("hardwareFolders"), ",")...)
192+
ctx.BuiltInToolsDirs = paths.NewPathList(strings.Split(opts.Get("builtInToolsFolders"), ",")...)
193+
ctx.BuiltInLibrariesDirs = paths.NewPathList(strings.Split(opts.Get("builtInLibrariesFolders"), ",")...)
194+
ctx.OtherLibrariesDirs = paths.NewPathList(strings.Split(opts.Get("otherLibrariesFolders"), ",")...)
195+
ctx.SketchLocation = opts.GetPath("sketchLocation")
196+
fqbn, err := cores.ParseFQBN(opts.Get("fqbn"))
197+
if err != nil {
198+
i18n.ErrorfWithLogger(ctx.GetLogger(), "Error in FQBN: %s", err)
199+
}
200+
ctx.FQBN = fqbn
201+
ctx.ArduinoAPIVersion = opts.Get("runtime.ide.version")
202+
ctx.CustomBuildProperties = strings.Split(opts.Get("customBuildProperties"), ",")
203+
ctx.OptimizationFlags = opts.Get("compiler.optimization_flags")
204+
}
205+
190206
func (ctx *Context) GetLogger() i18n.Logger {
191207
if ctx.logger == nil {
192208
return &i18n.HumanLogger{}

0 commit comments

Comments
 (0)