diff --git a/arduino/cores/board.go b/arduino/cores/board.go index a59c6d31d16..3c839766bd8 100644 --- a/arduino/cores/board.go +++ b/arduino/cores/board.go @@ -125,6 +125,8 @@ func (b *Board) GetBuildProperties(userConfigs *properties.Map) (*properties.Map // Start with board's base properties buildProperties := b.Properties.Clone() + buildProperties.Set("build.fqbn", b.FQBN()) + buildProperties.Set("build.arch", strings.ToUpper(b.PlatformRelease.Platform.Architecture)) // Add all sub-configurations one by one (a config is: option=value) // Check for residual invalid options... diff --git a/arduino/cores/board_test.go b/arduino/cores/board_test.go index a0665e26c5f..95639bd8171 100644 --- a/arduino/cores/board_test.go +++ b/arduino/cores/board_test.go @@ -216,9 +216,11 @@ func TestBoardOptions(t *testing.T) { expConf2560.Set("bootloader.low_fuses", "0xFF") expConf2560.Set("bootloader.tool", "avrdude") expConf2560.Set("bootloader.unlock_bits", "0x3F") + expConf2560.Set("build.arch", "AVR") expConf2560.Set("build.board", "AVR_MEGA2560") expConf2560.Set("build.core", "arduino") expConf2560.Set("build.f_cpu", "16000000L") + expConf2560.Set("build.fqbn", "arduino:avr:mega") expConf2560.Set("build.mcu", "atmega2560") expConf2560.Set("build.variant", "mega") expConf2560.Set("menu.cpu.atmega1280", "ATmega1280") @@ -275,9 +277,11 @@ func TestBoardOptions(t *testing.T) { expConf1280.Set("bootloader.low_fuses", "0xFF") expConf1280.Set("bootloader.tool", "avrdude") expConf1280.Set("bootloader.unlock_bits", "0x3F") + expConf1280.Set("build.arch", "AVR") expConf1280.Set("build.board", "AVR_MEGA") expConf1280.Set("build.core", "arduino") expConf1280.Set("build.f_cpu", "16000000L") + expConf1280.Set("build.fqbn", "arduino:avr:mega") expConf1280.Set("build.mcu", "atmega1280") expConf1280.Set("build.variant", "mega") expConf1280.Set("menu.cpu.atmega1280", "ATmega1280") @@ -334,9 +338,11 @@ func TestBoardOptions(t *testing.T) { expWatterott.Set("bootloader.low_fuses", "0xE2") expWatterott.Set("bootloader.tool", "avrdude") expWatterott.Set("bootloader.unlock_bits", "0xFF") + expWatterott.Set("build.arch", "AVR") expWatterott.Set("build.board", "AVR_ATTINY841") expWatterott.Set("build.core", "tiny841") expWatterott.Set("build.f_cpu", "8000000L") + expWatterott.Set("build.fqbn", "watterott:avr:attiny841") expWatterott.Set("build.mcu", "attiny841") expWatterott.Set("build.variant", "tiny14") expWatterott.Set("menu.core.arduino", "Standard Arduino") diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index aa6886d9948..33301b3d986 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -336,8 +336,8 @@ func (release *PlatformRelease) RequiresToolRelease(toolRelease *ToolRelease) bo func (release *PlatformRelease) RuntimeProperties() *properties.Map { res := properties.NewMap() if release.InstallDir != nil { - res.Set("runtime.platform.path", release.InstallDir.String()) - res.Set("runtime.hardware.path", release.InstallDir.Join("..").String()) + res.SetPath("runtime.platform.path", release.InstallDir) + res.SetPath("runtime.hardware.path", release.InstallDir.Join("..")) } return res diff --git a/arduino/cores/packagemanager/package_manager.go b/arduino/cores/packagemanager/package_manager.go index 8cd630e87d8..df7dafb7842 100644 --- a/arduino/cores/packagemanager/package_manager.go +++ b/arduino/cores/packagemanager/package_manager.go @@ -18,9 +18,13 @@ package packagemanager import ( "fmt" "net/url" + "os" "path" + "path/filepath" + "strconv" "strings" "sync" + "time" "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/cores/packageindex" @@ -29,6 +33,7 @@ import ( "github.com/arduino/arduino-cli/i18n" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" + "github.com/arduino/go-timeutils" "github.com/sirupsen/logrus" semver "go.bug.st/relaxed-semver" ) @@ -275,50 +280,141 @@ func (pme *Explorer) ResolveFQBN(fqbn *cores.FQBN) ( return targetPackage, nil, nil, nil, nil, fmt.Errorf(tr("unknown platform %s:%s"), targetPackage, fqbn.PlatformArch) } - platformRelease := pme.GetInstalledPlatformRelease(platform) - if platformRelease == nil { + boardPlatformRelease := pme.GetInstalledPlatformRelease(platform) + if boardPlatformRelease == nil { return targetPackage, nil, nil, nil, nil, fmt.Errorf(tr("platform %s is not installed"), platform) } // Find board - board := platformRelease.Boards[fqbn.BoardID] + board := boardPlatformRelease.Boards[fqbn.BoardID] if board == nil { - return targetPackage, platformRelease, nil, nil, nil, + return targetPackage, boardPlatformRelease, nil, nil, nil, fmt.Errorf(tr("board %s not found"), fqbn.StringWithoutConfig()) } - buildProperties, err := board.GetBuildProperties(fqbn.Configs) + boardBuildProperties, err := board.GetBuildProperties(fqbn.Configs) if err != nil { - return targetPackage, platformRelease, board, nil, nil, + return targetPackage, boardPlatformRelease, board, nil, nil, fmt.Errorf(tr("getting build properties for board %[1]s: %[2]s"), board, err) } - // Determine the platform used for the build (in case the board refers + // Determine the platform used for the build and the variant (in case the board refers // to a core contained in another platform) - buildPlatformRelease := platformRelease - coreParts := strings.Split(buildProperties.Get("build.core"), ":") - if len(coreParts) > 1 { - referredPackage := coreParts[0] - buildPackage := pme.packages[referredPackage] - if buildPackage == nil { - return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf(tr("missing package %[1]s referenced by board %[2]s"), referredPackage, fqbn) + core, corePlatformRelease, variant, variantPlatformRelease, err := pme.determineReferencedPlatformRelease(boardBuildProperties, boardPlatformRelease, fqbn) + if err != nil { + return targetPackage, boardPlatformRelease, board, nil, nil, err + } + + // Create the build properties map by overlaying the properties of the + // referenced platform propeties, the board platform properties and the + // board specific properties. + buildProperties := properties.NewMap() + buildProperties.Merge(variantPlatformRelease.Properties) + buildProperties.Merge(corePlatformRelease.Properties) + buildProperties.Merge(boardPlatformRelease.Properties) + buildProperties.Merge(boardBuildProperties) + + // Add runtime build properties + buildProperties.Merge(boardPlatformRelease.RuntimeProperties()) + buildProperties.SetPath("build.core.path", corePlatformRelease.InstallDir.Join("cores", core)) + buildProperties.SetPath("build.system.path", corePlatformRelease.InstallDir.Join("system")) + buildProperties.Set("build.variant.path", "") + if variant != "" { + buildProperties.SetPath("build.variant.path", variantPlatformRelease.InstallDir.Join("variants", variant)) + } + + for _, tool := range pme.GetAllInstalledToolsReleases() { + buildProperties.Merge(tool.RuntimeProperties()) + } + requiredTools, err := pme.FindToolsRequiredForBuild(boardPlatformRelease, corePlatformRelease) + if err != nil { + return targetPackage, boardPlatformRelease, board, buildProperties, corePlatformRelease, err + } + for _, tool := range requiredTools { + buildProperties.Merge(tool.RuntimeProperties()) + } + now := time.Now() + buildProperties.Set("extra.time.utc", strconv.FormatInt(now.Unix(), 10)) + buildProperties.Set("extra.time.local", strconv.FormatInt(timeutils.LocalUnix(now), 10)) + buildProperties.Set("extra.time.zone", strconv.Itoa(timeutils.TimezoneOffsetNoDST(now))) + buildProperties.Set("extra.time.dst", strconv.Itoa(timeutils.DaylightSavingsOffset(now))) + + if !buildProperties.ContainsKey("runtime.ide.path") { + if ex, err := os.Executable(); err == nil { + buildProperties.Set("runtime.ide.path", filepath.Dir(ex)) + } else { + buildProperties.Set("runtime.ide.path", "") } - buildPlatform := buildPackage.Platforms[fqbn.PlatformArch] - if buildPlatform == nil { - return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf(tr("missing platform %[1]s:%[2]s referenced by board %[3]s"), referredPackage, fqbn.PlatformArch, fqbn) + } + buildProperties.Set("runtime.os", properties.GetOSSuffix()) + buildProperties.Set("build.library_discovery_phase", "0") + // Deprecated properties + buildProperties.Set("ide_version", "10607") + buildProperties.Set("runtime.ide.version", "10607") + if !buildProperties.ContainsKey("software") { + buildProperties.Set("software", "ARDUINO") + } + + buildProperties.Merge(pme.GetCustomGlobalProperties()) + + return targetPackage, boardPlatformRelease, board, buildProperties, corePlatformRelease, nil +} + +func (pme *Explorer) determineReferencedPlatformRelease(boardBuildProperties *properties.Map, boardPlatformRelease *cores.PlatformRelease, fqbn *cores.FQBN) (string, *cores.PlatformRelease, string, *cores.PlatformRelease, error) { + core := boardBuildProperties.Get("build.core") + referredCore := "" + if split := strings.Split(core, ":"); len(split) > 1 { + referredCore, core = split[0], split[1] + } + + variant := boardBuildProperties.Get("build.variant") + referredVariant := "" + if split := strings.Split(variant, ":"); len(split) > 1 { + referredVariant, variant = split[0], split[1] + } + + // core and variant cannot refer to two different platforms + if referredCore != "" && referredVariant != "" && referredCore != referredVariant { + return "", nil, "", nil, + fmt.Errorf(tr("'build.core' and 'build.variant' refer to different platforms: %[1]s and %[2]s"), referredCore+":"+core, referredVariant+":"+variant) + } + + // extract the referred platform + var referredPlatformRelease *cores.PlatformRelease + referredPackageName := referredCore + if referredPackageName == "" { + referredPackageName = referredVariant + } + if referredPackageName != "" { + referredPackage := pme.packages[referredPackageName] + if referredPackage == nil { + return "", nil, "", nil, + fmt.Errorf(tr("missing package %[1]s referenced by board %[2]s"), referredPackageName, fqbn) + } + referredPlatform := referredPackage.Platforms[fqbn.PlatformArch] + if referredPlatform == nil { + return "", nil, "", nil, + fmt.Errorf(tr("missing platform %[1]s:%[2]s referenced by board %[3]s"), referredPackageName, fqbn.PlatformArch, fqbn) } - buildPlatformRelease = pme.GetInstalledPlatformRelease(buildPlatform) - if buildPlatformRelease == nil { - return targetPackage, platformRelease, board, buildProperties, nil, - fmt.Errorf(tr("missing platform release %[1]s:%[2]s referenced by board %[3]s"), referredPackage, fqbn.PlatformArch, fqbn) + referredPlatformRelease = pme.GetInstalledPlatformRelease(referredPlatform) + if referredPlatformRelease == nil { + return "", nil, "", nil, + fmt.Errorf(tr("missing platform release %[1]s:%[2]s referenced by board %[3]s"), referredPackageName, fqbn.PlatformArch, fqbn) } } - // No errors... phew! - return targetPackage, platformRelease, board, buildProperties, buildPlatformRelease, nil + corePlatformRelease := boardPlatformRelease + if referredCore != "" { + corePlatformRelease = referredPlatformRelease + } + + variantPlatformRelease := boardPlatformRelease + if referredVariant != "" { + variantPlatformRelease = referredPlatformRelease + } + + return core, corePlatformRelease, variant, variantPlatformRelease, nil } // LoadPackageIndex loads a package index by looking up the local cached file from the specified URL diff --git a/arduino/cores/packagemanager/package_manager_test.go b/arduino/cores/packagemanager/package_manager_test.go index ef94087c6fc..32dc4d3a23c 100644 --- a/arduino/cores/packagemanager/package_manager_test.go +++ b/arduino/cores/packagemanager/package_manager_test.go @@ -141,7 +141,7 @@ func TestResolveFQBN(t *testing.T) { require.Equal(t, platformRelease.Platform.String(), "referenced:avr") require.NotNil(t, board) require.Equal(t, board.Name(), "Referenced dummy with invalid package") - require.NotNil(t, props) + require.Nil(t, props) require.Nil(t, buildPlatformRelease) // Test a board referenced from a non-existent platform/architecture @@ -156,7 +156,7 @@ func TestResolveFQBN(t *testing.T) { require.Equal(t, platformRelease.Platform.String(), "referenced:avr") require.NotNil(t, board) require.Equal(t, board.Name(), "Referenced dummy with invalid platform") - require.NotNil(t, props) + require.Nil(t, props) require.Nil(t, buildPlatformRelease) // Test a board referenced from a non-existent core diff --git a/commands/compile/compile.go b/commands/compile/compile.go index 664368e067c..55b90fc9004 100644 --- a/commands/compile/compile.go +++ b/commands/compile/compile.go @@ -174,9 +174,6 @@ func Compile(ctx context.Context, req *rpc.CompileRequest, outStream, errStream builderCtx.BuiltInLibrariesDirs = configuration.IDEBuiltinLibrariesDir(configuration.Settings) - // Will be deprecated. - builderCtx.ArduinoAPIVersion = "10607" - builderCtx.Stdout = outStream builderCtx.Stderr = errStream builderCtx.Clean = req.GetClean() diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 3168281fa03..b9c4f248656 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -292,20 +292,6 @@ func runProgramAction(pme *packagemanager.Explorer, uploadProperties.Merge(programmer.Properties) } - for _, tool := range pme.GetAllInstalledToolsReleases() { - uploadProperties.Merge(tool.RuntimeProperties()) - } - if requiredTools, err := pme.FindToolsRequiredForBuild(boardPlatform, buildPlatform); err == nil { - for _, requiredTool := range requiredTools { - logrus.WithField("tool", requiredTool).Info("Tool required for upload") - if requiredTool.IsInstalled() { - uploadProperties.Merge(requiredTool.RuntimeProperties()) - } else { - errStream.Write([]byte(tr("Warning: tool '%s' is not installed. It might not be available for your OS.", requiredTool))) - } - } - } - // Certain tools require the user to provide custom fields at run time, // if they've been provided set them // For more info: diff --git a/legacy/builder/builder.go b/legacy/builder/builder.go index 68ed660639e..75876ba4bb7 100644 --- a/legacy/builder/builder.go +++ b/legacy/builder/builder.go @@ -31,7 +31,6 @@ var tr = i18n.Tr const DEFAULT_DEBUG_LEVEL = 5 const DEFAULT_WARNINGS_LEVEL = "none" -const DEFAULT_SOFTWARE = "ARDUINO" type Builder struct{} diff --git a/legacy/builder/setup_build_properties.go b/legacy/builder/setup_build_properties.go index 917da83faf7..5b191dd8dff 100644 --- a/legacy/builder/setup_build_properties.go +++ b/legacy/builder/setup_build_properties.go @@ -16,30 +16,15 @@ package builder import ( - "os" - "path/filepath" - "strconv" - "strings" - "time" - - "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/legacy/builder/types" properties "github.com/arduino/go-properties-orderedmap" - timeutils "github.com/arduino/go-timeutils" "github.com/pkg/errors" ) type SetupBuildProperties struct{} func (s *SetupBuildProperties) Run(ctx *types.Context) error { - packages := ctx.Hardware - - targetPlatform := ctx.TargetPlatform - actualPlatform := ctx.ActualPlatform - buildProperties := properties.NewMap() - buildProperties.Merge(actualPlatform.Properties) - buildProperties.Merge(targetPlatform.Properties) buildProperties.Merge(ctx.TargetBoardBuildProperties) if ctx.BuildPath != nil { @@ -48,26 +33,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error { if ctx.Sketch != nil { buildProperties.Set("build.project_name", ctx.Sketch.MainFile.Base()) } - buildProperties.Set("build.arch", strings.ToUpper(targetPlatform.Platform.Architecture)) - - // get base folder and use it to populate BUILD_PROPERTIES_RUNTIME_IDE_PATH (arduino and arduino-builder live in the same dir) - ex, err := os.Executable() - exPath := "" - if err == nil { - exPath = filepath.Dir(ex) - } - - buildProperties.Set("build.core", ctx.BuildCore) - buildProperties.SetPath("build.core.path", actualPlatform.InstallDir.Join("cores", buildProperties.Get("build.core"))) - buildProperties.Set("build.system.path", actualPlatform.InstallDir.Join("system").String()) - buildProperties.Set("runtime.platform.path", targetPlatform.InstallDir.String()) - buildProperties.Set("runtime.hardware.path", targetPlatform.InstallDir.Join("..").String()) - buildProperties.Set("runtime.ide.version", ctx.ArduinoAPIVersion) - buildProperties.Set("runtime.ide.path", exPath) - buildProperties.Set("build.fqbn", ctx.FQBN.String()) - buildProperties.Set("ide_version", ctx.ArduinoAPIVersion) - buildProperties.Set("runtime.os", properties.GetOSSuffix()) - buildProperties.Set("build.library_discovery_phase", "0") if ctx.OptimizeForDebug { if buildProperties.ContainsKey("compiler.optimization_flags.debug") { @@ -80,51 +45,14 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error { } ctx.OptimizationFlags = buildProperties.Get("compiler.optimization_flags") - variant := buildProperties.Get("build.variant") - if variant == "" { - buildProperties.Set("build.variant.path", "") - } else { - var variantPlatformRelease *cores.PlatformRelease - variantParts := strings.Split(variant, ":") - if len(variantParts) > 1 { - variantPlatform := packages[variantParts[0]].Platforms[targetPlatform.Platform.Architecture] - variantPlatformRelease = ctx.PackageManager.GetInstalledPlatformRelease(variantPlatform) - variant = variantParts[1] - } else { - variantPlatformRelease = targetPlatform - } - buildProperties.SetPath("build.variant.path", variantPlatformRelease.InstallDir.Join("variants", variant)) - } - - for _, tool := range ctx.AllTools { - buildProperties.SetPath("runtime.tools."+tool.Tool.Name+".path", tool.InstallDir) - buildProperties.SetPath("runtime.tools."+tool.Tool.Name+"-"+tool.Version.String()+".path", tool.InstallDir) - } - for _, tool := range ctx.RequiredTools { - buildProperties.SetPath("runtime.tools."+tool.Tool.Name+".path", tool.InstallDir) - buildProperties.SetPath("runtime.tools."+tool.Tool.Name+"-"+tool.Version.String()+".path", tool.InstallDir) - } - - if !buildProperties.ContainsKey("software") { - buildProperties.Set("software", DEFAULT_SOFTWARE) - } - buildProperties.SetPath("build.source.path", ctx.Sketch.FullPath) - now := time.Now() - buildProperties.Set("extra.time.utc", strconv.FormatInt(now.Unix(), 10)) - buildProperties.Set("extra.time.local", strconv.FormatInt(timeutils.LocalUnix(now), 10)) - buildProperties.Set("extra.time.zone", strconv.Itoa(timeutils.TimezoneOffsetNoDST(now))) - buildProperties.Set("extra.time.dst", strconv.Itoa(timeutils.DaylightSavingsOffset(now))) - - buildProperties.Merge(ctx.PackageManager.GetCustomGlobalProperties()) - keychainProp := buildProperties.ContainsKey("build.keys.keychain") signProp := buildProperties.ContainsKey("build.keys.sign_key") encryptProp := buildProperties.ContainsKey("build.keys.encrypt_key") // we verify that all the properties for the secure boot keys are defined or none of them is defined. if (keychainProp || signProp || encryptProp) && !(keychainProp && signProp && encryptProp) { - return errors.Errorf("%s platform does not specify correctly default sign and encryption keys", targetPlatform.Platform) + return errors.Errorf("%s platform does not specify correctly default sign and encryption keys", ctx.TargetPlatform.Platform) } ctx.BuildProperties = buildProperties diff --git a/legacy/builder/target_board_resolver.go b/legacy/builder/target_board_resolver.go index 59d1361b557..c8d4f4a4b96 100644 --- a/legacy/builder/target_board_resolver.go +++ b/legacy/builder/target_board_resolver.go @@ -30,14 +30,13 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error { return fmt.Errorf("%s: %w", tr("Error resolving FQBN"), err) } - core := buildProperties.Get("build.core") - if core == "" { - core = "arduino" - } - // select the core name in case of "package:core" format - core = core[strings.Index(core, ":")+1:] - if ctx.Verbose { + core := buildProperties.Get("build.core") + if core == "" { + core = "arduino" + } + // select the core name in case of "package:core" format + core = core[strings.Index(core, ":")+1:] ctx.Info(tr("Using board '%[1]s' from platform in folder: %[2]s", targetBoard.BoardID, targetPlatform.InstallDir)) ctx.Info(tr("Using core '%[1]s' from platform in folder: %[2]s", core, buildPlatform.InstallDir)) } @@ -55,7 +54,6 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error { return err } - ctx.BuildCore = core ctx.TargetBoard = targetBoard ctx.TargetBoardBuildProperties = buildProperties ctx.TargetPlatform = targetPlatform diff --git a/legacy/builder/test/builder_test.go b/legacy/builder/test/builder_test.go index 16887bfc679..79da75775c0 100644 --- a/legacy/builder/test/builder_test.go +++ b/legacy/builder/test/builder_test.go @@ -41,7 +41,6 @@ func prepareBuilderTestContext(t *testing.T, sketchPath *paths.Path, fqbn string BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), - ArduinoAPIVersion: "10600", Verbose: false, } } diff --git a/legacy/builder/test/create_build_options_map_test.go b/legacy/builder/test/create_build_options_map_test.go index e3ba6ca71d6..ea62780ebe1 100644 --- a/legacy/builder/test/create_build_options_map_test.go +++ b/legacy/builder/test/create_build_options_map_test.go @@ -32,7 +32,6 @@ func TestCreateBuildOptionsMap(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: &sketch.Sketch{FullPath: paths.New("sketchLocation")}, FQBN: parseFQBN(t, "my:nice:fqbn"), - ArduinoAPIVersion: "ideVersion", Verbose: true, BuildPath: paths.New("buildPath"), OptimizationFlags: "-Os", @@ -50,7 +49,6 @@ func TestCreateBuildOptionsMap(t *testing.T) { "fqbn": "my:nice:fqbn", "hardwareFolders": "hardware,hardware2", "otherLibrariesFolders": "libraries", - "runtime.ide.version": "ideVersion", "sketchLocation": "sketchLocation" }`, ctx.BuildOptionsJson) } diff --git a/legacy/builder/test/ctags_runner_test.go b/legacy/builder/test/ctags_runner_test.go index 77d52f5c916..08b477e2911 100644 --- a/legacy/builder/test/ctags_runner_test.go +++ b/legacy/builder/test/ctags_runner_test.go @@ -38,7 +38,6 @@ func TestCTagsRunner(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -88,7 +87,6 @@ func TestCTagsRunnerSketchWithClass(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -136,7 +134,6 @@ func TestCTagsRunnerSketchWithTypename(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -183,7 +180,6 @@ func TestCTagsRunnerSketchWithNamespace(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -229,7 +225,6 @@ func TestCTagsRunnerSketchWithTemplates(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } diff --git a/legacy/builder/test/includes_to_include_folders_test.go b/legacy/builder/test/includes_to_include_folders_test.go index 0e8a513b740..e7deabaddb1 100644 --- a/legacy/builder/test/includes_to_include_folders_test.go +++ b/legacy/builder/test/includes_to_include_folders_test.go @@ -36,7 +36,6 @@ func TestIncludesToIncludeFolders(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("downloaded_libraries", "Bridge", "examples", "Bridge", "Bridge.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -72,7 +71,6 @@ func TestIncludesToIncludeFoldersSketchWithIfDef(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("SketchWithIfDef", "SketchWithIfDef.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -107,7 +105,6 @@ func TestIncludesToIncludeFoldersIRremoteLibrary(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch9", "sketch9.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -145,7 +142,6 @@ func TestIncludesToIncludeFoldersANewLibrary(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch10", "sketch10.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -179,7 +175,6 @@ func TestIncludesToIncludeFoldersDuplicateLibs(t *testing.T) { BuiltInLibrariesDirs: paths.New("downloaded_libraries"), Sketch: OpenSketch(t, paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino")), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -217,7 +212,6 @@ func TestIncludesToIncludeFoldersDuplicateLibsWithConflictingLibsOutsideOfPlatfo OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("user_hardware", "my_avr_platform", "avr", "libraries", "SPI", "examples", "BarometricPressureSensor", "BarometricPressureSensor.ino")), FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -255,7 +249,6 @@ func TestIncludesToIncludeFoldersDuplicateLibs2(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch_usbhost", "sketch_usbhost.ino")), FQBN: parseFQBN(t, "arduino:samd:arduino_zero_native"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -293,7 +286,6 @@ func TestIncludesToIncludeFoldersSubfolders(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch_with_subfolders", "sketch_with_subfolders.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } diff --git a/legacy/builder/test/load_vid_pid_specific_properties_test.go b/legacy/builder/test/load_vid_pid_specific_properties_test.go index b80f16b3d44..0152310605a 100644 --- a/legacy/builder/test/load_vid_pid_specific_properties_test.go +++ b/legacy/builder/test/load_vid_pid_specific_properties_test.go @@ -29,11 +29,10 @@ func TestLoadVIDPIDSpecificPropertiesWhenNoVIDPIDAreProvided(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "arduino:avr:micro"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "arduino:avr:micro"), } buildPath := SetupBuildPath(t, ctx) @@ -59,11 +58,10 @@ func TestLoadVIDPIDSpecificProperties(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "arduino:avr:micro"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "./tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "arduino:avr:micro"), } buildPath := SetupBuildPath(t, ctx) diff --git a/legacy/builder/test/merge_sketch_with_bootloader_test.go b/legacy/builder/test/merge_sketch_with_bootloader_test.go index fcce8942ad0..47c1b4d545c 100644 --- a/legacy/builder/test/merge_sketch_with_bootloader_test.go +++ b/legacy/builder/test/merge_sketch_with_bootloader_test.go @@ -38,7 +38,6 @@ func TestMergeSketchWithBootloader(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", } buildPath := SetupBuildPath(t, ctx) @@ -108,7 +107,6 @@ func TestMergeSketchWithBootloaderSketchInBuildPath(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", } buildPath := SetupBuildPath(t, ctx) @@ -179,7 +177,6 @@ func TestMergeSketchWithBootloaderWhenNoBootloaderAvailable(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", } buildPath := SetupBuildPath(t, ctx) @@ -217,7 +214,6 @@ func TestMergeSketchWithBootloaderPathIsParameterized(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), FQBN: parseFQBN(t, "my_avr_platform:avr:mymega:cpu=atmega2560"), - ArduinoAPIVersion: "10600", } buildPath := SetupBuildPath(t, ctx) diff --git a/legacy/builder/test/prototypes_adder_test.go b/legacy/builder/test/prototypes_adder_test.go index 871536def19..159beb3923e 100644 --- a/legacy/builder/test/prototypes_adder_test.go +++ b/legacy/builder/test/prototypes_adder_test.go @@ -41,7 +41,6 @@ func TestPrototypesAdderBridgeExample(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -81,7 +80,6 @@ func TestPrototypesAdderSketchWithIfDef(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("SketchWithIfDef", "SketchWithIfDef.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -121,7 +119,6 @@ func TestPrototypesAdderBaladuino(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("Baladuino", "Baladuino.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -161,7 +158,6 @@ func TestPrototypesAdderCharWithEscapedDoubleQuote(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("CharWithEscapedDoubleQuote", "CharWithEscapedDoubleQuote.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -201,7 +197,6 @@ func TestPrototypesAdderIncludeBetweenMultilineComment(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("IncludeBetweenMultilineComment", "IncludeBetweenMultilineComment.ino")), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -241,7 +236,6 @@ func TestPrototypesAdderLineContinuations(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("LineContinuations", "LineContinuations.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -281,7 +275,6 @@ func TestPrototypesAdderStringWithComment(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("StringWithComment", "StringWithComment.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -321,7 +314,6 @@ func TestPrototypesAdderSketchWithStruct(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("SketchWithStruct", "SketchWithStruct.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -369,7 +361,6 @@ func TestPrototypesAdderSketchWithConfig(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -415,7 +406,6 @@ func TestPrototypesAdderSketchNoFunctionsTwoFiles(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch_no_functions_two_files", "sketch_no_functions_two_files.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -455,7 +445,6 @@ func TestPrototypesAdderSketchNoFunctions(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("sketch_no_functions", "sketch_no_functions.ino")), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -501,7 +490,6 @@ func TestPrototypesAdderSketchWithDefaultArgs(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -544,7 +532,6 @@ func TestPrototypesAdderSketchWithInlineFunction(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -598,7 +585,6 @@ func TestPrototypesAdderSketchWithFunctionSignatureInsideIFDEF(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -641,7 +627,6 @@ func TestPrototypesAdderSketchWithUSBCON(t *testing.T) { BuiltInLibrariesDirs: paths.New("downloaded_libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -683,7 +668,6 @@ func TestPrototypesAdderSketchWithTypename(t *testing.T) { BuiltInToolsDirs: paths.NewPathList("downloaded_tools"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -732,7 +716,6 @@ func TestPrototypesAdderSketchWithIfDef2(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:yun"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -778,7 +761,6 @@ func TestPrototypesAdderSketchWithIfDef2SAM(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:sam:arduino_due_x_dbg"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -824,7 +806,6 @@ func TestPrototypesAdderSketchWithConst(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -864,7 +845,6 @@ func TestPrototypesAdderSketchWithDosEol(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, paths.New("eol_processing", "eol_processing.ino")), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", Verbose: true, } @@ -904,7 +884,6 @@ func TestPrototypesAdderSketchWithSubstringFunctionMember(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: OpenSketch(t, sketchLocation), FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", Verbose: true, } diff --git a/legacy/builder/test/setup_build_properties_test.go b/legacy/builder/test/setup_build_properties_test.go index 815d78c0398..f59847d81ff 100644 --- a/legacy/builder/test/setup_build_properties_test.go +++ b/legacy/builder/test/setup_build_properties_test.go @@ -29,11 +29,10 @@ func TestSetupBuildProperties(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "arduino:avr:uno"), } buildPath := SetupBuildPath(t, ctx) @@ -63,7 +62,7 @@ func TestSetupBuildProperties(t *testing.T) { requireEquivalentPaths(t, buildProperties.Get("runtime.platform.path"), "downloaded_hardware/arduino/avr") requireEquivalentPaths(t, buildProperties.Get("runtime.hardware.path"), "downloaded_hardware/arduino") - require.Equal(t, "10600", buildProperties.Get("runtime.ide.version")) + require.Equal(t, "10607", buildProperties.Get("runtime.ide.version")) require.NotEmpty(t, buildProperties.Get("runtime.os")) requireEquivalentPaths(t, buildProperties.Get("runtime.tools.arm-none-eabi-gcc.path"), "downloaded_tools/arm-none-eabi-gcc/4.8.3-2014q1") @@ -93,11 +92,10 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "arduino:avr:uno"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "arduino:avr:uno"), CustomBuildProperties: []string{"name=fake name", "tools.avrdude.config.path=non existent path with space and a ="}, } @@ -132,11 +130,10 @@ func TestSetupBuildPropertiesUserHardware(t *testing.T) { DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), } buildPath := SetupBuildPath(t, ctx) @@ -168,11 +165,10 @@ func TestSetupBuildPropertiesWithMissingPropsFromParentPlatformTxtFiles(t *testi DownloadCoresAndToolsAndLibraries(t) ctx := &types.Context{ - HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), - BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), - Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), - FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), - ArduinoAPIVersion: "10600", + HardwareDirs: paths.NewPathList(filepath.Join("..", "hardware"), "downloaded_hardware", "user_hardware"), + BuiltInToolsDirs: paths.NewPathList("downloaded_tools", "tools_builtin"), + Sketch: OpenSketch(t, paths.New("sketch1", "sketch1.ino")), + FQBN: parseFQBN(t, "my_avr_platform:avr:custom_yun"), } buildPath := SetupBuildPath(t, ctx) @@ -199,7 +195,7 @@ func TestSetupBuildPropertiesWithMissingPropsFromParentPlatformTxtFiles(t *testi requireEquivalentPaths(t, buildProperties.Get("runtime.platform.path"), "user_hardware/my_avr_platform/avr") requireEquivalentPaths(t, buildProperties.Get("runtime.hardware.path"), "user_hardware/my_avr_platform") - require.Equal(t, "10600", buildProperties.Get("runtime.ide.version")) + require.Equal(t, "10607", buildProperties.Get("runtime.ide.version")) require.NotEmpty(t, buildProperties.Get("runtime.os")) requireEquivalentPaths(t, buildProperties.Get("runtime.tools.arm-none-eabi-gcc.path"), "downloaded_tools/arm-none-eabi-gcc/4.8.3-2014q1") diff --git a/legacy/builder/test/store_build_options_map_test.go b/legacy/builder/test/store_build_options_map_test.go index 24f757708a0..aeee52e5154 100644 --- a/legacy/builder/test/store_build_options_map_test.go +++ b/legacy/builder/test/store_build_options_map_test.go @@ -34,7 +34,6 @@ func TestStoreBuildOptionsMap(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("libraries"), Sketch: &sketch.Sketch{FullPath: paths.New("sketchLocation")}, FQBN: parseFQBN(t, "my:nice:fqbn"), - ArduinoAPIVersion: "ideVersion", CustomBuildProperties: []string{"custom=prop"}, Verbose: true, OptimizationFlags: "-Os", @@ -69,7 +68,6 @@ func TestStoreBuildOptionsMap(t *testing.T) { "fqbn": "my:nice:fqbn", "hardwareFolders": "hardware", "otherLibrariesFolders": "libraries", - "runtime.ide.version": "ideVersion", "sketchLocation": "sketchLocation" }`, string(bytes)) } diff --git a/legacy/builder/test/target_board_resolver_test.go b/legacy/builder/test/target_board_resolver_test.go index db344a38448..2ce650f081d 100644 --- a/legacy/builder/test/target_board_resolver_test.go +++ b/legacy/builder/test/target_board_resolver_test.go @@ -180,7 +180,7 @@ func TestTargetBoardResolverCustomCore(t *testing.T) { require.Equal(t, "avr", targetPlatform.Platform.Architecture) targetBoard := ctx.TargetBoard require.Equal(t, "attiny841", targetBoard.BoardID) - require.Equal(t, "tiny841", ctx.BuildCore) + require.Equal(t, "tiny841", ctx.TargetBoardBuildProperties.Get("build.core")) targetBoardBuildProperties := ctx.TargetBoardBuildProperties require.Equal(t, "tiny14", targetBoardBuildProperties.Get("build.variant")) } diff --git a/legacy/builder/test/try_build_of_problematic_sketch_test.go b/legacy/builder/test/try_build_of_problematic_sketch_test.go index 3227d3fa381..c8b61a3db74 100644 --- a/legacy/builder/test/try_build_of_problematic_sketch_test.go +++ b/legacy/builder/test/try_build_of_problematic_sketch_test.go @@ -213,7 +213,6 @@ func makeDefaultContext(t *testing.T) *types.Context { BuiltInLibrariesDirs: paths.New("downloaded_libraries"), OtherLibrariesDirs: paths.NewPathList("libraries"), FQBN: parseFQBN(t, "arduino:avr:leonardo"), - ArduinoAPIVersion: "10607", Verbose: true, DebugPreprocessor: true, } diff --git a/legacy/builder/types/context.go b/legacy/builder/types/context.go index 3286416fbb8..569d53e4d29 100644 --- a/legacy/builder/types/context.go +++ b/legacy/builder/types/context.go @@ -71,7 +71,6 @@ type Context struct { OtherLibrariesDirs paths.PathList LibraryDirs paths.PathList // List of paths pointing to individual library root folders WatchedLocations paths.PathList - ArduinoAPIVersion string FQBN *cores.FQBN CodeCompleteAt string Clean bool @@ -95,7 +94,6 @@ type Context struct { HardwareRewriteResults map[*cores.PlatformRelease][]PlatforKeyRewrite BuildProperties *properties.Map - BuildCore string BuildPath *paths.Path SketchBuildPath *paths.Path CoreBuildPath *paths.Path @@ -220,7 +218,6 @@ func (ctx *Context) ExtractBuildOptions() *properties.Map { additionalFilesRelative = append(additionalFilesRelative, relPath.String()) } opts.Set("fqbn", ctx.FQBN.String()) - opts.Set("runtime.ide.version", ctx.ArduinoAPIVersion) opts.Set("customBuildProperties", strings.Join(ctx.CustomBuildProperties, ",")) opts.Set("additionalFiles", strings.Join(additionalFilesRelative, ",")) opts.Set("compiler.optimization_flags", ctx.OptimizationFlags) diff --git a/legacy/builder/types/context_test.go b/legacy/builder/types/context_test.go index 55af78c506c..33339cbb9e1 100644 --- a/legacy/builder/types/context_test.go +++ b/legacy/builder/types/context_test.go @@ -36,7 +36,6 @@ func TestInjectBuildOption(t *testing.T) { OtherLibrariesDirs: paths.NewPathList("fff", "ggg"), Sketch: &sketch.Sketch{FullPath: paths.New("hhh")}, FQBN: fqbn, - ArduinoAPIVersion: "iii", CustomBuildProperties: []string{"jjj", "kkk"}, OptimizationFlags: "lll", } @@ -48,7 +47,6 @@ func TestInjectBuildOption(t *testing.T) { "otherLibrariesFolders": "fff,ggg", "sketchLocation": "hhh", "fqbn": "aaa:bbb:ccc", - "runtime.ide.version": "iii", "customBuildProperties": "jjj,kkk", "additionalFiles": "", "compiler.optimization_flags": "lll",