Skip to content

Implemented --show-properties in board details command #2151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 19, 2023
Prev Previous commit
Next Next commit
Removed legacy HardwareLoader
  • Loading branch information
cmaglie committed Apr 15, 2023
commit 0616fae6cd383a95198e256bdc6ab3ecb583a16b
1 change: 0 additions & 1 deletion legacy/builder/container_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (s *ContainerSetupHardwareToolsLibsSketchAndProps) Run(ctx *types.Context)
commands := []types.Command{
&AddAdditionalEntriesToContext{},
&FailIfBuildPathEqualsSketchPath{},
&HardwareLoader{},
&LibrariesLoader{},
}

Expand Down
28 changes: 0 additions & 28 deletions legacy/builder/hardware_loader.go

This file was deleted.

33 changes: 4 additions & 29 deletions legacy/builder/test/hardware_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,7 @@ func TestLoadHardware(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

commands := []types.Command{
&builder.HardwareLoader{},
}
for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

packages := ctx.Hardware
packages := ctx.PackageManager.GetPackages()
require.Equal(t, 1, len(packages))
require.NotNil(t, packages["arduino"])
require.Equal(t, 2, len(packages["arduino"].Platforms))
Expand Down Expand Up @@ -77,14 +69,13 @@ func TestLoadHardwareMixingUserHardwareFolder(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
}
for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

packages := ctx.Hardware
packages := ctx.PackageManager.GetPackages()

if runtime.GOOS == "windows" {
//a package is a symlink, and windows does not support them
Expand Down Expand Up @@ -143,15 +134,7 @@ func TestLoadHardwareWithBoardManagerFolderStructure(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

commands := []types.Command{
&builder.HardwareLoader{},
}
for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

packages := ctx.Hardware
packages := ctx.PackageManager.GetPackages()
require.Equal(t, 3, len(packages))
require.NotNil(t, packages["arduino"])
require.Equal(t, 1, len(packages["arduino"].Platforms))
Expand Down Expand Up @@ -191,15 +174,7 @@ func TestLoadLotsOfHardware(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

commands := []types.Command{
&builder.HardwareLoader{},
}
for _, command := range commands {
err := command.Run(ctx)
NoError(t, err)
}

packages := ctx.Hardware
packages := ctx.PackageManager.GetPackages()

if runtime.GOOS == "windows" {
//a package is a symlink, and windows does not support them
Expand Down
3 changes: 0 additions & 3 deletions legacy/builder/test/libraries_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ func TestLoadLibrariesAVR(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.LibrariesLoader{},
}
for _, command := range commands {
Expand Down Expand Up @@ -154,7 +153,6 @@ func TestLoadLibrariesSAM(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.LibrariesLoader{},
}
for _, command := range commands {
Expand Down Expand Up @@ -257,7 +255,6 @@ func TestLoadLibrariesMyAVRPlatform(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.LibrariesLoader{},
}
for _, command := range commands {
Expand Down
3 changes: 0 additions & 3 deletions legacy/builder/test/setup_build_properties_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ func TestSetupBuildProperties(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.SetupBuildProperties{},
}
for _, command := range commands {
Expand Down Expand Up @@ -95,7 +94,6 @@ func TestSetupBuildPropertiesWithSomeCustomOverrides(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.SetupBuildProperties{},
&builder.SetCustomBuildProperties{},
}
Expand Down Expand Up @@ -126,7 +124,6 @@ func TestSetupBuildPropertiesUserHardware(t *testing.T) {

commands := []types.Command{
&builder.AddAdditionalEntriesToContext{},
&builder.HardwareLoader{},
&builder.SetupBuildProperties{},
}
for _, command := range commands {
Expand Down
17 changes: 4 additions & 13 deletions legacy/builder/test/tools_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
"github.com/arduino/arduino-cli/legacy/builder"
"github.com/arduino/arduino-cli/legacy/builder/types"
paths "github.com/arduino/go-paths-helper"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -67,9 +66,7 @@ func TestLoadTools(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

NoError(t, (&builder.HardwareLoader{}).Run(ctx))

tools := ctx.AllTools
tools := ctx.PackageManager.GetAllInstalledToolsReleases()
require.Equal(t, 9, len(tools))

sort.Sort(ByToolIDAndVersion(tools))
Expand Down Expand Up @@ -109,9 +106,7 @@ func TestLoadToolsWithBoardManagerFolderStructure(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

NoError(t, (&builder.HardwareLoader{}).Run(ctx))

tools := ctx.AllTools
tools := ctx.PackageManager.GetAllInstalledToolsReleases()
require.Equal(t, 3, len(tools))

sort.Sort(ByToolIDAndVersion(tools))
Expand All @@ -134,9 +129,7 @@ func TestLoadLotsOfTools(t *testing.T) {
}
ctx = prepareBuilderTestContext(t, ctx, nil, "")

NoError(t, (&builder.HardwareLoader{}).Run(ctx))

tools := ctx.AllTools
tools := ctx.PackageManager.GetAllInstalledToolsReleases()
require.Equal(t, 12, len(tools))

sort.Sort(ByToolIDAndVersion(tools))
Expand Down Expand Up @@ -191,7 +184,5 @@ func TestAllToolsContextIsPopulated(t *testing.T) {
PackageManager: pme,
}

hl := &builder.HardwareLoader{}
require.NoError(t, hl.Run(ctx))
require.NotEmpty(t, ctx.AllTools)
require.NotEmpty(t, ctx.PackageManager.GetAllInstalledToolsReleases())
}
2 changes: 0 additions & 2 deletions legacy/builder/types/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ type Context struct {
BuildOptionsJsonPrevious string

PackageManager *packagemanager.Explorer
Hardware cores.Packages
AllTools []*cores.ToolRelease
RequiredTools []*cores.ToolRelease
TargetBoard *cores.Board
TargetBoardBuildProperties *properties.Map
Expand Down