Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9d8d43c

Browse files
committedFeb 22, 2023
Refactoring of some legacy properties generation subroutines
1 parent 053c260 commit 9d8d43c

15 files changed

+39
-95
lines changed
 

‎arduino/cores/packagemanager/package_manager.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ package packagemanager
1818
import (
1919
"fmt"
2020
"net/url"
21+
"os"
2122
"path"
23+
"path/filepath"
2224
"strconv"
2325
"strings"
2426
"sync"
@@ -371,6 +373,19 @@ func (pme *Explorer) ResolveFQBN(fqbn *cores.FQBN) (
371373
buildProperties.Set("extra.time.zone", strconv.Itoa(timeutils.TimezoneOffsetNoDST(now)))
372374
buildProperties.Set("extra.time.dst", strconv.Itoa(timeutils.DaylightSavingsOffset(now)))
373375

376+
if !buildProperties.ContainsKey("runtime.ide.path") {
377+
if ex, err := os.Executable(); err == nil {
378+
buildProperties.Set("runtime.ide.path", filepath.Dir(ex))
379+
} else {
380+
buildProperties.Set("runtime.ide.path", "")
381+
}
382+
}
383+
buildProperties.Set("runtime.os", properties.GetOSSuffix())
384+
buildProperties.Set("build.library_discovery_phase", "0")
385+
// Deprecated properties
386+
buildProperties.Set("ide_version", "10607")
387+
buildProperties.Set("runtime.ide.version", "10607")
388+
374389
// No errors... phew!
375390
return targetPackage, platformRelease, board, buildProperties, buildPlatformRelease, nil
376391
}

‎commands/compile/compile.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream
174174

175175
builderCtx.BuiltInLibrariesDirs = configuration.IDEBuiltinLibrariesDir(configuration.Settings)
176176

177-
// Will be deprecated.
178-
builderCtx.ArduinoAPIVersion = "10607"
179-
180177
builderCtx.Stdout = outStream
181178
builderCtx.Stderr = errStream
182179
builderCtx.Clean = req.GetClean()

‎legacy/builder/setup_build_properties.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
package builder
1717

1818
import (
19-
"os"
20-
"path/filepath"
21-
2219
"github.com/arduino/arduino-cli/legacy/builder/types"
2320
properties "github.com/arduino/go-properties-orderedmap"
2421
"github.com/pkg/errors"
@@ -42,19 +39,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
4239
buildProperties.Set("build.project_name", ctx.Sketch.MainFile.Base())
4340
}
4441

45-
// get base folder and use it to populate BUILD_PROPERTIES_RUNTIME_IDE_PATH (arduino and arduino-builder live in the same dir)
46-
ex, err := os.Executable()
47-
exPath := ""
48-
if err == nil {
49-
exPath = filepath.Dir(ex)
50-
}
51-
52-
buildProperties.Set("runtime.ide.version", ctx.ArduinoAPIVersion)
53-
buildProperties.Set("runtime.ide.path", exPath)
54-
buildProperties.Set("ide_version", ctx.ArduinoAPIVersion)
55-
buildProperties.Set("runtime.os", properties.GetOSSuffix())
56-
buildProperties.Set("build.library_discovery_phase", "0")
57-
5842
if ctx.OptimizeForDebug {
5943
if buildProperties.ContainsKey("compiler.optimization_flags.debug") {
6044
buildProperties.Set("compiler.optimization_flags", buildProperties.Get("compiler.optimization_flags.debug"))

‎legacy/builder/test/builder_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string
4141
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
4242
BuiltInLibrariesDirs: paths.New("downloaded_libraries"),
4343
OtherLibrariesDirs: paths.NewPathList("libraries"),
44-
ArduinoAPIVersion: "10600",
4544
Verbose: false,
4645
}
4746
}

‎legacy/builder/test/create_build_options_map_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ func TestCreateBuildOptionsMap(t *testing.T) {
3232
OtherLibrariesDirs: paths.NewPathList("libraries"),
3333
Sketch: &sketch.Sketch{FullPath: paths.New("sketchLocation")},
3434
FQBN: parseFQBN(t, "my:nice:fqbn"),
35-
ArduinoAPIVersion: "ideVersion",
3635
Verbose: true,
3736
BuildPath: paths.New("buildPath"),
3837
OptimizationFlags: "-Os",

‎legacy/builder/test/ctags_runner_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func TestCTagsRunner(t *testing.T) {
3838
OtherLibrariesDirs: paths.NewPathList("libraries"),
3939
Sketch: OpenSketch(t, sketchLocation),
4040
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
41-
ArduinoAPIVersion: "10600",
4241
Verbose: true,
4342
}
4443

@@ -88,7 +87,6 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) {
8887
OtherLibrariesDirs: paths.NewPathList("libraries"),
8988
Sketch: OpenSketch(t, sketchLocation),
9089
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
91-
ArduinoAPIVersion: "10600",
9290
Verbose: true,
9391
}
9492

@@ -136,7 +134,6 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) {
136134
OtherLibrariesDirs: paths.NewPathList("libraries"),
137135
Sketch: OpenSketch(t, sketchLocation),
138136
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
139-
ArduinoAPIVersion: "10600",
140137
Verbose: true,
141138
}
142139

