Skip to content

Commit 17fe9a1

Browse files
committed
Revert back a function
1 parent 155b4c6 commit 17fe9a1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
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{}

Diff for: test/test_compile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def test_compile_with_multiple_build_properties(run_command, data_dir, copy_sket
280280
# Tries compilation using multiple build properties separated by a comma
281281
res = run_command(
282282
f"compile -b {fqbn} "
283-
+ '--build-properties="compiler.cpp.extra_flags=\'-DPIN=2,-DSSID=\\"This is a String\\"\\"\' '
283+
+ '--build-properties="compiler.cpp.extra_flags=\\"-DPIN=2,-DSSID=\\"This is a String\\"\\"\\" '
284284
+ f"{sketch_path} --verbose"
285285
)
286286
assert res.failed

0 commit comments

Comments
 (0)