Skip to content

Commit 053c260

Browse files
committed
Removed useless state variable 'BuildCore'
1 parent b5111cc commit 053c260

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

legacy/builder/setup_build_properties.go

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ func (s *SetupBuildProperties) Run(ctx *types.Context) error {
4949
exPath = filepath.Dir(ex)
5050
}
5151

52-
buildProperties.Set("build.core", ctx.BuildCore)
5352
buildProperties.Set("runtime.ide.version", ctx.ArduinoAPIVersion)
5453
buildProperties.Set("runtime.ide.path", exPath)
5554
buildProperties.Set("ide_version", ctx.ArduinoAPIVersion)

legacy/builder/target_board_resolver.go

+6-8
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error {
3030
return fmt.Errorf("%s: %w", tr("Error resolving FQBN"), err)
3131
}
3232

33-
core := buildProperties.Get("build.core")
34-
if core == "" {
35-
core = "arduino"
36-
}
37-
// select the core name in case of "package:core" format
38-
core = core[strings.Index(core, ":")+1:]
39-
4033
if ctx.Verbose {
34+
core := buildProperties.Get("build.core")
35+
if core == "" {
36+
core = "arduino"
37+
}
38+
// select the core name in case of "package:core" format
39+
core = core[strings.Index(core, ":")+1:]
4140
ctx.Info(tr("Using board '%[1]s' from platform in folder: %[2]s", targetBoard.BoardID, targetPlatform.InstallDir))
4241
ctx.Info(tr("Using core '%[1]s' from platform in folder: %[2]s", core, buildPlatform.InstallDir))
4342
}
@@ -55,7 +54,6 @@ func (s *TargetBoardResolver) Run(ctx *types.Context) error {
5554
return err
5655
}
5756

58-
ctx.BuildCore = core
5957
ctx.TargetBoard = targetBoard
6058
ctx.TargetBoardBuildProperties = buildProperties
6159
ctx.TargetPlatform = targetPlatform

legacy/builder/test/target_board_resolver_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func TestTargetBoardResolverCustomCore(t *testing.T) {
180180
require.Equal(t, "avr", targetPlatform.Platform.Architecture)
181181
targetBoard := ctx.TargetBoard
182182
require.Equal(t, "attiny841", targetBoard.BoardID)
183-
require.Equal(t, "tiny841", ctx.BuildCore)
183+
require.Equal(t, "tiny841", ctx.TargetBoardBuildProperties.Get("build.core"))
184184
targetBoardBuildProperties := ctx.TargetBoardBuildProperties
185185
require.Equal(t, "tiny14", targetBoardBuildProperties.Get("build.variant"))
186186
}

legacy/builder/types/context.go

-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ type Context struct {
9595
HardwareRewriteResults map[*cores.PlatformRelease][]PlatforKeyRewrite
9696

9797
BuildProperties *properties.Map
98-
BuildCore string
9998
BuildPath *paths.Path
10099
SketchBuildPath *paths.Path
101100
CoreBuildPath *paths.Path

0 commit comments

Comments
 (0)