@@ -183,7 +180,6 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) {
183180
OtherLibrariesDirs: paths.NewPathList("libraries"),
184181
Sketch: OpenSketch(t, sketchLocation),
185182
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
186-
ArduinoAPIVersion: "10600",
187183
Verbose: true,
188184
}
189185

@@ -229,7 +225,6 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) {
229225
OtherLibrariesDirs: paths.NewPathList("libraries"),
230226
Sketch: OpenSketch(t, sketchLocation),
231227
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
232-
ArduinoAPIVersion: "10600",
233228
Verbose: true,
234229
}
235230

‎legacy/builder/test/includes_to_include_folders_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func TestIncludesToIncludeFolders(t *testing.T) {
3636
OtherLibrariesDirs: paths.NewPathList("libraries"),
3737
Sketch: OpenSketch(t, paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")),
3838
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
39-
ArduinoAPIVersion: "10600",
4039
Verbose: true,
4140
}
4241

@@ -72,7 +71,6 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) {
7271
OtherLibrariesDirs: paths.NewPathList("libraries"),
7372
Sketch: OpenSketch(t, paths.New("SketchWithIfDef", "SketchWithIfDef.ino")),
7473
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
75-
ArduinoAPIVersion: "10600",
7674
Verbose: true,
7775
}
7876

@@ -107,7 +105,6 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) {
107105
OtherLibrariesDirs: paths.NewPathList("libraries"),
108106
Sketch: OpenSketch(t, paths.New("sketch9", "sketch9.ino")),
109107
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
110-
ArduinoAPIVersion: "10600",
111108
Verbose: true,
112109
}
113110

@@ -145,7 +142,6 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) {
145142
OtherLibrariesDirs: paths.NewPathList("libraries"),
146143
Sketch: OpenSketch(t, paths.New("sketch10", "sketch10.ino")),
147144
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
148-
ArduinoAPIVersion: "10600",
149145
Verbose: true,
150146
}
151147

@@ -179,7 +175,6 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) {
179175
BuiltInLibrariesDirs: paths.New("downloaded_libraries"),
180176
Sketch: OpenSketch(t, paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino")),
181177
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
182-
ArduinoAPIVersion: "10600",
183178
Verbose: true,
184179
}
185180

@@ -217,7 +212,6 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo
217212
OtherLibrariesDirs: paths.NewPathList("libraries"),
218213
Sketch: OpenSketch(t, paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino")),
219214
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
220-
ArduinoAPIVersion: "10600",
221215
Verbose: true,
222216
}
223217

@@ -255,7 +249,6 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) {
255249
OtherLibrariesDirs: paths.NewPathList("libraries"),
256250
Sketch: OpenSketch(t, paths.New("sketch_usbhost", "sketch_usbhost.ino")),
257251
FQBN: parseFQBN(t, "arduino:samd:arduino_zero_native"),
258-
ArduinoAPIVersion: "10600",
259252
Verbose: true,
260253
}
261254

@@ -293,7 +286,6 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) {
293286
OtherLibrariesDirs: paths.NewPathList("libraries"),
294287
Sketch: OpenSketch(t, paths.New("sketch_with_subfolders", "sketch_with_subfolders.ino")),
295288
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
296-
ArduinoAPIVersion: "10600",
297289
Verbose: true,
298290
}
299291

‎legacy/builder/test/load_vid_pid_specific_properties_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) {
2929
DownloadCoresAndToolsAndLibraries(t)
3030

3131
ctx := &types.Context{
32-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
33-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
34-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
35-
FQBN: parseFQBN(t, "arduino:avr:micro"),
36-
ArduinoAPIVersion: "10600",
32+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
33+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
34+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
35+
FQBN: parseFQBN(t, "arduino:avr:micro"),
3736
}
3837

3938
buildPath := SetupBuildPath(t, ctx)
@@ -59,11 +58,10 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) {
5958
DownloadCoresAndToolsAndLibraries(t)
6059

6160
ctx := &types.Context{
62-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
63-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
64-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
65-
FQBN: parseFQBN(t, "arduino:avr:micro"),
66-
ArduinoAPIVersion: "10600",
61+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
62+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"),
63+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
64+
FQBN: parseFQBN(t, "arduino:avr:micro"),
6765
}
6866

6967
buildPath := SetupBuildPath(t, ctx)

‎legacy/builder/test/merge_sketch_with_bootloader_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ func TestMergeSketchWithBootloader(t *testing.T) {
3838
OtherLibrariesDirs: paths.NewPathList("libraries"),
3939
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
4040
FQBN: parseFQBN(t, "arduino:avr:uno"),
41-
ArduinoAPIVersion: "10600",
4241
}
4342

4443
buildPath := SetupBuildPath(t, ctx)
@@ -108,7 +107,6 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) {
108107
OtherLibrariesDirs: paths.NewPathList("libraries"),
109108
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
110109
FQBN: parseFQBN(t, "arduino:avr:uno"),
111-
ArduinoAPIVersion: "10600",
112110
}
113111

114112
buildPath := SetupBuildPath(t, ctx)
@@ -179,7 +177,6 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) {
179177
OtherLibrariesDirs: paths.NewPathList("libraries"),
180178
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
181179
FQBN: parseFQBN(t, "arduino:avr:uno"),
182-
ArduinoAPIVersion: "10600",
183180
}
184181

185182
buildPath := SetupBuildPath(t, ctx)
@@ -217,7 +214,6 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) {
217214
OtherLibrariesDirs: paths.NewPathList("libraries"),
218215
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
219216
FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega2560"),
220-
ArduinoAPIVersion: "10600",
221217
}
222218

223219
buildPath := SetupBuildPath(t, ctx)

‎legacy/builder/test/prototypes_adder_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ func TestPrototypesAdderBridgeExample(t *testing.T) {
4141
OtherLibrariesDirs: paths.NewPathList("libraries"),
4242
Sketch: OpenSketch(t, sketchLocation),
4343
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
44-
ArduinoAPIVersion: "10600",
4544
Verbose: true,
4645
}
4746

@@ -81,7 +80,6 @@ func TestPrototypesAdderSketchWithIfDef(t *testing.T) {
8180
OtherLibrariesDirs: paths.NewPathList("libraries"),
8281
Sketch: OpenSketch(t, paths.New("SketchWithIfDef", "SketchWithIfDef.ino")),
8382
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
84-
ArduinoAPIVersion: "10600",
8583
Verbose: true,
8684
}
8785

@@ -121,7 +119,6 @@ func TestPrototypesAdderBaladuino(t *testing.T) {
121119
OtherLibrariesDirs: paths.NewPathList("libraries"),
122120
Sketch: OpenSketch(t, paths.New("Baladuino", "Baladuino.ino")),
123121
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
124-
ArduinoAPIVersion: "10600",
125122
Verbose: true,
126123
}
127124

@@ -161,7 +158,6 @@ func TestPrototypesAdderCharWithEscapedDoubleQuote(t *testing.T) {
161158
OtherLibrariesDirs: paths.NewPathList("libraries"),
162159
Sketch: OpenSketch(t, paths.New("CharWithEscapedDoubleQuote", "CharWithEscapedDoubleQuote.ino")),
163160
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
164-
ArduinoAPIVersion: "10600",
165161
Verbose: true,
166162
}
167163

@@ -201,7 +197,6 @@ func TestPrototypesAdderIncludeBetweenMultilineComment(t *testing.T) {
201197
OtherLibrariesDirs: paths.NewPathList("libraries"),
202198
Sketch: OpenSketch(t, paths.New("IncludeBetweenMultilineComment", "IncludeBetweenMultilineComment.ino")),
203199
FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"),
204-
ArduinoAPIVersion: "10600",
205200
Verbose: true,
206201
}
207202

@@ -241,7 +236,6 @@ func TestPrototypesAdderLineContinuations(t *testing.T) {
241236
OtherLibrariesDirs: paths.NewPathList("libraries"),
242237
Sketch: OpenSketch(t, paths.New("LineContinuations", "LineContinuations.ino")),
243238
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
244-
ArduinoAPIVersion: "10600",
245239
Verbose: true,
246240
}
247241

@@ -281,7 +275,6 @@ func TestPrototypesAdderStringWithComment(t *testing.T) {
281275
OtherLibrariesDirs: paths.NewPathList("libraries"),
282276
Sketch: OpenSketch(t, paths.New("StringWithComment", "StringWithComment.ino")),
283277
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
284-
ArduinoAPIVersion: "10600",
285278
Verbose: true,
286279
}
287280

@@ -321,7 +314,6 @@ func TestPrototypesAdderSketchWithStruct(t *testing.T) {
321314
OtherLibrariesDirs: paths.NewPathList("libraries"),
322315
Sketch: OpenSketch(t, paths.New("SketchWithStruct", "SketchWithStruct.ino")),
323316
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
324-
ArduinoAPIVersion: "10600",
325317
Verbose: true,
326318
}
327319

@@ -369,7 +361,6 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) {
369361
OtherLibrariesDirs: paths.NewPathList("libraries"),
370362
Sketch: OpenSketch(t, sketchLocation),
371363
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
372-
ArduinoAPIVersion: "10600",
373364
Verbose: true,
374365
}
375366

@@ -415,7 +406,6 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) {
415406
OtherLibrariesDirs: paths.NewPathList("libraries"),
416407
Sketch: OpenSketch(t, paths.New("sketch_no_functions_two_files", "sketch_no_functions_two_files.ino")),
417408
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
418-
ArduinoAPIVersion: "10600",
419409
Verbose: true,
420410
}
421411

@@ -455,7 +445,6 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) {
455445
OtherLibrariesDirs: paths.NewPathList("libraries"),
456446
Sketch: OpenSketch(t, paths.New("sketch_no_functions", "sketch_no_functions.ino")),
457447
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
458-
ArduinoAPIVersion: "10600",
459448
Verbose: true,
460449
}
461450

@@ -501,7 +490,6 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) {
501490
OtherLibrariesDirs: paths.NewPathList("libraries"),
502491
Sketch: OpenSketch(t, sketchLocation),
503492
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
504-
ArduinoAPIVersion: "10600",
505493
Verbose: true,
506494
}
507495

@@ -544,7 +532,6 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) {
544532
OtherLibrariesDirs: paths.NewPathList("libraries"),
545533
Sketch: OpenSketch(t, sketchLocation),
546534
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
547-
ArduinoAPIVersion: "10600",
548535
Verbose: true,
549536
}
550537

@@ -598,7 +585,6 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) {
598585
OtherLibrariesDirs: paths.NewPathList("libraries"),
599586
Sketch: OpenSketch(t, sketchLocation),
600587
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
601-
ArduinoAPIVersion: "10600",
602588
Verbose: true,
603589
}
604590

@@ -641,7 +627,6 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) {
641627
BuiltInLibrariesDirs: paths.New("downloaded_libraries"),
642628
Sketch: OpenSketch(t, sketchLocation),
643629
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
644-
ArduinoAPIVersion: "10600",
645630
Verbose: true,
646631
}
647632

@@ -683,7 +668,6 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) {
683668
BuiltInToolsDirs: paths.NewPathList("downloaded_tools"),
684669
Sketch: OpenSketch(t, sketchLocation),
685670
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
686-
ArduinoAPIVersion: "10600",
687671
Verbose: true,
688672
}
689673

@@ -732,7 +716,6 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) {
732716
OtherLibrariesDirs: paths.NewPathList("libraries"),
733717
Sketch: OpenSketch(t, sketchLocation),
734718
FQBN: parseFQBN(t, "arduino:avr:yun"),
735-
ArduinoAPIVersion: "10600",
736719
Verbose: true,
737720
}
738721

@@ -778,7 +761,6 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) {
778761
OtherLibrariesDirs: paths.NewPathList("libraries"),
779762
Sketch: OpenSketch(t, sketchLocation),
780763
FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"),
781-
ArduinoAPIVersion: "10600",
782764
Verbose: true,
783765
}
784766

@@ -824,7 +806,6 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) {
824806
OtherLibrariesDirs: paths.NewPathList("libraries"),
825807
Sketch: OpenSketch(t, sketchLocation),
826808
FQBN: parseFQBN(t, "arduino:avr:uno"),
827-
ArduinoAPIVersion: "10600",
828809
Verbose: true,
829810
}
830811

@@ -864,7 +845,6 @@ func TestPrototypesAdderSketchWithDosEol(t *testing.T) {
864845
OtherLibrariesDirs: paths.NewPathList("libraries"),
865846
Sketch: OpenSketch(t, paths.New("eol_processing", "eol_processing.ino")),
866847
FQBN: parseFQBN(t, "arduino:avr:uno"),
867-
ArduinoAPIVersion: "10600",
868848
Verbose: true,
869849
}
870850

@@ -904,7 +884,6 @@ func TestPrototypesAdderSketchWithSubstringFunctionMember(t *testing.T) {
904884
OtherLibrariesDirs: paths.NewPathList("libraries"),
905885
Sketch: OpenSketch(t, sketchLocation),
906886
FQBN: parseFQBN(t, "arduino:avr:uno"),
907-
ArduinoAPIVersion: "10600",
908887
Verbose: true,
909888
}
910889

‎legacy/builder/test/setup_build_properties_test.go

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ func TestSetupBuildProperties(t *testing.T) {
2929
DownloadCoresAndToolsAndLibraries(t)
3030

3131
ctx := &types.Context{
32-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
33-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
34-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
35-
FQBN: parseFQBN(t, "arduino:avr:uno"),
36-
ArduinoAPIVersion: "10600",
32+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
33+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
34+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
35+
FQBN: parseFQBN(t, "arduino:avr:uno"),
3736
}
3837

3938
buildPath := SetupBuildPath(t, ctx)
@@ -93,11 +92,10 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) {
9392
DownloadCoresAndToolsAndLibraries(t)
9493

9594
ctx := &types.Context{
96-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
97-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
98-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
99-
FQBN: parseFQBN(t, "arduino:avr:uno"),
100-
ArduinoAPIVersion: "10600",
95+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"),
96+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
97+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
98+
FQBN: parseFQBN(t, "arduino:avr:uno"),
10199

102100
CustomBuildProperties: []string{"name=fake name", "tools.avrdude.config.path=non existent path with space and a ="},
103101
}
@@ -132,11 +130,10 @@ func TestSetupBuildPropertiesUserHardware(t *testing.T) {
132130
DownloadCoresAndToolsAndLibraries(t)
133131

134132
ctx := &types.Context{
135-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
136-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
137-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
138-
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
139-
ArduinoAPIVersion: "10600",
133+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
134+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
135+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
136+
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
140137
}
141138

142139
buildPath := SetupBuildPath(t, ctx)
@@ -168,11 +165,10 @@ func TestSetupBuildPropertiesWithMissingPropsFromParentPlatformTxtFiles(t *testi
168165
DownloadCoresAndToolsAndLibraries(t)
169166

170167
ctx := &types.Context{
171-
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
172-
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
173-
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
174-
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
175-
ArduinoAPIVersion: "10600",
168+
HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"),
169+
BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"),
170+
Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")),
171+
FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"),
176172
}
177173

178174
buildPath := SetupBuildPath(t, ctx)

‎legacy/builder/test/store_build_options_map_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func TestStoreBuildOptionsMap(t *testing.T) {
3434
OtherLibrariesDirs: paths.NewPathList("libraries"),
3535
Sketch: &sketch.Sketch{FullPath: paths.New("sketchLocation")},
3636
FQBN: parseFQBN(t, "my:nice:fqbn"),
37-
ArduinoAPIVersion: "ideVersion",
3837
CustomBuildProperties: []string{"custom=prop"},
3938
Verbose: true,
4039
OptimizationFlags: "-Os",

‎legacy/builder/test/try_build_of_problematic_sketch_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ func makeDefaultContext(t *testing.T) *types.Context {
213213
BuiltInLibrariesDirs: paths.New("downloaded_libraries"),
214214
OtherLibrariesDirs: paths.NewPathList("libraries"),
215215
FQBN: parseFQBN(t, "arduino:avr:leonardo"),
216-
ArduinoAPIVersion: "10607",
217216
Verbose: true,
218217
DebugPreprocessor: true,
219218
}

‎legacy/builder/types/context.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ type Context struct {
7171
OtherLibrariesDirs paths.PathList
7272
LibraryDirs paths.PathList // List of paths pointing to individual library root folders
7373
WatchedLocations paths.PathList
74-
ArduinoAPIVersion string
7574
FQBN *cores.FQBN
7675
CodeCompleteAt string
7776
Clean bool
@@ -219,7 +218,6 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map {
219218
additionalFilesRelative = append(additionalFilesRelative, relPath.String())
220219
}
221220
opts.Set("fqbn", ctx.FQBN.String())
222-
opts.Set("runtime.ide.version", ctx.ArduinoAPIVersion)
223221
opts.Set("customBuildProperties", strings.Join(ctx.CustomBuildProperties, ","))
224222
opts.Set("additionalFiles", strings.Join(additionalFilesRelative, ","))
225223
opts.Set("compiler.optimization_flags", ctx.OptimizationFlags)

‎legacy/builder/types/context_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ func TestInjectBuildOption(t *testing.T) {
3636
OtherLibrariesDirs: paths.NewPathList("fff", "ggg"),
3737
Sketch: &sketch.Sketch{FullPath: paths.New("hhh")},
3838
FQBN: fqbn,
39-
ArduinoAPIVersion: "iii",
4039
CustomBuildProperties: []string{"jjj", "kkk"},
4140
OptimizationFlags: "lll",
4241
}
@@ -48,7 +47,6 @@ func TestInjectBuildOption(t *testing.T) {
4847
"otherLibrariesFolders": "fff,ggg",
4948
"sketchLocation": "hhh",
5049
"fqbn": "aaa:bbb:ccc",
51-
"runtime.ide.version": "iii",
5250
"customBuildProperties": "jjj,kkk",
5351
"additionalFiles": "",
5452
"compiler.optimization_flags": "lll",

0 commit comments

Comments
 (0)
Please sign in to comment.