From ad5dacca220162cd5dd736ef89d341f9b82137a0 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Mon, 23 Oct 2023 17:09:22 +0200 Subject: [PATCH] [breaking] Updated gRPC Platform API (#2357) * Updated gRPC Pltform API, regenerated API * Adapted cores.Platform and PlatformRelease to the new gRPC API * Fixed search_test.go * Removed gRPC PlatformList command * Other adaptation of platform structures * Adapt arguuments completion to use PlatformSearch instead of PlatformList * Adapt 'core list' to use PlatformSearch instead of PlatformList * Adapt 'core upgrade' command to use PlatformSearch instead of PlatformList * Adapted some integration tests * Fix integreation test * apply changes to search vidpid * Better handling of 'core list' results * Better handling of 'core search' results * Better handling of 'core outdated' results * add 'orderedmap' data structure * Made orderedmap more generic * fix regression on 'ParseReference' * wip: fix 'core' integrationtests * wip: fix 'core' sorting tests * fix regression which skipped mannually instaled core in core list * wip: add more 'core' integration tests * regression: all flag takes precedence above updatable in core list * lint: ignore unexported-return (revive) * license: regenerate and add missin headers * tests: fix 'board' integrations * fix: regression not showing manually installed platform in 'core list' * wip: add test to orderedmap * add more orderdmap tests * orderdmap: add json tests * update DOCS * apply CR suggestions * fix proto numeration * docs: update to release 0.36.0 --------- Co-authored-by: Alessio Perugini --- .golangci.yml | 1 - arduino/cores/cores.go | 12 +- arduino/cores/packageindex/index.go | 20 +- arduino/cores/packageindex/index_test.go | 5 +- arduino/cores/packagemanager/loader.go | 6 +- .../cores/packagemanager/package_manager.go | 6 +- arduino/cores/packagemanager/profiles.go | 2 +- client_example/main.go | 24 +- commands/board/details.go | 30 +- commands/board/list.go | 6 +- commands/board/listall.go | 22 +- commands/board/search.go | 48 +- commands/core.go | 42 +- commands/core/list.go | 90 --- commands/core/search.go | 77 ++- commands/core/search_test.go | 571 +++++++++--------- commands/core/upgrade.go | 6 +- commands/daemon/daemon.go | 6 - docs/UPGRADING.md | 167 ++++- internal/cli/arguments/completion.go | 18 +- internal/cli/arguments/reference.go | 16 +- internal/cli/board/search.go | 2 +- internal/cli/core/list.go | 67 +- internal/cli/core/search.go | 26 +- internal/cli/core/upgrade.go | 31 +- internal/cli/feedback/result/rpc.go | 121 ++++ internal/cli/outdated/outdated.go | 21 +- internal/integrationtest/arduino-cli.go | 14 +- .../board/hardware_loading_test.go | 82 +-- internal/integrationtest/core/core_test.go | 126 ++-- .../integrationtest/daemon/daemon_test.go | 19 +- internal/orderedmap/orderedmap.go | 184 ++++++ internal/orderedmap/orderedmap_test.go | 361 +++++++++++ rpc/cc/arduino/cli/commands/v1/commands.pb.go | 419 +++++++------ rpc/cc/arduino/cli/commands/v1/commands.proto | 3 - .../cli/commands/v1/commands_grpc.pb.go | 39 -- rpc/cc/arduino/cli/commands/v1/common.go | 42 ++ rpc/cc/arduino/cli/commands/v1/common.pb.go | 554 ++++++++++++----- rpc/cc/arduino/cli/commands/v1/common.proto | 81 ++- rpc/cc/arduino/cli/commands/v1/core.pb.go | 255 ++------ rpc/cc/arduino/cli/commands/v1/core.proto | 22 +- 41 files changed, 2329 insertions(+), 1315 deletions(-) delete mode 100644 commands/core/list.go create mode 100644 internal/cli/feedback/result/rpc.go create mode 100644 internal/orderedmap/orderedmap.go create mode 100644 internal/orderedmap/orderedmap_test.go diff --git a/.golangci.yml b/.golangci.yml index 7e9f18d1482..36b59fa925b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,7 +62,6 @@ linters-settings: - name: redefines-builtin-id - name: superfluous-else - name: time-naming - - name: unexported-return - name: unreachable-code - name: var-declaration - name: defer diff --git a/arduino/cores/cores.go b/arduino/cores/cores.go index 19ba9eeaf76..0c836c20f8d 100644 --- a/arduino/cores/cores.go +++ b/arduino/cores/cores.go @@ -37,14 +37,13 @@ import ( // Platform represents a platform package. type Platform struct { - Architecture string // The name of the architecture of this package. - Name string - Category string + Architecture string // The name of the architecture of this package. Releases map[semver.NormalizedString]*PlatformRelease // The Releases of this platform, labeled by version. Package *Package `json:"-"` ManuallyInstalled bool // true if the Platform has been installed without the CLI - Deprecated bool // true if the Platform has been deprecated + Deprecated bool // true if the latest PlatformRelease of this Platform has been deprecated Indexed bool // true if the Platform has been indexed from additional-urls + Latest *semver.Version `json:"-"` } // PlatformReleaseHelp represents the help URL for this Platform release @@ -54,12 +53,15 @@ type PlatformReleaseHelp struct { // PlatformRelease represents a release of a plaform package. type PlatformRelease struct { + Name string + Category string Resource *resources.DownloadResource Version *semver.Version BoardsManifest []*BoardManifest ToolDependencies ToolDependencies DiscoveryDependencies DiscoveryDependencies MonitorDependencies MonitorDependencies + Deprecated bool Help PlatformReleaseHelp `json:"-"` Platform *Platform `json:"-"` Properties *properties.Map `json:"-"` @@ -407,7 +409,7 @@ func (release *PlatformRelease) MarshalJSON() ([]byte, error) { ID: release.Platform.String(), Installed: release.Version.String(), Latest: latestStr, - Name: release.Platform.Name, + Name: release.Name, }) } diff --git a/arduino/cores/packageindex/index.go b/arduino/cores/packageindex/index.go index 61621ed4cca..a54776f3bba 100644 --- a/arduino/cores/packageindex/index.go +++ b/arduino/cores/packageindex/index.go @@ -222,11 +222,11 @@ func IndexFromPlatformRelease(pr *cores.PlatformRelease) Index { URL: pr.Platform.Package.URL, Email: pr.Platform.Package.Email, Platforms: []*indexPlatformRelease{{ - Name: pr.Platform.Name, + Name: pr.Name, Architecture: pr.Platform.Architecture, Version: pr.Version, - Deprecated: pr.Platform.Deprecated, - Category: pr.Platform.Category, + Deprecated: pr.Deprecated, + Category: pr.Category, URL: pr.Resource.URL, ArchiveFileName: pr.Resource.ArchiveFileName, Checksum: pr.Resource.Checksum, @@ -263,18 +263,13 @@ func (inPackage indexPackage) extractPackageIn(outPackages cores.Packages, trust func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *cores.Package, trusted bool, isInstallJSON bool) error { outPlatform := outPackage.GetOrCreatePlatform(inPlatformRelease.Architecture) - // FIXME: shall we use the Name and Category of the latest release? or maybe move Name and Category in PlatformRelease? - outPlatform.Name = inPlatformRelease.Name - outPlatform.Category = inPlatformRelease.Category // If the variable `isInstallJSON` is false it means that the index we're reading is coming from the additional-urls. // Therefore, the `outPlatform.Indexed` will be set at `true`. outPlatform.Indexed = outPlatform.Indexed || !isInstallJSON - // If the Platform is installed before deprecation installed.json file does not include "deprecated" field. - // The installed.json is read during loading phase of an installed Platform, if the deprecated field is not found - // the package_index.json field would be overwritten and the deprecation info would be lost. - // This check prevents that behaviour. - if !outPlatform.Deprecated { + // If the latest platform release is deprecated, then deprecate the whole platform. + if outPlatform.Latest == nil || outPlatform.Latest.LessThan(inPlatformRelease.Version) { + outPlatform.Latest = inPlatformRelease.Version outPlatform.Deprecated = inPlatformRelease.Deprecated } @@ -283,6 +278,8 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core return fmt.Errorf(tr("invalid platform archive size: %s"), err) } outPlatformRelease := outPlatform.GetOrCreateRelease(inPlatformRelease.Version) + outPlatformRelease.Name = inPlatformRelease.Name + outPlatformRelease.Category = inPlatformRelease.Category outPlatformRelease.IsTrusted = trusted outPlatformRelease.Resource = &resources.DownloadResource{ ArchiveFileName: inPlatformRelease.ArchiveFileName, @@ -296,6 +293,7 @@ func (inPlatformRelease indexPlatformRelease) extractPlatformIn(outPackage *core outPlatformRelease.ToolDependencies = inPlatformRelease.extractToolDependencies() outPlatformRelease.DiscoveryDependencies = inPlatformRelease.extractDiscoveryDependencies() outPlatformRelease.MonitorDependencies = inPlatformRelease.extractMonitorDependencies() + outPlatformRelease.Deprecated = inPlatformRelease.Deprecated return nil } diff --git a/arduino/cores/packageindex/index_test.go b/arduino/cores/packageindex/index_test.go index efb05c16aa0..8a2d5474693 100644 --- a/arduino/cores/packageindex/index_test.go +++ b/arduino/cores/packageindex/index_test.go @@ -91,11 +91,10 @@ func TestIndexFromPlatformRelease(t *testing.T) { Name: "serial-monitor", }, }, + Name: "Arduino AVR Boards", + Category: "Arduino", Platform: &cores.Platform{ - Name: "Arduino AVR Boards", Architecture: "avr", - Category: "Arduino", - Package: &cores.Package{ Name: "arduino", Maintainer: "Arduino", diff --git a/arduino/cores/packagemanager/loader.go b/arduino/cores/packagemanager/loader.go index 2644a9f22e2..8d5cfe76da0 100644 --- a/arduino/cores/packagemanager/loader.go +++ b/arduino/cores/packagemanager/loader.go @@ -323,14 +323,14 @@ func (pm *Builder) loadPlatformRelease(platform *cores.PlatformRelease, path *pa platform.Properties.Set("pluggable_monitor.required.serial", "builtin:serial-monitor") } - if platform.Platform.Name == "" { + if platform.Name == "" { if name, ok := platform.Properties.GetOk("name"); ok { - platform.Platform.Name = name + platform.Name = name } else { // If the platform.txt file doesn't exist for this platform and it's not in any // package index there is no way of retrieving its name, so we build one using // the available information, that is the packager name and the architecture. - platform.Platform.Name = fmt.Sprintf("%s-%s", platform.Platform.Package.Name, platform.Platform.Architecture) + platform.Name = fmt.Sprintf("%s-%s", platform.Platform.Package.Name, platform.Platform.Architecture) } } diff --git a/arduino/cores/packagemanager/package_manager.go b/arduino/cores/packagemanager/package_manager.go index 7773b407109..1d6ac17aac0 100644 --- a/arduino/cores/packagemanager/package_manager.go +++ b/arduino/cores/packagemanager/package_manager.go @@ -192,8 +192,8 @@ func (pme *Explorer) GetCustomGlobalProperties() *properties.Map { } // FindPlatformReleaseProvidingBoardsWithVidPid FIXMEDOC -func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.PlatformRelease { - res := []*cores.PlatformRelease{} +func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid string) []*cores.Platform { + res := []*cores.Platform{} for _, targetPackage := range pme.packages { for _, targetPlatform := range targetPackage.Platforms { platformRelease := targetPlatform.GetLatestRelease() @@ -202,7 +202,7 @@ func (pme *Explorer) FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid strin } for _, boardManifest := range platformRelease.BoardsManifest { if boardManifest.HasUsbID(vid, pid) { - res = append(res, platformRelease) + res = append(res, targetPlatform) break } } diff --git a/arduino/cores/packagemanager/profiles.go b/arduino/cores/packagemanager/profiles.go index 423bfdaeffa..a8f12789521 100644 --- a/arduino/cores/packagemanager/profiles.go +++ b/arduino/cores/packagemanager/profiles.go @@ -45,7 +45,7 @@ func (pmb *Builder) LoadHardwareForProfile(p *sketch.Profile, installMissing boo logrus.WithField("platform", platformRef).WithError(err).Debugf("Error loading platform for profile") } else { platformReleases = append(platformReleases, platformRelease) - indexURLs[platformRelease.Platform.Name] = platformRef.PlatformIndexURL + indexURLs[platformRelease.Name] = platformRef.PlatformIndexURL logrus.WithField("platform", platformRef).Debugf("Loaded platform for profile") } } diff --git a/client_example/main.go b/client_example/main.go index 7ae3745a598..3be6fb596fe 100644 --- a/client_example/main.go +++ b/client_example/main.go @@ -145,11 +145,6 @@ func main() { log.Println("calling PlatformInstall(arduino:samd@1.6.19)") callPlatformInstall(client, instance) - // Now list the installed platforms to double check previous installation - // went right. - log.Println("calling PlatformList()") - callPlatformList(client, instance) - // Upgrade the installed platform to the latest version. log.Println("calling PlatformUpgrade(arduino:samd)") callPlatformUpgrade(client, instance) @@ -420,7 +415,7 @@ func callPlatformSearch(client rpc.ArduinoCoreServiceClient, instance *rpc.Insta for _, plat := range platforms { // We only print ID and version of the platforms found but you can look // at the definition for the rpc.Platform struct for more fields. - log.Printf("Search result: %+v - %+v", plat.GetId(), plat.GetLatest()) + log.Printf("Search result: %+v - %+v", plat.GetMetadata().GetId(), plat.GetLatestVersion()) } } @@ -464,21 +459,6 @@ func callPlatformInstall(client rpc.ArduinoCoreServiceClient, instance *rpc.Inst } } -func callPlatformList(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) { - listResp, err := client.PlatformList(context.Background(), - &rpc.PlatformListRequest{Instance: instance}) - - if err != nil { - log.Fatalf("List error: %s", err) - } - - for _, plat := range listResp.GetInstalledPlatforms() { - // We only print ID and version of the installed platforms but you can look - // at the definition for the rpc.Platform struct for more fields. - log.Printf("Installed platform: %s - %s", plat.GetId(), plat.GetInstalled()) - } -} - func callPlatformUpgrade(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) { upgradeRespStream, err := client.PlatformUpgrade(context.Background(), &rpc.PlatformUpgradeRequest{ @@ -546,7 +526,7 @@ func callBoardSearch(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance } for _, board := range res.Boards { - log.Printf("Board Name: %s, Board Platform: %s\n", board.Name, board.Platform.Id) + log.Printf("Board Name: %s, Board Platform: %s\n", board.Name, board.Platform.Metadata.Id) } } diff --git a/commands/board/details.go b/commands/board/details.go index 17314aa1432..c00f315c788 100644 --- a/commands/board/details.go +++ b/commands/board/details.go @@ -39,7 +39,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai return nil, &arduino.InvalidFQBNError{Cause: err} } - boardPackage, boardPlatform, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn) + boardPackage, boardPlatformRelease, board, boardProperties, boardRefPlatform, err := pme.ResolveFQBN(fqbn) if err != nil { return nil, &arduino.UnknownFQBNError{Cause: err} } @@ -65,11 +65,11 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.DebuggingSupported = boardProperties.ContainsKey("debug.executable") || - boardPlatform.Properties.ContainsKey("debug.executable") || + boardPlatformRelease.Properties.ContainsKey("debug.executable") || (boardRefPlatform != nil && boardRefPlatform.Properties.ContainsKey("debug.executable")) || // HOTFIX: Remove me when the `arduino:samd` core is updated - boardPlatform.String() == "arduino:samd@1.8.9" || - boardPlatform.String() == "arduino:samd@1.8.8" + boardPlatformRelease.String() == "arduino:samd@1.8.9" || + boardPlatformRelease.String() == "arduino:samd@1.8.8" details.Package = &rpc.Package{ Name: boardPackage.Name, @@ -81,16 +81,16 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.Platform = &rpc.BoardPlatform{ - Architecture: boardPlatform.Platform.Architecture, - Category: boardPlatform.Platform.Category, - Name: boardPlatform.Platform.Name, + Architecture: boardPlatformRelease.Platform.Architecture, + Category: boardPlatformRelease.Category, + Name: boardPlatformRelease.Name, } - if boardPlatform.Resource != nil { - details.Platform.Url = boardPlatform.Resource.URL - details.Platform.ArchiveFilename = boardPlatform.Resource.ArchiveFileName - details.Platform.Checksum = boardPlatform.Resource.Checksum - details.Platform.Size = boardPlatform.Resource.Size + if boardPlatformRelease.Resource != nil { + details.Platform.Url = boardPlatformRelease.Resource.URL + details.Platform.ArchiveFilename = boardPlatformRelease.Resource.ArchiveFileName + details.Platform.Checksum = boardPlatformRelease.Resource.Checksum + details.Platform.Size = boardPlatformRelease.Resource.Size } details.ConfigOptions = []*rpc.ConfigOption{} @@ -118,7 +118,7 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.ToolsDependencies = []*rpc.ToolsDependencies{} - for _, tool := range boardPlatform.ToolDependencies { + for _, tool := range boardPlatformRelease.ToolDependencies { toolRelease := pme.FindToolDependency(tool) var systems []*rpc.Systems if toolRelease != nil { @@ -141,9 +141,9 @@ func Details(ctx context.Context, req *rpc.BoardDetailsRequest) (*rpc.BoardDetai } details.Programmers = []*rpc.Programmer{} - for id, p := range boardPlatform.Programmers { + for id, p := range boardPlatformRelease.Programmers { details.Programmers = append(details.Programmers, &rpc.Programmer{ - Platform: boardPlatform.Platform.Name, + Platform: boardPlatformRelease.Name, Id: id, Name: p.Name, }) diff --git a/commands/board/list.go b/commands/board/list.go index d0b5cb78dc4..b953efb25d5 100644 --- a/commands/board/list.go +++ b/commands/board/list.go @@ -157,7 +157,9 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port) ([]*rpc.BoardL // We need the Platform maintaner for sorting so we set it here platform := &rpc.Platform{ - Maintainer: board.PlatformRelease.Platform.Package.Maintainer, + Metadata: &rpc.PlatformMetadata{ + Maintainer: board.PlatformRelease.Platform.Package.Maintainer, + }, } boards = append(boards, &rpc.BoardListItem{ Name: board.Name(), @@ -185,7 +187,7 @@ func identify(pme *packagemanager.Explorer, port *discovery.Port) ([]*rpc.BoardL // Put Arduino boards before others in case there are non Arduino boards with identical VID:PID combination sort.SliceStable(boards, func(i, j int) bool { - if boards[i].Platform.Maintainer == "Arduino" && boards[j].Platform.Maintainer != "Arduino" { + if boards[i].Platform.Metadata.Maintainer == "Arduino" && boards[j].Platform.Metadata.Maintainer != "Arduino" { return true } return false diff --git a/commands/board/listall.go b/commands/board/listall.go index d4118aca4e7..407b54ad8e7 100644 --- a/commands/board/listall.go +++ b/commands/board/listall.go @@ -23,6 +23,7 @@ import ( "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/cores" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) @@ -46,29 +47,14 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllRequest) (*rpc.BoardListA continue } - installedVersion := installedPlatformRelease.Version.String() - - latestVersion := "" - if latestPlatformRelease := platform.GetLatestRelease(); latestPlatformRelease != nil { - latestVersion = latestPlatformRelease.Version.String() - } - rpcPlatform := &rpc.Platform{ - Id: platform.String(), - Installed: installedVersion, - Latest: latestVersion, - Name: platform.Name, - Maintainer: platform.Package.Maintainer, - Website: platform.Package.WebsiteURL, - Email: platform.Package.Email, - ManuallyInstalled: platform.ManuallyInstalled, - Indexed: platform.Indexed, - MissingMetadata: !installedPlatformRelease.HasMetadata(), + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(installedPlatformRelease), } toTest := []string{ platform.String(), - platform.Name, + installedPlatformRelease.Name, platform.Architecture, targetPackage.Name, targetPackage.Maintainer, diff --git a/commands/board/search.go b/commands/board/search.go index da0553463fa..007867775e3 100644 --- a/commands/board/search.go +++ b/commands/board/search.go @@ -22,6 +22,7 @@ import ( "github.com/arduino/arduino-cli/arduino" "github.com/arduino/arduino-cli/arduino/utils" + "github.com/arduino/arduino-cli/commands" "github.com/arduino/arduino-cli/commands/internal/instances" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) @@ -37,7 +38,7 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR } defer release() - res := &rpc.BoardSearchResponse{Boards: []*rpc.BoardListItem{}} + foundBoards := []*rpc.BoardListItem{} for _, targetPackage := range pme.GetPackages() { for _, platform := range targetPackage.Platforms { latestPlatformRelease := platform.GetLatestRelease() @@ -47,24 +48,6 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - rpcPlatform := &rpc.Platform{ - Id: platform.String(), - Name: platform.Name, - Maintainer: platform.Package.Maintainer, - Website: platform.Package.WebsiteURL, - Email: platform.Package.Email, - ManuallyInstalled: platform.ManuallyInstalled, - Indexed: platform.Indexed, - } - - if latestPlatformRelease != nil { - rpcPlatform.Latest = latestPlatformRelease.Version.String() - } - if installedPlatformRelease != nil { - rpcPlatform.Installed = installedPlatformRelease.Version.String() - rpcPlatform.MissingMetadata = !installedPlatformRelease.HasMetadata() - } - // Platforms that are not installed don't have a list of boards // generated from their boards.txt file so we need two different // ways of reading board data. @@ -81,11 +64,14 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - res.Boards = append(res.Boards, &rpc.BoardListItem{ + foundBoards = append(foundBoards, &rpc.BoardListItem{ Name: board.Name(), Fqbn: board.FQBN(), IsHidden: board.IsHidden(), - Platform: rpcPlatform, + Platform: &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(installedPlatformRelease), + }, }) } } else if latestPlatformRelease != nil { @@ -95,20 +81,24 @@ func Search(ctx context.Context, req *rpc.BoardSearchRequest) (*rpc.BoardSearchR continue } - res.Boards = append(res.Boards, &rpc.BoardListItem{ - Name: strings.Trim(board.Name, " \n"), - Platform: rpcPlatform, + foundBoards = append(foundBoards, &rpc.BoardListItem{ + Name: strings.Trim(board.Name, " \n"), + Platform: &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platform), + Release: commands.PlatformReleaseToRPC(latestPlatformRelease), + }, }) } } } } - sort.Slice(res.Boards, func(i, j int) bool { - if res.Boards[i].Name != res.Boards[j].Name { - return res.Boards[i].Name < res.Boards[j].Name + sort.Slice(foundBoards, func(i, j int) bool { + if foundBoards[i].Name != foundBoards[j].Name { + return foundBoards[i].Name < foundBoards[j].Name } - return res.Boards[i].Platform.Id < res.Boards[j].Platform.Id + return foundBoards[i].Platform.Metadata.Id < foundBoards[j].Platform.Metadata.Id }) - return res, nil + + return &rpc.BoardSearchResponse{Boards: foundBoards}, nil } diff --git a/commands/core.go b/commands/core.go index f75fbce04f4..14dc3360e4c 100644 --- a/commands/core.go +++ b/commands/core.go @@ -20,10 +20,23 @@ import ( rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" ) +// PlatformToRPCPlatformMetadata converts our internal structure to the RPC structure. +func PlatformToRPCPlatformMetadata(platform *cores.Platform) *rpc.PlatformMetadata { + return &rpc.PlatformMetadata{ + Id: platform.String(), + Maintainer: platform.Package.Maintainer, + Website: platform.Package.WebsiteURL, + Email: platform.Package.Email, + ManuallyInstalled: platform.ManuallyInstalled, + Deprecated: platform.Deprecated, + Indexed: platform.Indexed, + } +} + // PlatformReleaseToRPC converts our internal structure to the RPC structure. // Note: this function does not touch the "Installed" field of rpc.Platform as it's not always clear that the // platformRelease we're currently converting is actually installed. -func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform { +func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.PlatformRelease { // If the boards are not installed yet, the `platformRelease.Boards` will be a zero length slice. // In such case, we have to use the `platformRelease.BoardsManifest` instead. // So that we can retrieve the name of the boards at least. @@ -50,21 +63,16 @@ func PlatformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform } } - result := &rpc.Platform{ - Id: platformRelease.Platform.String(), - Name: platformRelease.Platform.Name, - Maintainer: platformRelease.Platform.Package.Maintainer, - Website: platformRelease.Platform.Package.WebsiteURL, - Email: platformRelease.Platform.Package.Email, - Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online}, - Boards: boards, - Latest: platformRelease.Version.String(), - ManuallyInstalled: platformRelease.Platform.ManuallyInstalled, - Deprecated: platformRelease.Platform.Deprecated, - Type: []string{platformRelease.Platform.Category}, - Indexed: platformRelease.Platform.Indexed, - MissingMetadata: !platformRelease.HasMetadata(), + // This field make sense only if the platformRelease is installed otherwise is an "undefined behaviour" + missingMetadata := platformRelease.IsInstalled() && !platformRelease.HasMetadata() + return &rpc.PlatformRelease{ + Name: platformRelease.Name, + Help: &rpc.HelpResources{Online: platformRelease.Platform.Package.Help.Online}, + Boards: boards, + Version: platformRelease.Version.String(), + Installed: platformRelease.IsInstalled(), + MissingMetadata: missingMetadata, + Type: []string{platformRelease.Category}, + Deprecated: platformRelease.Deprecated, } - - return result } diff --git a/commands/core/list.go b/commands/core/list.go deleted file mode 100644 index 10d582de2d1..00000000000 --- a/commands/core/list.go +++ /dev/null @@ -1,90 +0,0 @@ -// This file is part of arduino-cli. -// -// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) -// -// This software is released under the GNU General Public License version 3, -// which covers the main part of arduino-cli. -// The terms of this license can be found at: -// https://www.gnu.org/licenses/gpl-3.0.en.html -// -// You can be released from the requirements of the above licenses by purchasing -// a commercial license. Buying such a license is mandatory if you want to -// modify or otherwise use the software for commercial activities involving the -// Arduino software without disclosing the source code of your own applications. -// To purchase a commercial license, send an email to license@arduino.cc. - -package core - -import ( - "fmt" - "sort" - "strings" - - "github.com/arduino/arduino-cli/arduino" - "github.com/arduino/arduino-cli/commands" - "github.com/arduino/arduino-cli/commands/internal/instances" - rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" -) - -// PlatformList returns a list of installed platforms, optionally filtered by -// those requiring an update. -func PlatformList(req *rpc.PlatformListRequest) (*rpc.PlatformListResponse, error) { - pme, release := instances.GetPackageManagerExplorer(req.GetInstance()) - if pme == nil { - return nil, &arduino.InvalidInstanceError{} - } - defer release() - - res := []*rpc.Platform{} - for _, targetPackage := range pme.GetPackages() { - for _, platform := range targetPackage.Platforms { - platformRelease := pme.GetInstalledPlatformRelease(platform) - - // The All flags adds to the list of installed platforms the installable platforms (from the indexes) - // If both All and UpdatableOnly are set All takes precedence - if req.All { - installedVersion := "" - if platformRelease == nil { // if the platform is not installed - platformRelease = platform.GetLatestRelease() - } else { - installedVersion = platformRelease.Version.String() - } - // it could happen, especially with indexes not perfectly compliant with specs that a platform do not contain a valid release - if platformRelease != nil { - rpcPlatform := commands.PlatformReleaseToRPC(platformRelease) - rpcPlatform.Installed = installedVersion - res = append(res, rpcPlatform) - continue - } - } - - if platformRelease != nil { - latest := platform.GetLatestRelease() - if latest == nil { - return nil, &arduino.PlatformNotFoundError{Platform: platform.String(), Cause: fmt.Errorf(tr("the platform has no releases"))} - } - - // show only the updatable platforms - if req.UpdatableOnly && latest == platformRelease { - continue - } - - rpcPlatform := commands.PlatformReleaseToRPC(platformRelease) - rpcPlatform.Installed = platformRelease.Version.String() - rpcPlatform.Latest = latest.Version.String() - res = append(res, rpcPlatform) - } - } - } - // Sort result alphabetically and put deprecated platforms at the bottom - sort.Slice(res, func(i, j int) bool { - return strings.ToLower(res[i].Name) < strings.ToLower(res[j].Name) - }) - sort.SliceStable(res, func(i, j int) bool { - if !res[i].Deprecated && res[j].Deprecated { - return true - } - return false - }) - return &rpc.PlatformListResponse{InstalledPlatforms: res}, nil -} diff --git a/commands/core/search.go b/commands/core/search.go index 4562eb570e0..7d0b5662f31 100644 --- a/commands/core/search.go +++ b/commands/core/search.go @@ -36,19 +36,20 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse } defer release() - res := []*cores.PlatformRelease{} + res := []*cores.Platform{} if isUsb, _ := regexp.MatchString("[0-9a-f]{4}:[0-9a-f]{4}", req.SearchArgs); isUsb { vid, pid := req.SearchArgs[:4], req.SearchArgs[5:] res = pme.FindPlatformReleaseProvidingBoardsWithVidPid(vid, pid) } else { searchArgs := utils.SearchTermsFromQueryString(req.SearchArgs) - allVersions := req.AllVersions for _, targetPackage := range pme.GetPackages() { for _, platform := range targetPackage.Platforms { + if platform == nil { + continue + } // Users can install platforms manually in the Sketchbook hardware folder, - // the core search command must operate only on platforms installed through - // the PlatformManager, thus we skip the manually installed ones. - if platform == nil || platform.Name == "" || platform.ManuallyInstalled { + // if not explictily requested we skip them. + if !req.ManuallyInstalled && platform.ManuallyInstalled { continue } @@ -57,10 +58,13 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse if latestRelease == nil { continue } + if latestRelease.Name == "" { + continue + } // Gather all strings that can be used for searching toTest := platform.String() + " " + - platform.Name + " " + + latestRelease.Name + " " + platform.Architecture + " " + targetPackage.Name + " " + targetPackage.Maintainer + " " + @@ -74,33 +78,52 @@ func PlatformSearch(req *rpc.PlatformSearchRequest) (*rpc.PlatformSearchResponse continue } - if allVersions { - res = append(res, platform.GetAllReleases()...) - } else { - res = append(res, latestRelease) - } + res = append(res, platform) } } } - out := make([]*rpc.Platform, len(res)) - for i, platformRelease := range res { - out[i] = commands.PlatformReleaseToRPC(platformRelease) - if platformRelease.IsInstalled() { - out[i].Installed = platformRelease.Version.String() + out := []*rpc.PlatformSummary{} + for _, platform := range res { + rpcPlatformSummary := &rpc.PlatformSummary{ + Releases: map[string]*rpc.PlatformRelease{}, + } + + rpcPlatformSummary.Metadata = commands.PlatformToRPCPlatformMetadata(platform) + + installed := pme.GetInstalledPlatformRelease(platform) + latest := platform.GetLatestRelease() + if installed != nil { + rpcPlatformSummary.InstalledVersion = installed.Version.String() } + if latest != nil { + rpcPlatformSummary.LatestVersion = latest.Version.String() + } + if req.AllVersions { + for _, platformRelease := range platform.GetAllReleases() { + rpcPlatformRelease := commands.PlatformReleaseToRPC(platformRelease) + rpcPlatformSummary.Releases[rpcPlatformRelease.Version] = rpcPlatformRelease + } + } else { + if installed != nil { + rpcPlatformRelease := commands.PlatformReleaseToRPC(installed) + rpcPlatformSummary.Releases[installed.Version.String()] = rpcPlatformRelease + } + if latest != nil { + rpcPlatformRelease := commands.PlatformReleaseToRPC(latest) + rpcPlatformSummary.Releases[latest.Version.String()] = rpcPlatformRelease + } + } + out = append(out, rpcPlatformSummary) } + // Sort result alphabetically and put deprecated platforms at the bottom - sort.Slice( - out, func(i, j int) bool { - return strings.ToLower(out[i].Name) < strings.ToLower(out[j].Name) - }) - sort.SliceStable( - out, func(i, j int) bool { - if !out[i].Deprecated && out[j].Deprecated { - return true - } - return false - }) + sort.Slice(out, func(i, j int) bool { + return strings.ToLower(out[i].GetReleases()[out[i].GetLatestVersion()].Name) < + strings.ToLower(out[j].GetReleases()[out[j].GetLatestVersion()].Name) + }) + sort.SliceStable(out, func(i, j int) bool { + return !out[i].GetMetadata().Deprecated && out[j].GetMetadata().Deprecated + }) return &rpc.PlatformSearchResponse{SearchOutput: out}, nil } diff --git a/commands/core/search_test.go b/commands/core/search_test.go index b96c19912af..a695acbd6b4 100644 --- a/commands/core/search_test.go +++ b/commands/core/search_test.go @@ -26,7 +26,6 @@ import ( ) func TestPlatformSearch(t *testing.T) { - dataDir := paths.TempDir().Join("test", "data_dir") downloadDir := paths.TempDir().Join("test", "staging") t.Setenv("ARDUINO_DATA_DIR", dataDir.String()) @@ -42,280 +41,315 @@ func TestPlatformSearch(t *testing.T) { inst := instance.CreateAndInit() require.NotNil(t, inst) - res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "retrokit", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) + t.Run("SearchAllVersions", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "retrokit", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "Retrokits-RK002:arm", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.0.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "1.0.6": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.6", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "retrokit", - AllVersions: false, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchNoAllVersions", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "retrokit", + AllVersions: false, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "Retrokits-RK002:arm", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.0.6": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.6", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search the Package Maintainer - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Retrokits (www.retrokits.com)", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchThePackageMaintainer", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Retrokits (www.retrokits.com)", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "Retrokits-RK002:arm", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.0.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "1.0.6": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.6", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using the Package name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Retrokits-RK002", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchPackageName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Retrokits-RK002", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "Retrokits-RK002:arm", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.0.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "1.0.6": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.6", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using the Platform name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "rk002", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 2) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.5", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, - }) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "Retrokits-RK002:arm", - Installed: "", - Latest: "1.0.6", - Name: "RK002", - Maintainer: "Retrokits (www.retrokits.com)", - Website: "https://www.retrokits.com", - Email: "info@retrokits.com", - Boards: []*rpc.Board{{Name: "RK002"}}, - Type: []string{"Contributed"}, - Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchPlatformName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "rk002", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "Retrokits-RK002:arm", + Maintainer: "Retrokits (www.retrokits.com)", + Website: "https://www.retrokits.com", + Email: "info@retrokits.com", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.0.5": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.5", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + "1.0.6": { + Name: "RK002", + Type: []string{"Contributed"}, + Installed: false, + Version: "1.0.6", + Boards: []*rpc.Board{{Name: "RK002"}}, + Help: &rpc.HelpResources{Online: "https://www.retrokits.com/rk002/arduino"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.0.6", + }) }) - // Search using a board name - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "Yún", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "arduino:avr", - Installed: "", - Latest: "1.8.3", - Name: "Arduino AVR Boards", - Maintainer: "Arduino", - Website: "https://www.arduino.cc/", - Email: "packages@arduino.cc", - Type: []string{"Arduino"}, - Boards: []*rpc.Board{ - {Name: "Arduino Yún"}, - {Name: "Arduino Uno"}, - {Name: "Arduino Uno WiFi"}, - {Name: "Arduino Diecimila"}, - {Name: "Arduino Nano"}, - {Name: "Arduino Mega"}, - {Name: "Arduino MegaADK"}, - {Name: "Arduino Leonardo"}, - {Name: "Arduino Leonardo Ethernet"}, - {Name: "Arduino Micro"}, - {Name: "Arduino Esplora"}, - {Name: "Arduino Mini"}, - {Name: "Arduino Ethernet"}, - {Name: "Arduino Fio"}, - {Name: "Arduino BT"}, - {Name: "Arduino LilyPadUSB"}, - {Name: "Arduino Lilypad"}, - {Name: "Arduino Pro"}, - {Name: "Arduino ATMegaNG"}, - {Name: "Arduino Robot Control"}, - {Name: "Arduino Robot Motor"}, - {Name: "Arduino Gemma"}, - {Name: "Adafruit Circuit Playground"}, - {Name: "Arduino Yún Mini"}, - {Name: "Arduino Industrial 101"}, - {Name: "Linino One"}, - }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchBoardName", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "Yún", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "arduino:avr", + Maintainer: "Arduino", + Website: "https://www.arduino.cc/", + Email: "packages@arduino.cc", + Indexed: true, + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.8.3": { + Name: "Arduino AVR Boards", + Type: []string{"Arduino"}, + Installed: false, + Version: "1.8.3", + Boards: []*rpc.Board{ + {Name: "Arduino Yún"}, + {Name: "Arduino Uno"}, + {Name: "Arduino Uno WiFi"}, + {Name: "Arduino Diecimila"}, + {Name: "Arduino Nano"}, + {Name: "Arduino Mega"}, + {Name: "Arduino MegaADK"}, + {Name: "Arduino Leonardo"}, + {Name: "Arduino Leonardo Ethernet"}, + {Name: "Arduino Micro"}, + {Name: "Arduino Esplora"}, + {Name: "Arduino Mini"}, + {Name: "Arduino Ethernet"}, + {Name: "Arduino Fio"}, + {Name: "Arduino BT"}, + {Name: "Arduino LilyPadUSB"}, + {Name: "Arduino Lilypad"}, + {Name: "Arduino Pro"}, + {Name: "Arduino ATMegaNG"}, + {Name: "Arduino Robot Control"}, + {Name: "Arduino Robot Motor"}, + {Name: "Arduino Gemma"}, + {Name: "Adafruit Circuit Playground"}, + {Name: "Arduino Yún Mini"}, + {Name: "Arduino Industrial 101"}, + {Name: "Linino One"}, + }, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.8.3", + }) }) - res, stat = PlatformSearch(&rpc.PlatformSearchRequest{ - Instance: inst, - SearchArgs: "yun", - AllVersions: true, - }) - require.Nil(t, stat) - require.NotNil(t, res) - require.Len(t, res.SearchOutput, 1) - require.Contains(t, res.SearchOutput, &rpc.Platform{ - Id: "arduino:avr", - Installed: "", - Latest: "1.8.3", - Name: "Arduino AVR Boards", - Maintainer: "Arduino", - Website: "https://www.arduino.cc/", - Email: "packages@arduino.cc", - Type: []string{"Arduino"}, - Boards: []*rpc.Board{ - {Name: "Arduino Yún"}, - {Name: "Arduino Uno"}, - {Name: "Arduino Uno WiFi"}, - {Name: "Arduino Diecimila"}, - {Name: "Arduino Nano"}, - {Name: "Arduino Mega"}, - {Name: "Arduino MegaADK"}, - {Name: "Arduino Leonardo"}, - {Name: "Arduino Leonardo Ethernet"}, - {Name: "Arduino Micro"}, - {Name: "Arduino Esplora"}, - {Name: "Arduino Mini"}, - {Name: "Arduino Ethernet"}, - {Name: "Arduino Fio"}, - {Name: "Arduino BT"}, - {Name: "Arduino LilyPadUSB"}, - {Name: "Arduino Lilypad"}, - {Name: "Arduino Pro"}, - {Name: "Arduino ATMegaNG"}, - {Name: "Arduino Robot Control"}, - {Name: "Arduino Robot Motor"}, - {Name: "Arduino Gemma"}, - {Name: "Adafruit Circuit Playground"}, - {Name: "Arduino Yún Mini"}, - {Name: "Arduino Industrial 101"}, - {Name: "Linino One"}, - }, - Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, - Indexed: true, - MissingMetadata: true, + t.Run("SearchBoardName2", func(t *testing.T) { + res, stat := PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + SearchArgs: "yun", + AllVersions: true, + }) + require.Nil(t, stat) + require.NotNil(t, res) + require.Len(t, res.SearchOutput, 1) + require.Contains(t, res.SearchOutput, &rpc.PlatformSummary{ + Metadata: &rpc.PlatformMetadata{ + Id: "arduino:avr", + Indexed: true, + Maintainer: "Arduino", + Website: "https://www.arduino.cc/", + Email: "packages@arduino.cc", + }, + Releases: map[string]*rpc.PlatformRelease{ + "1.8.3": { + Name: "Arduino AVR Boards", + Type: []string{"Arduino"}, + Installed: false, + Version: "1.8.3", + Boards: []*rpc.Board{ + {Name: "Arduino Yún"}, + {Name: "Arduino Uno"}, + {Name: "Arduino Uno WiFi"}, + {Name: "Arduino Diecimila"}, + {Name: "Arduino Nano"}, + {Name: "Arduino Mega"}, + {Name: "Arduino MegaADK"}, + {Name: "Arduino Leonardo"}, + {Name: "Arduino Leonardo Ethernet"}, + {Name: "Arduino Micro"}, + {Name: "Arduino Esplora"}, + {Name: "Arduino Mini"}, + {Name: "Arduino Ethernet"}, + {Name: "Arduino Fio"}, + {Name: "Arduino BT"}, + {Name: "Arduino LilyPadUSB"}, + {Name: "Arduino Lilypad"}, + {Name: "Arduino Pro"}, + {Name: "Arduino ATMegaNG"}, + {Name: "Arduino Robot Control"}, + {Name: "Arduino Robot Motor"}, + {Name: "Arduino Gemma"}, + {Name: "Adafruit Circuit Playground"}, + {Name: "Arduino Yún Mini"}, + {Name: "Arduino Industrial 101"}, + {Name: "Linino One"}, + }, + Help: &rpc.HelpResources{Online: "http://www.arduino.cc/en/Reference/HomePage"}, + }, + }, + InstalledVersion: "", + LatestVersion: "1.8.3", + }) }) } @@ -344,11 +378,10 @@ func TestPlatformSearchSorting(t *testing.T) { require.NotNil(t, res) require.Len(t, res.SearchOutput, 3) - require.Equal(t, res.SearchOutput[0].Name, "Arduino AVR Boards") - require.Equal(t, res.SearchOutput[0].Deprecated, false) - require.Equal(t, res.SearchOutput[1].Name, "RK002") - require.Equal(t, res.SearchOutput[1].Deprecated, false) - require.Equal(t, res.SearchOutput[2].Name, "Platform") - require.Equal(t, res.SearchOutput[2].Deprecated, true) - + require.Equal(t, res.SearchOutput[0].GetLatestRelease().Name, "Arduino AVR Boards") + require.Equal(t, res.SearchOutput[0].Metadata.Deprecated, false) + require.Equal(t, res.SearchOutput[1].GetLatestRelease().Name, "RK002") + require.Equal(t, res.SearchOutput[1].Metadata.Deprecated, false) + require.Equal(t, res.SearchOutput[2].GetLatestRelease().Name, "Platform") + require.Equal(t, res.SearchOutput[2].Metadata.Deprecated, true) } diff --git a/commands/core/upgrade.go b/commands/core/upgrade.go index 2baaf2c97d6..19c93fe95cf 100644 --- a/commands/core/upgrade.go +++ b/commands/core/upgrade.go @@ -49,10 +49,12 @@ func PlatformUpgrade(ctx context.Context, req *rpc.PlatformUpgradeRequest, downl } var rpcPlatform *rpc.Platform - platformRelease, err := upgrade() if platformRelease != nil { - rpcPlatform = commands.PlatformReleaseToRPC(platformRelease) + rpcPlatform = &rpc.Platform{ + Metadata: commands.PlatformToRPCPlatformMetadata(platformRelease.Platform), + Release: commands.PlatformReleaseToRPC(platformRelease), + } } if err != nil { return &rpc.PlatformUpgradeResponse{Platform: rpcPlatform}, err diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index ec7fd10e9d9..ef6e4daa506 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -258,12 +258,6 @@ func (s *ArduinoCoreServerImpl) PlatformSearch(ctx context.Context, req *rpc.Pla return resp, convertErrorToRPCStatus(err) } -// PlatformList FIXMEDOC -func (s *ArduinoCoreServerImpl) PlatformList(ctx context.Context, req *rpc.PlatformListRequest) (*rpc.PlatformListResponse, error) { - platforms, err := core.PlatformList(req) - return platforms, convertErrorToRPCStatus(err) -} - // Upload FIXMEDOC func (s *ArduinoCoreServerImpl) Upload(req *rpc.UploadRequest, stream rpc.ArduinoCoreService_UploadServer) error { syncSend := NewSynchronizedSend(stream.Send) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 537373e6d45..7c92c5f336d 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -2,7 +2,172 @@ Here you can find a list of migration guides to handle breaking changes between releases of the CLI. -## v0.35.0 +## 0.36.0 + +### CLI `core list` and `core search` changed JSON output. + +Below is an example of the response containing an object with all possible keys set. + +```json +[ + { + "id": "arduino:avr", + "maintainer": "Arduino", + "website": "http://www.arduino.cc/", + "email": "packages@arduino.cc", + "indexed": true, + "manually_installed": true, + "deprecated": true, + "releases": { + "1.6.2": { + "name": "Arduino AVR Boards", + "version": "1.6.2", + "type": [ + "Arduino" + ], + "installed": true, + "boards": [ + { + "name": "Arduino Robot Motor" + } + ], + "help": { + "online": "http://www.arduino.cc/en/Reference/HomePage" + }, + "missing_metadata": true, + "deprecated": true + }, + "1.8.3": { ... } + }, + "installed_version": "1.6.2", + "latest_version": "1.8.3" + } +] +``` + +### gRPC `cc.arduino.cli.commands.v1.PlatformSearchResponse` message has been changed. + +The old behavior was a bit misleading to the client because, to list all the available versions for each platform, we +used to use the `latest` as it was describing the current platform version. We introduced a new message: +`PlatformSummary`, with the intent to make the response more straightforward and less error-prone. + +```protobuf +message PlatformSearchResponse { + // Results of the search. + repeated PlatformSummary search_output = 1; +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +message PlatformSummary { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Maps version to the corresponding PlatformRelease + map releases = 2; + // The installed version of the platform, or empty string if none installed + string installed_version = 3; + // The latest available version of the platform, or empty if none available + string latest_version = 4; +} +``` + +The new response contains an array of `PlatformSummary`. `PlatformSummary` contains all the information about a platform +and all its available releases. Releases contain all the PlatformReleases of a specific platform, and the key is the +semver string of a specific version. We've added the `installed_version` and `latest_version` to make more convenient +the access of such values in the map. A few notes about the behavior of the `releases` map: + +- It can be empty if no releases are found +- It can contain a single-release +- It can contain multiple releases +- If in the request we provide the `manually_installed=true`, the key of such release is an empty string. + +### Removed gRPC API: `cc.arduino.cli.commands.v1.PlatformList`, `PlatformListRequest`, and `PlatformListResponse`. + +The following gRPC API have been removed: + +- `cc.arduino.cli.commands.v1.PlatformList`: you can use the already available gRPC method `PlatformSearch` to perform + the same task. Setting the `all_versions=true` and `manually_installed=true` in the `PlatformSearchRequest` returns + all the data needed to produce the same result of the old api. +- `cc.arduino.cli.commands.v1.PlatformListRequest`. +- `cc.arduino.cli.commands.v1.PlatformListResponse`. + +### gRPC `cc.arduino.cli.commands.v1.Platform` message has been changed. + +The old `Platform` and other information such as name, website, and email... contained details about the currently +installed version and the latest available. We noticed an ambiguous use of the `latest` field, especially when such a +message came in the `PlatformSearchResponse` response. In that use case, the latest field contained the specific version +of a particular platform: this is a hack because the value doesn't always reflect the meaning of that property. Another +inconsistent case occurs when a platform maintainer changes the name of a particular release. We always pick the value +from the latest release, but this might not be what we want to do all the time. We concluded that the design of that +message isn't something to be considered future-proof proof, so we decided to modify it as follows: + +```protobuf +// Platform is a structure containing all the information about a single +// platform release. +message Platform { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Information about a specific release of a platform + PlatformRelease release = 2; +} + +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +message PlatformMetadata { + // Platform ID (e.g., `arduino:avr`). + string id = 1; + // Maintainer of the platform's package. + string maintainer = 2; + // A URL provided by the author of the platform's package, intended to point + // to their website. + string website = 3; + // Email of the maintainer of the platform's package. + string email = 4; + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + bool manually_installed = 5; + // True if the latest release of this Platform has been deprecated + bool deprecated = 6; + // If true the platform is indexed + bool indexed = 7; +} + +// PlatformRelease contains information about a specific release of a platform. +message PlatformRelease { + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + string name = 1; + // Version of the platform release + string version = 5; + // Type of the platform. + repeated string type = 6; + // True if the platform is installed + bool installed = 7; + // List of boards provided by the platform. If the platform is installed, + // this is the boards listed in the platform's boards.txt. If the platform is + // not installed, this is an arbitrary list of board names provided by the + // platform author for display and may not match boards.txt. + repeated Board boards = 8; + // A URL provided by the author of the platform's package, intended to point + // to their online help service. + HelpResources help = 9; + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + bool missing_metadata = 10; + // True this release is deprecated + bool deprecated = 11; +} +``` + +To address all the inconsistencies/inaccuracies we introduced two messages: + +- `PlatformMetadata` contains generic information about a platform (not correlated to a specific release). +- `PlatformRelease` contains information about a specific release of a platform. + +## 0.35.0 ### CLI `debug --info` changed JSON output. diff --git a/internal/cli/arguments/completion.go b/internal/cli/arguments/completion.go index c97ac72f064..2139e415fe1 100644 --- a/internal/cli/arguments/completion.go +++ b/internal/cli/arguments/completion.go @@ -83,15 +83,19 @@ func GetInstalledProgrammers() []string { func GetUninstallableCores() []string { inst := instance.CreateAndInit() - platforms, _ := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: false, - All: false, + platforms, _ := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: false, + ManuallyInstalled: true, }) + var res []string // transform the data structure for the completion - for _, i := range platforms.InstalledPlatforms { - res = append(res, i.Id+"\t"+i.Name) + for _, i := range platforms.GetSearchOutput() { + if i.InstalledVersion == "" { + continue + } + res = append(res, i.GetMetadata().GetId()+"\t"+i.GetInstalledRelease().GetName()) } return res } @@ -109,7 +113,7 @@ func GetInstallableCores() []string { var res []string // transform the data structure for the completion for _, i := range platforms.SearchOutput { - res = append(res, i.Id+"\t"+i.Name) + res = append(res, i.GetMetadata().GetId()+"\t"+i.GetReleases()[i.GetLatestVersion()].GetName()) } return res } diff --git a/internal/cli/arguments/reference.go b/internal/cli/arguments/reference.go index a870a0616a2..f9d8737d415 100644 --- a/internal/cli/arguments/reference.go +++ b/internal/cli/arguments/reference.go @@ -66,6 +66,7 @@ func ParseReference(arg string) (*Reference, error) { if arg == "" { return nil, fmt.Errorf(tr("invalid empty core argument")) } + toks := strings.SplitN(arg, "@", 2) if toks[0] == "" { return nil, fmt.Errorf(tr("invalid empty core reference '%s'"), arg) @@ -85,23 +86,22 @@ func ParseReference(arg string) (*Reference, error) { if toks[0] == "" { return nil, fmt.Errorf(tr("invalid empty core name '%s'"), arg) } - ret.PackageName = toks[0] if toks[1] == "" { return nil, fmt.Errorf(tr("invalid empty core architecture '%s'"), arg) } + ret.PackageName = toks[0] ret.Architecture = toks[1] // Now that we have the required informations in `ret` we can // try to use core.PlatformList to optimize what the user typed // (by replacing the PackageName and Architecture in ret with the content of core.GetPlatform()) - platforms, _ := core.PlatformList(&rpc.PlatformListRequest{ - Instance: instance.CreateAndInit(), - UpdatableOnly: false, - All: true, // this is true because we want also the installable platforms + platforms, _ := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: instance.CreateAndInit(), + AllVersions: false, }) foundPlatforms := []string{} - for _, platform := range platforms.InstalledPlatforms { - platformID := platform.GetId() + for _, platform := range platforms.GetSearchOutput() { + platformID := platform.GetMetadata().GetId() platformUser := ret.PackageName + ":" + ret.Architecture // At first we check if the platform the user is searching for matches an available one, // this way we do not need to adapt the casing and we can return it directly @@ -110,7 +110,6 @@ func ParseReference(arg string) (*Reference, error) { } if strings.EqualFold(platformUser, platformID) { logrus.Infof("Found possible match for reference %s -> %s", platformUser, platformID) - toks = strings.Split(platformID, ":") foundPlatforms = append(foundPlatforms, platformID) } } @@ -122,6 +121,7 @@ func ParseReference(arg string) (*Reference, error) { if len(foundPlatforms) > 1 { return nil, &arduino.MultiplePlatformsError{Platforms: foundPlatforms, UserPlatform: arg} } + toks = strings.Split(foundPlatforms[0], ":") ret.PackageName = toks[0] ret.Architecture = toks[1] return ret, nil diff --git a/internal/cli/board/search.go b/internal/cli/board/search.go index 102e9ea1dae..efa3f945662 100644 --- a/internal/cli/board/search.go +++ b/internal/cli/board/search.go @@ -85,7 +85,7 @@ func (r searchResults) String() string { if item.IsHidden { hidden = tr("(hidden)") } - t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Id, hidden) + t.AddRow(item.GetName(), item.GetFqbn(), item.Platform.Metadata.Id, hidden) } return t.Render() } diff --git a/internal/cli/core/list.go b/internal/cli/core/list.go index 4645295b063..4242fa6d7a9 100644 --- a/internal/cli/core/list.go +++ b/internal/cli/core/list.go @@ -21,6 +21,7 @@ import ( "github.com/arduino/arduino-cli/commands/core" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" @@ -55,44 +56,76 @@ func runListCommand(args []string, all bool, updatableOnly bool) { // List gets and prints a list of installed platforms. func List(inst *rpc.Instance, all bool, updatableOnly bool) { platforms := GetList(inst, all, updatableOnly) - feedback.PrintResult(installedResult{platforms}) + feedback.PrintResult(newCoreListResult(platforms)) } // GetList returns a list of installed platforms. -func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.Platform { - platforms, err := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: updatableOnly, - All: all, +func GetList(inst *rpc.Instance, all bool, updatableOnly bool) []*rpc.PlatformSummary { + platforms, err := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: true, + ManuallyInstalled: true, }) if err != nil { feedback.Fatal(tr("Error listing platforms: %v", err), feedback.ErrGeneric) } - return platforms.InstalledPlatforms + + // If both `all` and `updatableOnly` are set, `all` takes precedence. + if all { + return platforms.GetSearchOutput() + } + + result := []*rpc.PlatformSummary{} + for _, platform := range platforms.GetSearchOutput() { + if platform.InstalledVersion == "" && !platform.GetMetadata().ManuallyInstalled { + continue + } + if updatableOnly && platform.InstalledVersion == platform.LatestVersion { + continue + } + result = append(result, platform) + } + return result } -// output from this command requires special formatting, let's create a dedicated -// feedback.Result implementation -type installedResult struct { - platforms []*rpc.Platform +func newCoreListResult(in []*rpc.PlatformSummary) *coreListResult { + res := &coreListResult{} + for _, platformSummary := range in { + res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary)) + } + return res +} + +type coreListResult struct { + platforms []*result.Platform } -func (ir installedResult) Data() interface{} { +// Data implements Result interface +func (ir coreListResult) Data() interface{} { return ir.platforms } -func (ir installedResult) String() string { +// String implements Result interface +func (ir coreListResult) String() string { if len(ir.platforms) == 0 { return tr("No platforms installed.") } t := table.New() t.SetHeader(tr("ID"), tr("Installed"), tr("Latest"), tr("Name")) - for _, p := range ir.platforms { - name := p.Name - if p.Deprecated { + for _, platform := range ir.platforms { + name := "" + if installed := platform.GetInstalledRelease(); installed != nil { + name = installed.Name + } + if name == "" { + if latest := platform.GetLatestRelease(); latest != nil { + name = latest.Name + } + } + if platform.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(p.Id, p.Installed, p.Latest, name) + t.AddRow(platform.Id, platform.InstalledVersion, platform.LatestVersion, name) } return t.Render() diff --git a/internal/cli/core/search.go b/internal/cli/core/search.go index 0259d35bf44..78e02ddf400 100644 --- a/internal/cli/core/search.go +++ b/internal/cli/core/search.go @@ -29,6 +29,7 @@ import ( "github.com/arduino/arduino-cli/commands/core" "github.com/arduino/arduino-cli/configuration" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" "github.com/arduino/arduino-cli/table" @@ -81,13 +82,21 @@ func runSearchCommand(cmd *cobra.Command, args []string) { } coreslist := resp.GetSearchOutput() - feedback.PrintResult(searchResults{coreslist}) + feedback.PrintResult(newSearchResult(coreslist)) } // output from this command requires special formatting, let's create a dedicated // feedback.Result implementation type searchResults struct { - platforms []*rpc.Platform + platforms []*result.Platform +} + +func newSearchResult(in []*rpc.PlatformSummary) *searchResults { + res := &searchResults{} + for _, platformSummary := range in { + res.platforms = append(res.platforms, result.NewPlatformResult(platformSummary)) + } + return res } func (sr searchResults) Data() interface{} { @@ -98,12 +107,17 @@ func (sr searchResults) String() string { if len(sr.platforms) > 0 { t := table.New() t.SetHeader(tr("ID"), tr("Version"), tr("Name")) - for _, item := range sr.platforms { - name := item.GetName() - if item.Deprecated { + for _, platform := range sr.platforms { + name := "" + if latest := platform.GetLatestRelease(); latest != nil { + name = latest.Name + } + if platform.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(item.GetId(), item.GetLatest(), name) + for _, version := range platform.Releases.Keys() { + t.AddRow(platform.Id, version, name) + } } return t.Render() } diff --git a/internal/cli/core/upgrade.go b/internal/cli/core/upgrade.go index f8484dc985b..04045cc3bf6 100644 --- a/internal/cli/core/upgrade.go +++ b/internal/cli/core/upgrade.go @@ -60,21 +60,36 @@ func runUpgradeCommand(args []string, skipPostInstall bool, skipPreUninstall boo func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool, skipPreUninstall bool) { // if no platform was passed, upgrade allthethings if len(args) == 0 { - targets, err := core.PlatformList(&rpc.PlatformListRequest{ - Instance: inst, - UpdatableOnly: true, + platforms, err := core.PlatformSearch(&rpc.PlatformSearchRequest{ + Instance: inst, + AllVersions: false, }) if err != nil { feedback.Fatal(tr("Error retrieving core list: %v", err), feedback.ErrGeneric) } - if len(targets.InstalledPlatforms) == 0 { + targets := []*rpc.Platform{} + for _, platform := range platforms.GetSearchOutput() { + if platform.InstalledVersion == "" { + continue + } + if platform.InstalledVersion == platform.LatestVersion { + // if it's not updatable, skip it + continue + } + targets = append(targets, &rpc.Platform{ + Metadata: platform.GetMetadata(), + Release: platform.GetLatestRelease(), + }) + } + + if len(targets) == 0 { feedback.Print(tr("All the cores are already at the latest version")) return } - for _, t := range targets.InstalledPlatforms { - args = append(args, t.Id) + for _, t := range targets { + args = append(args, t.GetMetadata().Id) } } @@ -82,8 +97,8 @@ func Upgrade(inst *rpc.Instance, args []string, skipPostInstall bool, skipPreUni if response == nil || response.Platform == nil { return } - if !response.Platform.Indexed { - feedback.Warning(tr("missing package index for %s, future updates cannot be guaranteed", response.Platform.Id)) + if !response.Platform.GetMetadata().Indexed { + feedback.Warning(tr("missing package index for %s, future updates cannot be guaranteed", response.Platform.GetMetadata().Id)) } } diff --git a/internal/cli/feedback/result/rpc.go b/internal/cli/feedback/result/rpc.go new file mode 100644 index 00000000000..b6bdb636706 --- /dev/null +++ b/internal/cli/feedback/result/rpc.go @@ -0,0 +1,121 @@ +// This file is part of arduino-cli. +// +// Copyright 2020 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package result + +import ( + "github.com/arduino/arduino-cli/internal/orderedmap" + rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" + semver "go.bug.st/relaxed-semver" +) + +// NewPlatformResult creates a new result.Platform from rpc.PlatformSummary +func NewPlatformResult(in *rpc.PlatformSummary) *Platform { + releases := orderedmap.NewWithConversionFunc[*semver.Version, *PlatformRelease, string]((*semver.Version).String) + for k, v := range in.Releases { + releases.Set(semver.MustParse(k), NewPlatformReleaseResult(v)) + } + releases.SortKeys((*semver.Version).CompareTo) + + return &Platform{ + Id: in.Metadata.Id, + Maintainer: in.Metadata.Maintainer, + Website: in.Metadata.Website, + Email: in.Metadata.Email, + ManuallyInstalled: in.Metadata.ManuallyInstalled, + Deprecated: in.Metadata.Deprecated, + Indexed: in.Metadata.Indexed, + Releases: releases, + InstalledVersion: semver.MustParse(in.InstalledVersion), + LatestVersion: semver.MustParse(in.LatestVersion), + } +} + +// Platform maps a rpc.Platform +type Platform struct { + Id string `json:"id,omitempty"` + Maintainer string `json:"maintainer,omitempty"` + Website string `json:"website,omitempty"` + Email string `json:"email,omitempty"` + ManuallyInstalled bool `json:"manually_installed,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` + Indexed bool `json:"indexed,omitempty"` + + Releases orderedmap.Map[*semver.Version, *PlatformRelease] `json:"releases,omitempty"` + + InstalledVersion *semver.Version `json:"installed_version,omitempty"` + LatestVersion *semver.Version `json:"latest_version,omitempty"` +} + +// GetLatestRelease returns the latest relase of this platform or nil if none available. +func (p *Platform) GetLatestRelease() *PlatformRelease { + return p.Releases.Get(p.LatestVersion) +} + +// GetInstalledRelease returns the installed relase of this platform or nil if none available. +func (p *Platform) GetInstalledRelease() *PlatformRelease { + return p.Releases.Get(p.InstalledVersion) +} + +// NewPlatformReleaseResult creates a new result.PlatformRelease from rpc.PlatformRelease +func NewPlatformReleaseResult(in *rpc.PlatformRelease) *PlatformRelease { + var boards []*Board + for _, board := range in.Boards { + boards = append(boards, &Board{ + Name: board.Name, + Fqbn: board.Fqbn, + }) + } + var help *HelpResource + if in.Help != nil { + help = &HelpResource{ + Online: in.Help.Online, + } + } + res := &PlatformRelease{ + Name: in.Name, + Version: in.Version, + Type: in.Type, + Installed: in.Installed, + Boards: boards, + Help: help, + MissingMetadata: in.MissingMetadata, + Deprecated: in.Deprecated, + } + return res +} + +// PlatformRelease maps a rpc.PlatformRelease +type PlatformRelease struct { + Name string `json:"name,omitempty"` + Version string `json:"version,omitempty"` + Type []string `json:"type,omitempty"` + Installed bool `json:"installed,omitempty"` + Boards []*Board `json:"boards,omitempty"` + Help *HelpResource `json:"help,omitempty"` + MissingMetadata bool `json:"missing_metadata,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` +} + +// Board maps a rpc.Board +type Board struct { + Name string `json:"name,omitempty"` + Fqbn string `json:"fqbn,omitempty"` +} + +// HelpResource maps a rpc.HelpResource +type HelpResource struct { + Online string `json:"online,omitempty"` +} diff --git a/internal/cli/outdated/outdated.go b/internal/cli/outdated/outdated.go index 8a56f21b36a..5b2b6ac6309 100644 --- a/internal/cli/outdated/outdated.go +++ b/internal/cli/outdated/outdated.go @@ -24,6 +24,7 @@ import ( "github.com/arduino/arduino-cli/i18n" "github.com/arduino/arduino-cli/internal/cli/core" "github.com/arduino/arduino-cli/internal/cli/feedback" + "github.com/arduino/arduino-cli/internal/cli/feedback/result" "github.com/arduino/arduino-cli/internal/cli/instance" "github.com/arduino/arduino-cli/internal/cli/lib" rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1" @@ -57,17 +58,26 @@ func runOutdatedCommand(cmd *cobra.Command, args []string) { // Outdated prints a list of outdated platforms and libraries func Outdated(inst *rpc.Instance) { feedback.PrintResult( - outdatedResult{core.GetList(inst, false, true), lib.GetList(inst, []string{}, false, true)}, + newOutdatedResult(core.GetList(inst, false, true), lib.GetList(inst, []string{}, false, true)), ) } // output from this command requires special formatting, let's create a dedicated // feedback.Result implementation type outdatedResult struct { - Platforms []*rpc.Platform `json:"platforms,omitempty"` + Platforms []*result.Platform `json:"platforms,omitempty"` InstalledLibs []*rpc.InstalledLibrary `json:"libraries,omitempty"` } +func newOutdatedResult(inPlatforms []*rpc.PlatformSummary, inLibraries []*rpc.InstalledLibrary) *outdatedResult { + res := &outdatedResult{} + for _, platformSummary := range inPlatforms { + res.Platforms = append(res.Platforms, result.NewPlatformResult(platformSummary)) + } + res.InstalledLibs = inLibraries + return res +} + func (ir outdatedResult) Data() interface{} { return &ir } @@ -93,11 +103,14 @@ func (ir outdatedResult) String() string { // Based on internal/cli/core/list.go for _, p := range ir.Platforms { - name := p.Name + name := "" + if latest := p.GetLatestRelease(); latest != nil { + name = latest.Name + } if p.Deprecated { name = fmt.Sprintf("[%s] %s", tr("DEPRECATED"), name) } - t.AddRow(p.Id, name, p.Installed, p.Latest, "", "") + t.AddRow(p.Id, name, p.InstalledVersion, p.LatestVersion, "", "") } // Based on internal/cli/lib/list.go diff --git a/internal/integrationtest/arduino-cli.go b/internal/integrationtest/arduino-cli.go index 087182c50af..17003c01723 100644 --- a/internal/integrationtest/arduino-cli.go +++ b/internal/integrationtest/arduino-cli.go @@ -576,10 +576,14 @@ func (inst *ArduinoCLIInstance) PlatformUpgrade(ctx context.Context, packager, a return installCl, err } -// PlatformList calls the "PlatformList" gRPC method. -func (inst *ArduinoCLIInstance) PlatformList(ctx context.Context) (*commands.PlatformListResponse, error) { - req := &commands.PlatformListRequest{Instance: inst.instance} - logCallf(">>> PlatformList(%+v)\n", req) - resp, err := inst.cli.daemonClient.PlatformList(ctx, req) +// PlatformSearch calls the "PlatformSearch" gRPC method. +func (inst *ArduinoCLIInstance) PlatformSearch(ctx context.Context, args string, all bool) (*commands.PlatformSearchResponse, error) { + req := &commands.PlatformSearchRequest{ + Instance: inst.instance, + SearchArgs: args, + AllVersions: all, + } + logCallf(">>> PlatformSearch(%+v)\n", req) + resp, err := inst.cli.daemonClient.PlatformSearch(ctx, req) return resp, err } diff --git a/internal/integrationtest/board/hardware_loading_test.go b/internal/integrationtest/board/hardware_loading_test.go index 54bf8cffa14..9b2a6d44e10 100644 --- a/internal/integrationtest/board/hardware_loading_test.go +++ b/internal/integrationtest/board/hardware_loading_test.go @@ -50,18 +50,22 @@ func TestHardwareLoading(t *testing.T) { jsonOut.MustContain(`[ { "id": "arduino:avr", - "installed": "1.8.6", - "name": "Arduino AVR Boards", - "boards": [ - { - "name": "Arduino Uno", - "fqbn": "arduino:avr:uno" - }, - { - "name": "Arduino Yún", - "fqbn": "arduino:avr:yun" + "installed_version": "1.8.6", + "releases": { + "1.8.6": { + "name": "Arduino AVR Boards", + "boards": [ + { + "name": "Arduino Uno", + "fqbn": "arduino:avr:uno" + }, + { + "name": "Arduino Yún", + "fqbn": "arduino:avr:yun" + } + ] } - ] + } } ]`) } @@ -90,7 +94,7 @@ func TestHardwareLoading(t *testing.T) { "id": "avrispmkii", "name": "AVRISP mkII" } - ] + ] }`) } @@ -159,33 +163,40 @@ func TestHardwareLoading(t *testing.T) { jsonOut.MustContain(`[ { "id": "arduino:avr", - "installed": "1.8.6", - "name": "Arduino AVR Boards", - "boards": [ - { - "name": "Arduino Uno", - "fqbn": "arduino:avr:uno" - }, - { - "name": "Arduino Yún", - "fqbn": "arduino:avr:yun" + "installed_version": "1.8.6", + "releases": { + "1.8.6": { + "name": "Arduino AVR Boards", + "boards": [ + { + "name": "Arduino Uno", + "fqbn": "arduino:avr:uno" + }, + { + "name": "Arduino Yún", + "fqbn": "arduino:avr:yun" + } + ] } - ] + } } ]`) jsonOut.MustContain(`[ { "id": "my_avr_platform:avr", - "installed": "9.9.9", - "name": "My AVR Boards", - "boards": [ - { - "name": "Arduino Yún", - "fqbn": "my_avr_platform:avr:custom_yun" + "installed_version": "9.9.9", + "releases": { + "9.9.9": { + "name": "My AVR Boards", + "boards": [ + { + "name": "Arduino Yún", + "fqbn": "my_avr_platform:avr:custom_yun" + } + ] } - ], - "manually_installed": true, - "missing_metadata": true + }, + "manually_installed": true } ]`) @@ -196,7 +207,10 @@ func TestHardwareLoading(t *testing.T) { { "id": "my_symlinked_avr_platform:avr", "manually_installed": true, - "missing_metadata": true + "releases": { + "9.9.9": { + } + } } ]`) } @@ -226,7 +240,7 @@ func TestHardwareLoading(t *testing.T) { "id": "avrispmkii", "name": "AVRISP mkII" } - ] + ] }`) } diff --git a/internal/integrationtest/core/core_test.go b/internal/integrationtest/core/core_test.go index 89e8ecc2a87..c5762d3beb6 100644 --- a/internal/integrationtest/core/core_test.go +++ b/internal/integrationtest/core/core_test.go @@ -48,7 +48,17 @@ func TestCorrectHandlingOfPlatformVersionProperty(t *testing.T) { // Trigger problematic call out, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Contains(t, out, `[{"id":"DxCore-dev:megaavr","installed":"1.4.10","name":"DxCore"}]`) + requirejson.Contains(t, out, `[ + { + "id":"DxCore-dev:megaavr", + "installed_version":"1.4.10", + "releases": { + "1.4.10": { + "name":"DxCore" + } + } + } + ]`) } func TestCoreSearch(t *testing.T) { @@ -73,8 +83,8 @@ func TestCoreSearch(t *testing.T) { out, _, err = cli.Run("core", "search", "avr", "--format", "json") require.NoError(t, err) requirejson.NotEmpty(t, out) - // Verify that "installed" is set - requirejson.Contains(t, out, `[{installed: "1.8.6"}]`) + // Verify that "installed_version" is set + requirejson.Contains(t, out, `[{installed_version: "1.8.6"}]`) // additional URL out, _, err = cli.Run("core", "search", "test_core", "--format", "json", "--additional-urls="+url.String()) @@ -84,10 +94,10 @@ func TestCoreSearch(t *testing.T) { // show all versions out, _, err = cli.Run("core", "search", "test_core", "--all", "--format", "json", "--additional-urls="+url.String()) require.NoError(t, err) - requirejson.Len(t, out, 3) + requirejson.Query(t, out, `.[].releases | length`, "3") checkPlatformIsInJSONOutput := func(stdout []byte, id, version string) { - jqquery := fmt.Sprintf(`[{id:"%s", latest:"%s"}]`, id, version) + jqquery := fmt.Sprintf(`[{id:"%s", releases:{"%s":{}}}]`, id, version) requirejson.Contains(t, out, jqquery, "platform %s@%s is missing from the output", id, version) } @@ -171,7 +181,7 @@ func TestCoreSearchNoArgs(t *testing.T) { // same thing in JSON format, also check the number of platforms found is the same stdout, _, err = cli.Run("core", "search", "--format", "json") require.NoError(t, err) - requirejson.Contains(t, stdout, `[ { "name":"test_core" } ]`) + requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "2.0.0": {"name":"test_core"}}}]`) requirejson.Query(t, stdout, "length", fmt.Sprint(numPlatforms)) // list all with additional urls, check the test core is there @@ -188,8 +198,10 @@ func TestCoreSearchNoArgs(t *testing.T) { // same thing in JSON format, also check the number of platforms found is the same stdout, _, err = cli.Run("core", "search", "--format", "json", "--additional-urls="+url.String()) require.NoError(t, err) - requirejson.Contains(t, stdout, `[ { "name":"test_core" } ]`) - requirejson.Query(t, stdout, "length", fmt.Sprint(numPlatforms)) + requirejson.Contains(t, stdout, `[{"id": "test:x86", "releases": { "3.0.0": {"name":"test_core"}}}]`) + // A platform could contain multiple releases, we get the length of how many releases are present for each platform + // and we sum them to see if the expected numers matches. + requirejson.Query(t, stdout, `[.[].releases | length] | add`, fmt.Sprint(numPlatforms)) } func TestCoreUpdateIndexUrlNotFound(t *testing.T) { @@ -303,7 +315,7 @@ func TestCoreInstall(t *testing.T) { require.NoError(t, err) stdout, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, `"1.6.16"`) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, `"1.6.16"`) // Replace it with the same with --no-overwrite (should NOT fail) _, _, err = cli.Run("core", "install", "arduino:avr@1.6.16", "--no-overwrite") @@ -318,22 +330,22 @@ func TestCoreInstall(t *testing.T) { require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, `"1.6.17"`) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, `"1.6.17"`) // Confirm core is listed as "updatable" stdout, _, err = cli.Run("core", "list", "--updatable", "--format", "json") require.NoError(t, err) jsonout := requirejson.Parse(t, stdout) q := jsonout.Query(`.[] | select(.id == "arduino:avr")`) - q.Query(".installed").MustEqual(`"1.6.17"`) - latest := q.Query(".latest") + q.Query(".installed_version").MustEqual(`"1.6.17"`) + latest := q.Query(".latest_version") // Upgrade the core to latest version _, _, err = cli.Run("core", "upgrade", "arduino:avr") require.NoError(t, err) stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) - requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed`, latest.String()) + requirejson.Query(t, stdout, `.[] | select(.id == "arduino:avr") | .installed_version`, latest.String()) // double check the core isn't updatable anymore stdout, _, err = cli.Run("core", "list", "--updatable", "--format", "json") @@ -483,10 +495,14 @@ func TestCoreListAllManuallyInstalledCore(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-development:avr", - "latest": "1.8.3", - "name": "Arduino AVR Boards" + "latest_version": "1.8.3", + "releases": { + "1.8.3": { + "name": "Arduino AVR Boards" + } } - ]`) + } + ]`) } func TestCoreListUpdatableAllFlags(t *testing.T) { @@ -519,10 +535,14 @@ func TestCoreListUpdatableAllFlags(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-development:avr", - "latest": "1.8.3", - "name": "Arduino AVR Boards" + "latest_version": "1.8.3", + "releases": { + "1.8.3": { + "name": "Arduino AVR Boards" + } } - ]`) + } + ]`) } func TestCoreUpgradeRemovesUnusedTools(t *testing.T) { @@ -592,7 +612,11 @@ func TestCoreListWithInstalledJson(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "adafruit:avr", - "name": "Adafruit AVR Boards" + "releases": { + "1.4.13": { + "name": "Adafruit AVR Boards" + } + } } ]`) @@ -614,7 +638,11 @@ func TestCoreListWithInstalledJson(t *testing.T) { requirejson.Contains(t, stdout, `[ { "id": "adafruit:avr", - "name": "Adafruit Boards" + "releases": { + "1.4.13": { + "name": "Adafruit Boards" + } + } } ]`) } @@ -699,20 +727,20 @@ func TestCoreSearchSortedResults(t *testing.T) { // verify that results are already sorted correctly sortedDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated == true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated == true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedDeprecated, notSortedDeprecated) sortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated != true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated != true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedNotDeprecated, notSortedNotDeprecated) // verify that deprecated platforms are the last ones platform := requirejson.Parse(t, stdout).Query( - "[.[] | .name |=ascii_downcase | .name]").String() + "[ .[] | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, platform, strings.TrimRight(notSortedNotDeprecated, "]")+","+strings.TrimLeft(notSortedDeprecated, "[")) } @@ -771,20 +799,20 @@ func TestCoreListSortedResults(t *testing.T) { // verify that results are already sorted correctly sortedDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated == true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated == true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated == true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedDeprecated, notSortedDeprecated) sortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[ .[] | select(.deprecated != true) | .name |=ascii_downcase | .name ] | sort").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name] | sort").String() notSortedNotDeprecated := requirejson.Parse(t, stdout).Query( - "[.[] | select(.deprecated != true) | .name |=ascii_downcase | .name]").String() + "[ .[] | select(.deprecated != true) | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, sortedNotDeprecated, notSortedNotDeprecated) // verify that deprecated platforms are the last ones platform := requirejson.Parse(t, stdout).Query( - "[.[] | .name |=ascii_downcase | .name]").String() + "[ .[] | {name: .releases[.latest_version].name} | .name |=ascii_downcase | .name]").String() require.Equal(t, platform, strings.TrimRight(notSortedNotDeprecated, "]")+","+strings.TrimLeft(notSortedDeprecated, "[")) } @@ -842,8 +870,8 @@ func TestCoreListPlatformWithoutPlatformTxt(t *testing.T) { stdout, _, err = cli.Run("core", "list", "--format", "json") require.NoError(t, err) requirejson.Len(t, stdout, 1) - requirejson.Query(t, stdout, ".[] | .id", "\"some-packager:some-arch\"") - requirejson.Query(t, stdout, ".[] | .name", "\"some-packager-some-arch\"") + requirejson.Query(t, stdout, ".[] | .id", `"some-packager:some-arch"`) + requirejson.Query(t, stdout, ".[] | .releases[.installed_version].name", `"some-packager-some-arch"`) } func TestCoreDownloadMultiplePlatforms(t *testing.T) { @@ -903,25 +931,25 @@ func TestCoreWithMissingCustomBoardOptionsIsLoaded(t *testing.T) { require.NoError(t, err) requirejson.Len(t, stdout, 1) // Verifies platform is loaded except excluding board with missing options - requirejson.Contains(t, stdout, `[ - { - "id": "arduino-beta-dev:platform_with_missing_custom_board_options" - } - ]`) - requirejson.Query(t, stdout, ".[] | select(.id == \"arduino-beta-dev:platform_with_missing_custom_board_options\") | .boards | length", "2") + requirejson.Contains(t, stdout, `[{"id": "arduino-beta-dev:platform_with_missing_custom_board_options"}]`) + requirejson.Query(t, stdout, ".[] | select(.id == \"arduino-beta-dev:platform_with_missing_custom_board_options\") | .releases[.installed_version].boards | length", "2") // Verify board with malformed options is not loaded // while other board is loaded requirejson.Contains(t, stdout, `[ { "id": "arduino-beta-dev:platform_with_missing_custom_board_options", - "boards": [ - { - "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" - }, - { - "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra" + "releases": { + "4.2.0": { + "boards": [ + { + "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:nessuno" + }, + { + "fqbn": "arduino-beta-dev:platform_with_missing_custom_board_options:altra" + } + ] } - ] + } } ]`) } @@ -940,10 +968,10 @@ func TestCoreListOutdatedCore(t *testing.T) { stdout, _, err := cli.Run("core", "list", "--format", "json") require.NoError(t, err) requirejson.Len(t, stdout, 1) - requirejson.Query(t, stdout, ".[0] | .installed", "\"1.8.6\"") - installedVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .installed").String(), "\"")) + requirejson.Query(t, stdout, ".[0] | .installed_version", "\"1.8.6\"") + installedVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .installed_version").String(), "\"")) require.NoError(t, err) - latestVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .latest").String(), "\"")) + latestVersion, err := semver.Parse(strings.Trim(requirejson.Parse(t, stdout).Query(".[0] | .latest_version").String(), "\"")) require.NoError(t, err) // Installed version must be older than latest require.True(t, installedVersion.LessThan(latestVersion)) diff --git a/internal/integrationtest/daemon/daemon_test.go b/internal/integrationtest/daemon/daemon_test.go index 7e49db88111..6c02b5f3b22 100644 --- a/internal/integrationtest/daemon/daemon_test.go +++ b/internal/integrationtest/daemon/daemon_test.go @@ -104,7 +104,7 @@ func TestDaemonAutoUpdateIndexOnFirstInit(t *testing.T) { fmt.Printf("INIT> %v\n", ir.GetMessage()) })) - _, err := grpcInst.PlatformList(context.Background()) + _, err := grpcInst.PlatformSearch(context.Background(), "", true) require.NoError(t, err) require.FileExists(t, cli.DataDir().Join("package_index.json").String()) @@ -477,8 +477,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.NoError(t, upgradeError) require.NotNil(t, platform) - require.True(t, platform.Indexed) // the esp866 is present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present + require.True(t, platform.Metadata.Indexed) // the esp866 is present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present }) t.Run("and install.json is missing", func(t *testing.T) { env, cli := createEnvForDaemon(t) @@ -497,9 +497,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.NoError(t, upgradeError) require.NotNil(t, platform) - require.True(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present because the old version got upgraded - + require.True(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present because the old version got upgraded }) }) @@ -521,8 +520,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) require.NotNil(t, platform) - require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.False(t, platform.MissingMetadata) // install.json is present + require.False(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.False(t, platform.Release.MissingMetadata) // install.json is present }) t.Run("missing both additional URLs and install.json", func(t *testing.T) { env, cli := createEnvForDaemon(t) @@ -546,8 +545,8 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) { platform, upgradeError := analyzePlatformUpgradeClient(plUpgrade) require.ErrorIs(t, upgradeError, (&arduino.PlatformAlreadyAtTheLatestVersionError{Platform: "esp8266:esp8266"}).ToRPCStatus().Err()) require.NotNil(t, platform) - require.False(t, platform.Indexed) // the esp866 is not present in the additional-urls - require.True(t, platform.MissingMetadata) // install.json is present + require.False(t, platform.Metadata.Indexed) // the esp866 is not present in the additional-urls + require.True(t, platform.Release.MissingMetadata) // install.json is present }) }) } diff --git a/internal/orderedmap/orderedmap.go b/internal/orderedmap/orderedmap.go new file mode 100644 index 00000000000..0dce816863d --- /dev/null +++ b/internal/orderedmap/orderedmap.go @@ -0,0 +1,184 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package orderedmap + +import ( + "bytes" + "encoding/json" + "fmt" + "slices" +) + +// Map is a map that keeps ordering insertion. +type Map[K any, V any] interface { + Get(K) V + GetOk(key K) (V, bool) + Set(K, V) + Size() int + ContainsKey(key K) bool + Keys() []K + Merge(...Map[K, V]) Map[K, V] + SortKeys(f func(x, y K) int) + SortStableKeys(f func(x, y K) int) + Values() []V + Clone() Map[K, V] + Remove(key K) + MarshalJSON() ([]byte, error) +} + +type scalars interface { + ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | + ~uint16 | ~uint32 | ~uint64 | ~uintptr | ~float32 | ~float64 | ~string +} + +// NewWithConversionFunc creates a map using the given conversion function +// to convert non-comparable key type to comparable items. +// The conversion function must be bijective. +func NewWithConversionFunc[K any, V any, C scalars](conv func(K) C) Map[K, V] { + return &mapImpl[K, V, C]{ + conv: conv, + kv: map[C]V{}, + o: []K{}, + } +} + +// New creates a map +func New[K scalars, V any]() Map[K, V] { + return &mapImpl[K, V, K]{ + conv: func(in K) K { return in }, // identity + kv: map[K]V{}, + o: []K{}, + } +} + +type mapImpl[K any, V any, C scalars] struct { + conv func(K) C + kv map[C]V + o []K +} + +// Get retrieves the value corresponding to key +func (m *mapImpl[K, V, C]) Get(key K) V { + return m.kv[m.conv(key)] +} + +// GetOk retrieves the value corresponding to key and returns a true/false indicator +// to check if the key is present in the map (true if the key is present) +func (m *mapImpl[K, V, C]) GetOk(key K) (V, bool) { + v, ok := m.kv[m.conv(key)] + return v, ok +} + +// ContainsKey returns true if the map contains the specified key +func (m *mapImpl[K, V, C]) ContainsKey(key K) bool { + _, has := m.kv[m.conv(key)] + return has +} + +// MarshalJSON marshal the map into json mantaining the order of the key +func (m *mapImpl[K, V, C]) MarshalJSON() ([]byte, error) { + if m.Size() == 0 { + return []byte("{}"), nil + } + var buf bytes.Buffer + buf.WriteByte('{') + encoder := json.NewEncoder(&buf) + for _, k := range m.o { + // Here we convert non string keys in string. + if err := encoder.Encode(fmt.Sprintf("%v", m.conv(k))); err != nil { + return nil, err + } + buf.WriteByte(':') + if err := encoder.Encode(m.kv[m.conv(k)]); err != nil { + return nil, err + } + buf.WriteByte(',') + } + buf.Truncate(buf.Len() - 1) // remove last `,` + buf.WriteByte('}') + return buf.Bytes(), nil +} + +// Set inserts or replaces an existing key-value pair in the map +func (m *mapImpl[K, V, C]) Set(key K, value V) { + compKey := m.conv(key) + if _, has := m.kv[compKey]; has { + m.Remove(key) + } + m.kv[compKey] = value + m.o = append(m.o, key) +} + +// Size returns the number of elements in the map +func (m *mapImpl[K, V, C]) Size() int { + return len(m.kv) +} + +// Remove removes the key from the map +func (m *mapImpl[K, V, C]) Remove(key K) { + compKey := m.conv(key) + delete(m.kv, compKey) + for i, k := range m.o { + if m.conv(k) == compKey { + m.o = append(m.o[:i], m.o[i+1:]...) + return + } + } +} + +// Merge merges other Maps into this one. Each key/value of the merged Maps replaces +// the key/value present in the original Map. +func (m *mapImpl[K, V, C]) Merge(sources ...Map[K, V]) Map[K, V] { + for _, source := range sources { + for _, key := range source.Keys() { + value := source.Get(key) + m.Set(key, value) + } + } + return m +} + +// Keys returns an array of the keys contained in the Map +func (m *mapImpl[K, V, C]) Keys() []K { + keys := make([]K, len(m.o)) + copy(keys, m.o) + return keys +} + +func (m *mapImpl[K, V, C]) SortKeys(f func(x, y K) int) { + slices.SortFunc(m.o, f) +} + +func (m *mapImpl[K, V, C]) SortStableKeys(f func(x, y K) int) { + slices.SortStableFunc(m.o, f) +} + +// Values returns an array of the values contained in the Map. Duplicated +// values are repeated in the list accordingly. +func (m *mapImpl[K, V, C]) Values() []V { + values := make([]V, len(m.o)) + for i, key := range m.o { + values[i] = m.kv[m.conv(key)] + } + return values +} + +// Clone makes a copy of the Map +func (m *mapImpl[K, V, C]) Clone() Map[K, V] { + clone := NewWithConversionFunc[K, V, C](m.conv) + clone.Merge(m) + return clone +} diff --git a/internal/orderedmap/orderedmap_test.go b/internal/orderedmap/orderedmap_test.go new file mode 100644 index 00000000000..bd7975f1949 --- /dev/null +++ b/internal/orderedmap/orderedmap_test.go @@ -0,0 +1,361 @@ +// This file is part of arduino-cli. +// +// Copyright 2023 ARDUINO SA (http://www.arduino.cc/) +// +// This software is released under the GNU General Public License version 3, +// which covers the main part of arduino-cli. +// The terms of this license can be found at: +// https://www.gnu.org/licenses/gpl-3.0.en.html +// +// You can be released from the requirements of the above licenses by purchasing +// a commercial license. Buying such a license is mandatory if you want to +// modify or otherwise use the software for commercial activities involving the +// Arduino software without disclosing the source code of your own applications. +// To purchase a commercial license, send an email to license@arduino.cc. + +package orderedmap_test + +import ( + "testing" + + "github.com/arduino/arduino-cli/internal/orderedmap" + "github.com/stretchr/testify/require" +) + +func TestGet(t *testing.T) { + t.Run("the key is a string", func(t *testing.T) { + m := orderedmap.New[string, int]() + + require.Zero(t, m.Get("not-existing-key")) + v, ok := m.GetOk("not-existing-key") + require.Zero(t, v) + require.False(t, ok) + + m.Set("existing-key", 1) + require.Equal(t, 1, m.Get("existing-key")) + v, ok = m.GetOk("existing-key") + require.Equal(t, 1, v) + require.True(t, ok) + + // test empty key + m.Set("", 2) + require.Equal(t, 2, m.Get("")) + v, ok = m.GetOk("") + require.Equal(t, 2, v) + require.True(t, ok) + }) + + t.Run("the key is int", func(t *testing.T) { + m := orderedmap.New[int, int]() + + require.Equal(t, 0, m.Get(1)) + v, ok := m.GetOk(1) + require.Zero(t, v) + require.False(t, ok) + + m.Set(1, 1) + require.Equal(t, 1, m.Get(1)) + v, ok = m.GetOk(1) + require.Equal(t, 1, v) + require.True(t, ok) + + // test empty key + m.Set(0, 2) + require.Equal(t, 2, m.Get(0)) + v, ok = m.GetOk(0) + require.Equal(t, 2, v) + require.True(t, ok) + }) + + t.Run("custom comparable key", func(t *testing.T) { + type A struct { + b []byte + } + m := orderedmap.NewWithConversionFunc[*A, int, string]( + func(a *A) string { + if a == nil { + return "" + } + return string(a.b) + }, + ) + require.Zero(t, m.Get(&A{})) + require.Zero(t, m.Get(nil)) + + // Here we're using the conversion function to set the key, using a different + // pointer to retrieve the value works. + m.Set(&A{b: []byte{60, 61, 62}}, 1) + require.Equal(t, 1, m.Get(&A{b: []byte{60, 61, 62}})) + + m.Set(nil, 2) + require.Equal(t, 2, m.Get(nil)) + }) +} + +func TestSet(t *testing.T) { + t.Run("insert 3 different keys", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("b", 2) + m.Set("c", 3) + require.Equal(t, 1, m.Get("a")) + require.Equal(t, 2, m.Get("b")) + require.Equal(t, 3, m.Get("c")) + }) + t.Run("insert equal keys", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("a", 2) + require.Equal(t, 2, m.Get("a")) + }) +} + +func TestSize(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Zero(t, m.Size()) + }) + t.Run("one element", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.Equal(t, 1, m.Size()) + }) + t.Run("three elements", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("c", true) + require.Equal(t, 3, m.Size()) + }) + t.Run("insert same keys result in size 1", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("a", false) + m.Set("a", true) + require.Equal(t, 1, m.Size()) + }) +} + +func TestKeys(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Empty(t, m.Keys()) + }) + t.Run("one element", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.Len(t, m.Keys(), 1) + }) + t.Run("keys respect order of insertion", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("c", true) + require.Equal(t, []string{"a", "b", "c"}, m.Keys()) + }) + t.Run("replacing a key changes the ordering", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Set("a", false) + require.Equal(t, []string{"b", "a"}, m.Keys()) + }) + t.Run("delete a key", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Remove("a") + require.Equal(t, []string{"b"}, m.Keys()) + }) +} + +func TestRemove(t *testing.T) { + t.Run("key doesn't exist", func(t *testing.T) { + m := orderedmap.New[string, bool]() + require.Zero(t, m.Get("not-existing-key")) + m.Remove("not-existing-key") + require.Zero(t, m.Get("not-existing-key")) + }) + t.Run("key exist", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + require.True(t, m.Get("a")) + + m.Remove("a") + require.False(t, m.Get("a")) + }) + t.Run("key deletion doesn't affect other keys", func(t *testing.T) { + m := orderedmap.New[string, bool]() + m.Set("a", true) + m.Set("b", true) + m.Remove("a") + require.True(t, m.Get("b")) + _, ok := m.GetOk("a") + require.False(t, ok) + }) +} + +func TestMerge(t *testing.T) { + t.Run("merge empty maps", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m2 := orderedmap.New[string, int]() + + merged := m1.Merge(m2) + require.Equal(t, m1, merged) + require.Len(t, m1.Keys(), 0) + }) + + t.Run("merge multiple elements", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + + m2 := orderedmap.New[string, int]() + m2.Set("d", 4) + m2.Set("e", 5) + + // assert that the Merge return is m1 + merged := m1.Merge(m2) + require.Equal(t, m1, merged) + + // assert we find the merged elements in the map + require.Equal(t, 5, m1.Size()) + require.Equal(t, 4, m1.Get("d")) + require.Equal(t, 5, m1.Get("e")) + require.Equal(t, []string{"a", "b", "c", "d", "e"}, m1.Keys()) + + require.Equal(t, []string{"d", "e"}, m2.Keys()) + }) +} + +func TestSortKeys(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + require.Equal(t, []string{}, m1.Keys()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []string{}, m1.Keys()) + }) + t.Run("sort ascending", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("c", 3) + m1.Set("b", 2) + m1.Set("a", 1) + m1.Set("z", 4) + + require.Equal(t, []string{"c", "b", "a", "z"}, m1.Keys()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []string{"a", "b", "c", "z"}, m1.Keys()) + }) +} + +func TestValues(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + require.Empty(t, m1.Values()) + }) + t.Run("values respect order of insertion", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + require.Equal(t, []int{1, 2, 3}, m1.Values()) + }) + t.Run("after a key sort values respect the new order", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("c", 3) + m1.Set("b", 2) + m1.Set("a", 1) + m1.Set("z", 4) + require.Equal(t, []int{3, 2, 1, 4}, m1.Values()) + m1.SortKeys(func(x, y string) int { + if x < y { + return -1 + } + return 1 + }) + require.Equal(t, []int{1, 2, 3, 4}, m1.Values()) + }) +} + +func TestClone(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + clone := m1.Clone() + require.NotEqual(t, m1, clone) + require.Equal(t, m1.Keys(), clone.Keys()) + require.Equal(t, m1.Values(), clone.Values()) + }) + t.Run("clone doesn't affect the original map", func(t *testing.T) { + m1 := orderedmap.New[string, int]() + m1.Set("a", 1) + m1.Set("b", 2) + m1.Set("c", 3) + + clone := m1.Clone() + + require.NotEqual(t, m1, clone) + require.Equal(t, m1.Keys(), clone.Keys()) + require.Equal(t, m1.Values(), clone.Values()) + + clone.Set("d", 4) + require.Equal(t, 4, clone.Get("d")) + _, ok := m1.GetOk("d") + require.False(t, ok) + }) +} + +func TestMarshallJSON(t *testing.T) { + t.Run("empty map", func(t *testing.T) { + m := orderedmap.New[string, int]() + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{}`, string(mapJSON)) + }) + t.Run("respect the order of insertion", func(t *testing.T) { + m := orderedmap.New[string, int]() + m.Set("a", 1) + m.Set("b", 2) + m.Set("c", 3) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"a":1,"b":2,"c":3}`, string(mapJSON)) + }) + t.Run("can serialize int keys", func(t *testing.T) { + m := orderedmap.New[int, bool]() + m.Set(1, true) + m.Set(2, true) + m.Set(3, true) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"1":true,"2":true,"3":true}`, string(mapJSON)) + }) + t.Run("can serialize pointer keys", func(t *testing.T) { + m := orderedmap.NewWithConversionFunc[*int, bool, int](func(i *int) int { + if i == nil { + return 0 + } + return *i + }) + m.Set(toPtr(1), true) + m.Set(toPtr(2), true) + m.Set(toPtr(3), true) + mapJSON, err := m.MarshalJSON() + require.NoError(t, err) + require.JSONEq(t, `{"1":true,"2":true,"3":true}`, string(mapJSON)) + }) +} + +func toPtr[V any](v V) *V { + return &v +} diff --git a/rpc/cc/arduino/cli/commands/v1/commands.pb.go b/rpc/cc/arduino/cli/commands/v1/commands.pb.go index 67afa35e70b..059e6b238de 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/commands.pb.go @@ -1664,7 +1664,7 @@ var file_cc_arduino_cli_commands_v1_commands_proto_rawDesc = []byte{ 0x49, 0x4c, 0x45, 0x44, 0x5f, 0x49, 0x4e, 0x53, 0x54, 0x41, 0x4e, 0x43, 0x45, 0x5f, 0x49, 0x4e, 0x49, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x53, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x44, 0x45, 0x58, 0x5f, 0x44, 0x4f, 0x57, 0x4e, 0x4c, 0x4f, 0x41, 0x44, 0x5f, 0x45, 0x52, 0x52, 0x4f, 0x52, 0x10, 0x04, - 0x32, 0xab, 0x27, 0x0a, 0x12, 0x41, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x43, 0x6f, 0x72, 0x65, + 0x32, 0xb8, 0x26, 0x0a, 0x12, 0x41, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x43, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x61, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, @@ -1860,130 +1860,123 @@ var file_cc_arduino_cli_commands_v1_commands_proto_rawDesc = []byte{ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x71, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2f, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x32, 0x2e, 0x63, 0x63, + 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x33, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x63, 0x63, 0x2e, 0x61, - 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x0f, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x32, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, - 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x44, 0x6f, 0x77, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x31, 0x2e, 0x63, 0x63, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, - 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, + 0x61, 0x64, 0x65, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, - 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, - 0x67, 0x72, 0x61, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, - 0x82, 0x01, 0x0a, 0x11, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, - 0x76, 0x31, 0x2e, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, - 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x63, - 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, + 0x11, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, + 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, + 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, + 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x5a, 0x69, 0x70, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, + 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, + 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x7f, 0x0a, 0x10, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, + 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x33, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x35, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, - 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, - 0x74, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x7f, 0x0a, 0x10, 0x4c, 0x69, 0x62, - 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x33, 0x2e, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, + 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, - 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x82, 0x01, 0x0a, 0x11, 0x4c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, - 0x12, 0x34, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, - 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, - 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, - 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, - 0x9b, 0x01, 0x0a, 0x1a, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3d, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, + 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, + 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x55, 0x70, 0x67, 0x72, 0x61, 0x64, 0x65, 0x41, + 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x9b, 0x01, 0x0a, + 0x1a, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, + 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, 0x65, 0x73, 0x12, 0x3d, 0x2e, 0x63, 0x63, + 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, + 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3e, 0x2e, 0x63, 0x63, 0x2e, + 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x63, 0x69, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, 0x0d, 0x4c, 0x69, + 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x30, 0x2e, 0x63, 0x63, + 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, + 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x44, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x65, - 0x6e, 0x63, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x74, 0x0a, - 0x0d, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x30, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, 0x72, - 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, - 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x62, 0x72, 0x61, 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x6e, 0x0a, 0x0b, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x2e, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, - 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, - 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x66, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x2a, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, - 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x63, 0x2e, + 0x72, 0x79, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x6e, 0x0a, 0x0b, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x12, + 0x2e, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2f, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x62, + 0x72, 0x61, 0x72, 0x79, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x66, 0x0a, 0x07, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x2a, 0x2e, 0x63, 0x63, + 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, + 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x1c, 0x45, 0x6e, 0x75, + 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, + 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, 0x2e, 0x63, 0x63, 0x2e, 0x61, + 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, + 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, + 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x30, 0x01, 0x12, 0xa1, 0x01, 0x0a, 0x1c, - 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x3f, 0x2e, 0x63, - 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x40, 0x2e, - 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x62, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, + 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x50, 0x6f, 0x72, 0x74, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x05, + 0x44, 0x65, 0x62, 0x75, 0x67, 0x12, 0x28, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, + 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x62, + 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, + 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x44, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, - 0x01, 0x30, 0x01, 0x12, 0x79, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x31, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, + 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, 0x6e, 0x66, 0x69, - 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x62, 0x75, 0x67, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x48, - 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, - 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, - 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, - 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x48, 0x5a, 0x46, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, + 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, + 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, + 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2046,52 +2039,50 @@ var file_cc_arduino_cli_commands_v1_commands_proto_goTypes = []interface{}{ (*ListProgrammersAvailableForUploadRequest)(nil), // 42: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest (*BurnBootloaderRequest)(nil), // 43: cc.arduino.cli.commands.v1.BurnBootloaderRequest (*PlatformSearchRequest)(nil), // 44: cc.arduino.cli.commands.v1.PlatformSearchRequest - (*PlatformListRequest)(nil), // 45: cc.arduino.cli.commands.v1.PlatformListRequest - (*LibraryDownloadRequest)(nil), // 46: cc.arduino.cli.commands.v1.LibraryDownloadRequest - (*LibraryInstallRequest)(nil), // 47: cc.arduino.cli.commands.v1.LibraryInstallRequest - (*LibraryUpgradeRequest)(nil), // 48: cc.arduino.cli.commands.v1.LibraryUpgradeRequest - (*ZipLibraryInstallRequest)(nil), // 49: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest - (*GitLibraryInstallRequest)(nil), // 50: cc.arduino.cli.commands.v1.GitLibraryInstallRequest - (*LibraryUninstallRequest)(nil), // 51: cc.arduino.cli.commands.v1.LibraryUninstallRequest - (*LibraryUpgradeAllRequest)(nil), // 52: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest - (*LibraryResolveDependenciesRequest)(nil), // 53: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest - (*LibrarySearchRequest)(nil), // 54: cc.arduino.cli.commands.v1.LibrarySearchRequest - (*LibraryListRequest)(nil), // 55: cc.arduino.cli.commands.v1.LibraryListRequest - (*MonitorRequest)(nil), // 56: cc.arduino.cli.commands.v1.MonitorRequest - (*EnumerateMonitorPortSettingsRequest)(nil), // 57: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest - (*DebugRequest)(nil), // 58: cc.arduino.cli.commands.v1.DebugRequest - (*GetDebugConfigRequest)(nil), // 59: cc.arduino.cli.commands.v1.GetDebugConfigRequest - (*BoardDetailsResponse)(nil), // 60: cc.arduino.cli.commands.v1.BoardDetailsResponse - (*BoardListResponse)(nil), // 61: cc.arduino.cli.commands.v1.BoardListResponse - (*BoardListAllResponse)(nil), // 62: cc.arduino.cli.commands.v1.BoardListAllResponse - (*BoardSearchResponse)(nil), // 63: cc.arduino.cli.commands.v1.BoardSearchResponse - (*BoardListWatchResponse)(nil), // 64: cc.arduino.cli.commands.v1.BoardListWatchResponse - (*CompileResponse)(nil), // 65: cc.arduino.cli.commands.v1.CompileResponse - (*PlatformInstallResponse)(nil), // 66: cc.arduino.cli.commands.v1.PlatformInstallResponse - (*PlatformDownloadResponse)(nil), // 67: cc.arduino.cli.commands.v1.PlatformDownloadResponse - (*PlatformUninstallResponse)(nil), // 68: cc.arduino.cli.commands.v1.PlatformUninstallResponse - (*PlatformUpgradeResponse)(nil), // 69: cc.arduino.cli.commands.v1.PlatformUpgradeResponse - (*UploadResponse)(nil), // 70: cc.arduino.cli.commands.v1.UploadResponse - (*UploadUsingProgrammerResponse)(nil), // 71: cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse - (*SupportedUserFieldsResponse)(nil), // 72: cc.arduino.cli.commands.v1.SupportedUserFieldsResponse - (*ListProgrammersAvailableForUploadResponse)(nil), // 73: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse - (*BurnBootloaderResponse)(nil), // 74: cc.arduino.cli.commands.v1.BurnBootloaderResponse - (*PlatformSearchResponse)(nil), // 75: cc.arduino.cli.commands.v1.PlatformSearchResponse - (*PlatformListResponse)(nil), // 76: cc.arduino.cli.commands.v1.PlatformListResponse - (*LibraryDownloadResponse)(nil), // 77: cc.arduino.cli.commands.v1.LibraryDownloadResponse - (*LibraryInstallResponse)(nil), // 78: cc.arduino.cli.commands.v1.LibraryInstallResponse - (*LibraryUpgradeResponse)(nil), // 79: cc.arduino.cli.commands.v1.LibraryUpgradeResponse - (*ZipLibraryInstallResponse)(nil), // 80: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse - (*GitLibraryInstallResponse)(nil), // 81: cc.arduino.cli.commands.v1.GitLibraryInstallResponse - (*LibraryUninstallResponse)(nil), // 82: cc.arduino.cli.commands.v1.LibraryUninstallResponse - (*LibraryUpgradeAllResponse)(nil), // 83: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse - (*LibraryResolveDependenciesResponse)(nil), // 84: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse - (*LibrarySearchResponse)(nil), // 85: cc.arduino.cli.commands.v1.LibrarySearchResponse - (*LibraryListResponse)(nil), // 86: cc.arduino.cli.commands.v1.LibraryListResponse - (*MonitorResponse)(nil), // 87: cc.arduino.cli.commands.v1.MonitorResponse - (*EnumerateMonitorPortSettingsResponse)(nil), // 88: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse - (*DebugResponse)(nil), // 89: cc.arduino.cli.commands.v1.DebugResponse - (*GetDebugConfigResponse)(nil), // 90: cc.arduino.cli.commands.v1.GetDebugConfigResponse + (*LibraryDownloadRequest)(nil), // 45: cc.arduino.cli.commands.v1.LibraryDownloadRequest + (*LibraryInstallRequest)(nil), // 46: cc.arduino.cli.commands.v1.LibraryInstallRequest + (*LibraryUpgradeRequest)(nil), // 47: cc.arduino.cli.commands.v1.LibraryUpgradeRequest + (*ZipLibraryInstallRequest)(nil), // 48: cc.arduino.cli.commands.v1.ZipLibraryInstallRequest + (*GitLibraryInstallRequest)(nil), // 49: cc.arduino.cli.commands.v1.GitLibraryInstallRequest + (*LibraryUninstallRequest)(nil), // 50: cc.arduino.cli.commands.v1.LibraryUninstallRequest + (*LibraryUpgradeAllRequest)(nil), // 51: cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest + (*LibraryResolveDependenciesRequest)(nil), // 52: cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest + (*LibrarySearchRequest)(nil), // 53: cc.arduino.cli.commands.v1.LibrarySearchRequest + (*LibraryListRequest)(nil), // 54: cc.arduino.cli.commands.v1.LibraryListRequest + (*MonitorRequest)(nil), // 55: cc.arduino.cli.commands.v1.MonitorRequest + (*EnumerateMonitorPortSettingsRequest)(nil), // 56: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest + (*DebugRequest)(nil), // 57: cc.arduino.cli.commands.v1.DebugRequest + (*GetDebugConfigRequest)(nil), // 58: cc.arduino.cli.commands.v1.GetDebugConfigRequest + (*BoardDetailsResponse)(nil), // 59: cc.arduino.cli.commands.v1.BoardDetailsResponse + (*BoardListResponse)(nil), // 60: cc.arduino.cli.commands.v1.BoardListResponse + (*BoardListAllResponse)(nil), // 61: cc.arduino.cli.commands.v1.BoardListAllResponse + (*BoardSearchResponse)(nil), // 62: cc.arduino.cli.commands.v1.BoardSearchResponse + (*BoardListWatchResponse)(nil), // 63: cc.arduino.cli.commands.v1.BoardListWatchResponse + (*CompileResponse)(nil), // 64: cc.arduino.cli.commands.v1.CompileResponse + (*PlatformInstallResponse)(nil), // 65: cc.arduino.cli.commands.v1.PlatformInstallResponse + (*PlatformDownloadResponse)(nil), // 66: cc.arduino.cli.commands.v1.PlatformDownloadResponse + (*PlatformUninstallResponse)(nil), // 67: cc.arduino.cli.commands.v1.PlatformUninstallResponse + (*PlatformUpgradeResponse)(nil), // 68: cc.arduino.cli.commands.v1.PlatformUpgradeResponse + (*UploadResponse)(nil), // 69: cc.arduino.cli.commands.v1.UploadResponse + (*UploadUsingProgrammerResponse)(nil), // 70: cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse + (*SupportedUserFieldsResponse)(nil), // 71: cc.arduino.cli.commands.v1.SupportedUserFieldsResponse + (*ListProgrammersAvailableForUploadResponse)(nil), // 72: cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse + (*BurnBootloaderResponse)(nil), // 73: cc.arduino.cli.commands.v1.BurnBootloaderResponse + (*PlatformSearchResponse)(nil), // 74: cc.arduino.cli.commands.v1.PlatformSearchResponse + (*LibraryDownloadResponse)(nil), // 75: cc.arduino.cli.commands.v1.LibraryDownloadResponse + (*LibraryInstallResponse)(nil), // 76: cc.arduino.cli.commands.v1.LibraryInstallResponse + (*LibraryUpgradeResponse)(nil), // 77: cc.arduino.cli.commands.v1.LibraryUpgradeResponse + (*ZipLibraryInstallResponse)(nil), // 78: cc.arduino.cli.commands.v1.ZipLibraryInstallResponse + (*GitLibraryInstallResponse)(nil), // 79: cc.arduino.cli.commands.v1.GitLibraryInstallResponse + (*LibraryUninstallResponse)(nil), // 80: cc.arduino.cli.commands.v1.LibraryUninstallResponse + (*LibraryUpgradeAllResponse)(nil), // 81: cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse + (*LibraryResolveDependenciesResponse)(nil), // 82: cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse + (*LibrarySearchResponse)(nil), // 83: cc.arduino.cli.commands.v1.LibrarySearchResponse + (*LibraryListResponse)(nil), // 84: cc.arduino.cli.commands.v1.LibraryListResponse + (*MonitorResponse)(nil), // 85: cc.arduino.cli.commands.v1.MonitorResponse + (*EnumerateMonitorPortSettingsResponse)(nil), // 86: cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse + (*DebugResponse)(nil), // 87: cc.arduino.cli.commands.v1.DebugResponse + (*GetDebugConfigResponse)(nil), // 88: cc.arduino.cli.commands.v1.GetDebugConfigResponse } var file_cc_arduino_cli_commands_v1_commands_proto_depIdxs = []int32{ 24, // 0: cc.arduino.cli.commands.v1.CreateResponse.instance:type_name -> cc.arduino.cli.commands.v1.Instance @@ -2135,64 +2126,62 @@ var file_cc_arduino_cli_commands_v1_commands_proto_depIdxs = []int32{ 42, // 38: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:input_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadRequest 43, // 39: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:input_type -> cc.arduino.cli.commands.v1.BurnBootloaderRequest 44, // 40: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:input_type -> cc.arduino.cli.commands.v1.PlatformSearchRequest - 45, // 41: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformList:input_type -> cc.arduino.cli.commands.v1.PlatformListRequest - 46, // 42: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:input_type -> cc.arduino.cli.commands.v1.LibraryDownloadRequest - 47, // 43: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:input_type -> cc.arduino.cli.commands.v1.LibraryInstallRequest - 48, // 44: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeRequest - 49, // 45: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:input_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallRequest - 50, // 46: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:input_type -> cc.arduino.cli.commands.v1.GitLibraryInstallRequest - 51, // 47: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:input_type -> cc.arduino.cli.commands.v1.LibraryUninstallRequest - 52, // 48: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest - 53, // 49: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:input_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest - 54, // 50: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:input_type -> cc.arduino.cli.commands.v1.LibrarySearchRequest - 55, // 51: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:input_type -> cc.arduino.cli.commands.v1.LibraryListRequest - 56, // 52: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:input_type -> cc.arduino.cli.commands.v1.MonitorRequest - 57, // 53: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:input_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest - 58, // 54: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:input_type -> cc.arduino.cli.commands.v1.DebugRequest - 59, // 55: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:input_type -> cc.arduino.cli.commands.v1.GetDebugConfigRequest - 2, // 56: cc.arduino.cli.commands.v1.ArduinoCoreService.Create:output_type -> cc.arduino.cli.commands.v1.CreateResponse - 4, // 57: cc.arduino.cli.commands.v1.ArduinoCoreService.Init:output_type -> cc.arduino.cli.commands.v1.InitResponse - 7, // 58: cc.arduino.cli.commands.v1.ArduinoCoreService.Destroy:output_type -> cc.arduino.cli.commands.v1.DestroyResponse - 9, // 59: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateIndex:output_type -> cc.arduino.cli.commands.v1.UpdateIndexResponse - 11, // 60: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateLibrariesIndex:output_type -> cc.arduino.cli.commands.v1.UpdateLibrariesIndexResponse - 13, // 61: cc.arduino.cli.commands.v1.ArduinoCoreService.Version:output_type -> cc.arduino.cli.commands.v1.VersionResponse - 15, // 62: cc.arduino.cli.commands.v1.ArduinoCoreService.NewSketch:output_type -> cc.arduino.cli.commands.v1.NewSketchResponse - 18, // 63: cc.arduino.cli.commands.v1.ArduinoCoreService.LoadSketch:output_type -> cc.arduino.cli.commands.v1.LoadSketchResponse - 20, // 64: cc.arduino.cli.commands.v1.ArduinoCoreService.ArchiveSketch:output_type -> cc.arduino.cli.commands.v1.ArchiveSketchResponse - 22, // 65: cc.arduino.cli.commands.v1.ArduinoCoreService.SetSketchDefaults:output_type -> cc.arduino.cli.commands.v1.SetSketchDefaultsResponse - 60, // 66: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardDetails:output_type -> cc.arduino.cli.commands.v1.BoardDetailsResponse - 61, // 67: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardList:output_type -> cc.arduino.cli.commands.v1.BoardListResponse - 62, // 68: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListAll:output_type -> cc.arduino.cli.commands.v1.BoardListAllResponse - 63, // 69: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardSearch:output_type -> cc.arduino.cli.commands.v1.BoardSearchResponse - 64, // 70: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListWatch:output_type -> cc.arduino.cli.commands.v1.BoardListWatchResponse - 65, // 71: cc.arduino.cli.commands.v1.ArduinoCoreService.Compile:output_type -> cc.arduino.cli.commands.v1.CompileResponse - 66, // 72: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformInstall:output_type -> cc.arduino.cli.commands.v1.PlatformInstallResponse - 67, // 73: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformDownload:output_type -> cc.arduino.cli.commands.v1.PlatformDownloadResponse - 68, // 74: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUninstall:output_type -> cc.arduino.cli.commands.v1.PlatformUninstallResponse - 69, // 75: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUpgrade:output_type -> cc.arduino.cli.commands.v1.PlatformUpgradeResponse - 70, // 76: cc.arduino.cli.commands.v1.ArduinoCoreService.Upload:output_type -> cc.arduino.cli.commands.v1.UploadResponse - 71, // 77: cc.arduino.cli.commands.v1.ArduinoCoreService.UploadUsingProgrammer:output_type -> cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse - 72, // 78: cc.arduino.cli.commands.v1.ArduinoCoreService.SupportedUserFields:output_type -> cc.arduino.cli.commands.v1.SupportedUserFieldsResponse - 73, // 79: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:output_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse - 74, // 80: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:output_type -> cc.arduino.cli.commands.v1.BurnBootloaderResponse - 75, // 81: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:output_type -> cc.arduino.cli.commands.v1.PlatformSearchResponse - 76, // 82: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformList:output_type -> cc.arduino.cli.commands.v1.PlatformListResponse - 77, // 83: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:output_type -> cc.arduino.cli.commands.v1.LibraryDownloadResponse - 78, // 84: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:output_type -> cc.arduino.cli.commands.v1.LibraryInstallResponse - 79, // 85: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeResponse - 80, // 86: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:output_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallResponse - 81, // 87: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:output_type -> cc.arduino.cli.commands.v1.GitLibraryInstallResponse - 82, // 88: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:output_type -> cc.arduino.cli.commands.v1.LibraryUninstallResponse - 83, // 89: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse - 84, // 90: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:output_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse - 85, // 91: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:output_type -> cc.arduino.cli.commands.v1.LibrarySearchResponse - 86, // 92: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:output_type -> cc.arduino.cli.commands.v1.LibraryListResponse - 87, // 93: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:output_type -> cc.arduino.cli.commands.v1.MonitorResponse - 88, // 94: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:output_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse - 89, // 95: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:output_type -> cc.arduino.cli.commands.v1.DebugResponse - 90, // 96: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:output_type -> cc.arduino.cli.commands.v1.GetDebugConfigResponse - 56, // [56:97] is the sub-list for method output_type - 15, // [15:56] is the sub-list for method input_type + 45, // 41: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:input_type -> cc.arduino.cli.commands.v1.LibraryDownloadRequest + 46, // 42: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:input_type -> cc.arduino.cli.commands.v1.LibraryInstallRequest + 47, // 43: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeRequest + 48, // 44: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:input_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallRequest + 49, // 45: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:input_type -> cc.arduino.cli.commands.v1.GitLibraryInstallRequest + 50, // 46: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:input_type -> cc.arduino.cli.commands.v1.LibraryUninstallRequest + 51, // 47: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:input_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllRequest + 52, // 48: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:input_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesRequest + 53, // 49: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:input_type -> cc.arduino.cli.commands.v1.LibrarySearchRequest + 54, // 50: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:input_type -> cc.arduino.cli.commands.v1.LibraryListRequest + 55, // 51: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:input_type -> cc.arduino.cli.commands.v1.MonitorRequest + 56, // 52: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:input_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsRequest + 57, // 53: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:input_type -> cc.arduino.cli.commands.v1.DebugRequest + 58, // 54: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:input_type -> cc.arduino.cli.commands.v1.GetDebugConfigRequest + 2, // 55: cc.arduino.cli.commands.v1.ArduinoCoreService.Create:output_type -> cc.arduino.cli.commands.v1.CreateResponse + 4, // 56: cc.arduino.cli.commands.v1.ArduinoCoreService.Init:output_type -> cc.arduino.cli.commands.v1.InitResponse + 7, // 57: cc.arduino.cli.commands.v1.ArduinoCoreService.Destroy:output_type -> cc.arduino.cli.commands.v1.DestroyResponse + 9, // 58: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateIndex:output_type -> cc.arduino.cli.commands.v1.UpdateIndexResponse + 11, // 59: cc.arduino.cli.commands.v1.ArduinoCoreService.UpdateLibrariesIndex:output_type -> cc.arduino.cli.commands.v1.UpdateLibrariesIndexResponse + 13, // 60: cc.arduino.cli.commands.v1.ArduinoCoreService.Version:output_type -> cc.arduino.cli.commands.v1.VersionResponse + 15, // 61: cc.arduino.cli.commands.v1.ArduinoCoreService.NewSketch:output_type -> cc.arduino.cli.commands.v1.NewSketchResponse + 18, // 62: cc.arduino.cli.commands.v1.ArduinoCoreService.LoadSketch:output_type -> cc.arduino.cli.commands.v1.LoadSketchResponse + 20, // 63: cc.arduino.cli.commands.v1.ArduinoCoreService.ArchiveSketch:output_type -> cc.arduino.cli.commands.v1.ArchiveSketchResponse + 22, // 64: cc.arduino.cli.commands.v1.ArduinoCoreService.SetSketchDefaults:output_type -> cc.arduino.cli.commands.v1.SetSketchDefaultsResponse + 59, // 65: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardDetails:output_type -> cc.arduino.cli.commands.v1.BoardDetailsResponse + 60, // 66: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardList:output_type -> cc.arduino.cli.commands.v1.BoardListResponse + 61, // 67: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListAll:output_type -> cc.arduino.cli.commands.v1.BoardListAllResponse + 62, // 68: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardSearch:output_type -> cc.arduino.cli.commands.v1.BoardSearchResponse + 63, // 69: cc.arduino.cli.commands.v1.ArduinoCoreService.BoardListWatch:output_type -> cc.arduino.cli.commands.v1.BoardListWatchResponse + 64, // 70: cc.arduino.cli.commands.v1.ArduinoCoreService.Compile:output_type -> cc.arduino.cli.commands.v1.CompileResponse + 65, // 71: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformInstall:output_type -> cc.arduino.cli.commands.v1.PlatformInstallResponse + 66, // 72: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformDownload:output_type -> cc.arduino.cli.commands.v1.PlatformDownloadResponse + 67, // 73: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUninstall:output_type -> cc.arduino.cli.commands.v1.PlatformUninstallResponse + 68, // 74: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformUpgrade:output_type -> cc.arduino.cli.commands.v1.PlatformUpgradeResponse + 69, // 75: cc.arduino.cli.commands.v1.ArduinoCoreService.Upload:output_type -> cc.arduino.cli.commands.v1.UploadResponse + 70, // 76: cc.arduino.cli.commands.v1.ArduinoCoreService.UploadUsingProgrammer:output_type -> cc.arduino.cli.commands.v1.UploadUsingProgrammerResponse + 71, // 77: cc.arduino.cli.commands.v1.ArduinoCoreService.SupportedUserFields:output_type -> cc.arduino.cli.commands.v1.SupportedUserFieldsResponse + 72, // 78: cc.arduino.cli.commands.v1.ArduinoCoreService.ListProgrammersAvailableForUpload:output_type -> cc.arduino.cli.commands.v1.ListProgrammersAvailableForUploadResponse + 73, // 79: cc.arduino.cli.commands.v1.ArduinoCoreService.BurnBootloader:output_type -> cc.arduino.cli.commands.v1.BurnBootloaderResponse + 74, // 80: cc.arduino.cli.commands.v1.ArduinoCoreService.PlatformSearch:output_type -> cc.arduino.cli.commands.v1.PlatformSearchResponse + 75, // 81: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryDownload:output_type -> cc.arduino.cli.commands.v1.LibraryDownloadResponse + 76, // 82: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryInstall:output_type -> cc.arduino.cli.commands.v1.LibraryInstallResponse + 77, // 83: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgrade:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeResponse + 78, // 84: cc.arduino.cli.commands.v1.ArduinoCoreService.ZipLibraryInstall:output_type -> cc.arduino.cli.commands.v1.ZipLibraryInstallResponse + 79, // 85: cc.arduino.cli.commands.v1.ArduinoCoreService.GitLibraryInstall:output_type -> cc.arduino.cli.commands.v1.GitLibraryInstallResponse + 80, // 86: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUninstall:output_type -> cc.arduino.cli.commands.v1.LibraryUninstallResponse + 81, // 87: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryUpgradeAll:output_type -> cc.arduino.cli.commands.v1.LibraryUpgradeAllResponse + 82, // 88: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryResolveDependencies:output_type -> cc.arduino.cli.commands.v1.LibraryResolveDependenciesResponse + 83, // 89: cc.arduino.cli.commands.v1.ArduinoCoreService.LibrarySearch:output_type -> cc.arduino.cli.commands.v1.LibrarySearchResponse + 84, // 90: cc.arduino.cli.commands.v1.ArduinoCoreService.LibraryList:output_type -> cc.arduino.cli.commands.v1.LibraryListResponse + 85, // 91: cc.arduino.cli.commands.v1.ArduinoCoreService.Monitor:output_type -> cc.arduino.cli.commands.v1.MonitorResponse + 86, // 92: cc.arduino.cli.commands.v1.ArduinoCoreService.EnumerateMonitorPortSettings:output_type -> cc.arduino.cli.commands.v1.EnumerateMonitorPortSettingsResponse + 87, // 93: cc.arduino.cli.commands.v1.ArduinoCoreService.Debug:output_type -> cc.arduino.cli.commands.v1.DebugResponse + 88, // 94: cc.arduino.cli.commands.v1.ArduinoCoreService.GetDebugConfig:output_type -> cc.arduino.cli.commands.v1.GetDebugConfigResponse + 55, // [55:95] is the sub-list for method output_type + 15, // [15:55] is the sub-list for method input_type 15, // [15:15] is the sub-list for extension type_name 15, // [15:15] is the sub-list for extension extendee 0, // [0:15] is the sub-list for field type_name diff --git a/rpc/cc/arduino/cli/commands/v1/commands.proto b/rpc/cc/arduino/cli/commands/v1/commands.proto index d16aab2c5a5..294f91d7742 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands.proto +++ b/rpc/cc/arduino/cli/commands/v1/commands.proto @@ -131,9 +131,6 @@ service ArduinoCoreService { // Search for a platform in the platforms indexes. rpc PlatformSearch(PlatformSearchRequest) returns (PlatformSearchResponse); - // List all installed platforms. - rpc PlatformList(PlatformListRequest) returns (PlatformListResponse); - // Download the archive file of an Arduino library in the libraries index to // the staging directory. rpc LibraryDownload(LibraryDownloadRequest) diff --git a/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go b/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go index 454d07dd5d2..2c7ce7dfd42 100644 --- a/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/commands_grpc.pb.go @@ -60,7 +60,6 @@ const ( ArduinoCoreService_ListProgrammersAvailableForUpload_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/ListProgrammersAvailableForUpload" ArduinoCoreService_BurnBootloader_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/BurnBootloader" ArduinoCoreService_PlatformSearch_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformSearch" - ArduinoCoreService_PlatformList_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/PlatformList" ArduinoCoreService_LibraryDownload_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryDownload" ArduinoCoreService_LibraryInstall_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryInstall" ArduinoCoreService_LibraryUpgrade_FullMethodName = "/cc.arduino.cli.commands.v1.ArduinoCoreService/LibraryUpgrade" @@ -139,8 +138,6 @@ type ArduinoCoreServiceClient interface { BurnBootloader(ctx context.Context, in *BurnBootloaderRequest, opts ...grpc.CallOption) (ArduinoCoreService_BurnBootloaderClient, error) // Search for a platform in the platforms indexes. PlatformSearch(ctx context.Context, in *PlatformSearchRequest, opts ...grpc.CallOption) (*PlatformSearchResponse, error) - // List all installed platforms. - PlatformList(ctx context.Context, in *PlatformListRequest, opts ...grpc.CallOption) (*PlatformListResponse, error) // Download the archive file of an Arduino library in the libraries index to // the staging directory. LibraryDownload(ctx context.Context, in *LibraryDownloadRequest, opts ...grpc.CallOption) (ArduinoCoreService_LibraryDownloadClient, error) @@ -690,15 +687,6 @@ func (c *arduinoCoreServiceClient) PlatformSearch(ctx context.Context, in *Platf return out, nil } -func (c *arduinoCoreServiceClient) PlatformList(ctx context.Context, in *PlatformListRequest, opts ...grpc.CallOption) (*PlatformListResponse, error) { - out := new(PlatformListResponse) - err := c.cc.Invoke(ctx, ArduinoCoreService_PlatformList_FullMethodName, in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *arduinoCoreServiceClient) LibraryDownload(ctx context.Context, in *LibraryDownloadRequest, opts ...grpc.CallOption) (ArduinoCoreService_LibraryDownloadClient, error) { stream, err := c.cc.NewStream(ctx, &ArduinoCoreService_ServiceDesc.Streams[12], ArduinoCoreService_LibraryDownload_FullMethodName, opts...) if err != nil { @@ -1092,8 +1080,6 @@ type ArduinoCoreServiceServer interface { BurnBootloader(*BurnBootloaderRequest, ArduinoCoreService_BurnBootloaderServer) error // Search for a platform in the platforms indexes. PlatformSearch(context.Context, *PlatformSearchRequest) (*PlatformSearchResponse, error) - // List all installed platforms. - PlatformList(context.Context, *PlatformListRequest) (*PlatformListResponse, error) // Download the archive file of an Arduino library in the libraries index to // the staging directory. LibraryDownload(*LibraryDownloadRequest, ArduinoCoreService_LibraryDownloadServer) error @@ -1208,9 +1194,6 @@ func (UnimplementedArduinoCoreServiceServer) BurnBootloader(*BurnBootloaderReque func (UnimplementedArduinoCoreServiceServer) PlatformSearch(context.Context, *PlatformSearchRequest) (*PlatformSearchResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PlatformSearch not implemented") } -func (UnimplementedArduinoCoreServiceServer) PlatformList(context.Context, *PlatformListRequest) (*PlatformListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PlatformList not implemented") -} func (UnimplementedArduinoCoreServiceServer) LibraryDownload(*LibraryDownloadRequest, ArduinoCoreService_LibraryDownloadServer) error { return status.Errorf(codes.Unimplemented, "method LibraryDownload not implemented") } @@ -1770,24 +1753,6 @@ func _ArduinoCoreService_PlatformSearch_Handler(srv interface{}, ctx context.Con return interceptor(ctx, in, info, handler) } -func _ArduinoCoreService_PlatformList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PlatformListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ArduinoCoreServiceServer).PlatformList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: ArduinoCoreService_PlatformList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ArduinoCoreServiceServer).PlatformList(ctx, req.(*PlatformListRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _ArduinoCoreService_LibraryDownload_Handler(srv interface{}, stream grpc.ServerStream) error { m := new(LibraryDownloadRequest) if err := stream.RecvMsg(m); err != nil { @@ -2140,10 +2105,6 @@ var ArduinoCoreService_ServiceDesc = grpc.ServiceDesc{ MethodName: "PlatformSearch", Handler: _ArduinoCoreService_PlatformSearch_Handler, }, - { - MethodName: "PlatformList", - Handler: _ArduinoCoreService_PlatformList_Handler, - }, { MethodName: "LibraryResolveDependencies", Handler: _ArduinoCoreService_LibraryResolveDependencies_Handler, diff --git a/rpc/cc/arduino/cli/commands/v1/common.go b/rpc/cc/arduino/cli/commands/v1/common.go index 9ef27da3e58..a04ebff193f 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.go +++ b/rpc/cc/arduino/cli/commands/v1/common.go @@ -15,6 +15,12 @@ package commands +import ( + "sort" + + semver "go.bug.st/relaxed-semver" +) + // DownloadProgressCB is a callback to get updates on download progress type DownloadProgressCB func(curr *DownloadProgress) @@ -56,3 +62,39 @@ func (d DownloadProgressCB) End(success bool, message string) { // TaskProgressCB is a callback to receive progress messages type TaskProgressCB func(msg *TaskProgress) + +// InstanceCommand is an interface that represents a gRPC command with +// a gRPC Instance. +type InstanceCommand interface { + GetInstance() *Instance +} + +// GetLatestRelease returns the latest release in this PlatformSummary, +// or nil if not available. +func (s *PlatformSummary) GetLatestRelease() *PlatformRelease { + if s.LatestVersion == "" { + return nil + } + return s.Releases[s.LatestVersion] +} + +// GetInstalledRelease returns the latest release in this PlatformSummary, +// or nil if not available. +func (s *PlatformSummary) GetInstalledRelease() *PlatformRelease { + if s.InstalledVersion == "" { + return nil + } + return s.Releases[s.InstalledVersion] +} + +// GetSortedReleases returns the releases in order of version. +func (s *PlatformSummary) GetSortedReleases() []*PlatformRelease { + res := []*PlatformRelease{} + for _, release := range s.GetReleases() { + res = append(res, release) + } + sort.SliceStable(res, func(i, j int) bool { + return semver.ParseRelaxed(res[i].Version).LessThan(semver.ParseRelaxed(res[j].Version)) + }) + return res +} diff --git a/rpc/cc/arduino/cli/commands/v1/common.pb.go b/rpc/cc/arduino/cli/commands/v1/common.pb.go index 90453bd45ea..fe1f4e1f700 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/common.pb.go @@ -488,47 +488,17 @@ func (x *Programmer) GetName() string { return "" } +// Platform is a structure containing all the information about a single +// platform release. type Platform struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Platform ID (e.g., `arduino:avr`). - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // Version of the platform. - Installed string `protobuf:"bytes,2,opt,name=installed,proto3" json:"installed,omitempty"` - // Newest available version of the platform. - Latest string `protobuf:"bytes,3,opt,name=latest,proto3" json:"latest,omitempty"` - // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - // Maintainer of the platform's package. - Maintainer string `protobuf:"bytes,5,opt,name=maintainer,proto3" json:"maintainer,omitempty"` - // A URL provided by the author of the platform's package, intended to point - // to their website. - Website string `protobuf:"bytes,6,opt,name=website,proto3" json:"website,omitempty"` - // Email of the maintainer of the platform's package. - Email string `protobuf:"bytes,7,opt,name=email,proto3" json:"email,omitempty"` - // List of boards provided by the platform. If the platform is installed, - // this is the boards listed in the platform's boards.txt. If the platform is - // not installed, this is an arbitrary list of board names provided by the - // platform author for display and may not match boards.txt. - Boards []*Board `protobuf:"bytes,8,rep,name=boards,proto3" json:"boards,omitempty"` - // If true this Platform has been installed manually in the user' sketchbook - // hardware folder - ManuallyInstalled bool `protobuf:"varint,9,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` - // If true this Platform has been deprecated - Deprecated bool `protobuf:"varint,10,opt,name=deprecated,proto3" json:"deprecated,omitempty"` - // Type of the platform. - Type []string `protobuf:"bytes,11,rep,name=type,proto3" json:"type,omitempty"` - // A URL provided by the author of the platform's package, intended to point - // to their online help service. - Help *HelpResources `protobuf:"bytes,12,opt,name=help,proto3" json:"help,omitempty"` - // If true the platform is indexed - Indexed bool `protobuf:"varint,13,opt,name=indexed,proto3" json:"indexed,omitempty"` - // This field is true when the platform is installed with the Arduino IDE 1.8. - // If the platform is also not indexed it may fail to work correctly in some - // circumstances, and it may need to be re-installed. - MissingMetadata bool `protobuf:"varint,14,opt,name=missing_metadata,json=missingMetadata,proto3" json:"missing_metadata,omitempty"` + // Generic information about a platform + Metadata *PlatformMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Information about a specific release of a platform + Release *PlatformRelease `protobuf:"bytes,2,opt,name=release,proto3" json:"release,omitempty"` } func (x *Platform) Reset() { @@ -563,100 +533,320 @@ func (*Platform) Descriptor() ([]byte, []int) { return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{7} } -func (x *Platform) GetId() string { +func (x *Platform) GetMetadata() *PlatformMetadata { if x != nil { - return x.Id + return x.Metadata } - return "" + return nil } -func (x *Platform) GetInstalled() string { +func (x *Platform) GetRelease() *PlatformRelease { if x != nil { - return x.Installed + return x.Release + } + return nil +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +type PlatformSummary struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Generic information about a platform + Metadata *PlatformMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // Maps version to the corresponding PlatformRelease + Releases map[string]*PlatformRelease `protobuf:"bytes,2,rep,name=releases,proto3" json:"releases,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // The installed version of the platform, or empty string if none installed + InstalledVersion string `protobuf:"bytes,3,opt,name=installed_version,json=installedVersion,proto3" json:"installed_version,omitempty"` + // The latest available version of the platform, or empty if none available + LatestVersion string `protobuf:"bytes,4,opt,name=latest_version,json=latestVersion,proto3" json:"latest_version,omitempty"` +} + +func (x *PlatformSummary) Reset() { + *x = PlatformSummary{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformSummary) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformSummary) ProtoMessage() {} + +func (x *PlatformSummary) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformSummary.ProtoReflect.Descriptor instead. +func (*PlatformSummary) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{8} +} + +func (x *PlatformSummary) GetMetadata() *PlatformMetadata { + if x != nil { + return x.Metadata + } + return nil +} + +func (x *PlatformSummary) GetReleases() map[string]*PlatformRelease { + if x != nil { + return x.Releases + } + return nil +} + +func (x *PlatformSummary) GetInstalledVersion() string { + if x != nil { + return x.InstalledVersion } return "" } -func (x *Platform) GetLatest() string { +func (x *PlatformSummary) GetLatestVersion() string { if x != nil { - return x.Latest + return x.LatestVersion } return "" } -func (x *Platform) GetName() string { +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +type PlatformMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Platform ID (e.g., `arduino:avr`). + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // Maintainer of the platform's package. + Maintainer string `protobuf:"bytes,2,opt,name=maintainer,proto3" json:"maintainer,omitempty"` + // A URL provided by the author of the platform's package, intended to point + // to their website. + Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` + // Email of the maintainer of the platform's package. + Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + ManuallyInstalled bool `protobuf:"varint,5,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` + // True if the latest release of this Platform has been deprecated + Deprecated bool `protobuf:"varint,6,opt,name=deprecated,proto3" json:"deprecated,omitempty"` + // If true the platform is indexed + Indexed bool `protobuf:"varint,7,opt,name=indexed,proto3" json:"indexed,omitempty"` +} + +func (x *PlatformMetadata) Reset() { + *x = PlatformMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformMetadata) ProtoMessage() {} + +func (x *PlatformMetadata) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformMetadata.ProtoReflect.Descriptor instead. +func (*PlatformMetadata) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{9} +} + +func (x *PlatformMetadata) GetId() string { if x != nil { - return x.Name + return x.Id } return "" } -func (x *Platform) GetMaintainer() string { +func (x *PlatformMetadata) GetMaintainer() string { if x != nil { return x.Maintainer } return "" } -func (x *Platform) GetWebsite() string { +func (x *PlatformMetadata) GetWebsite() string { if x != nil { return x.Website } return "" } -func (x *Platform) GetEmail() string { +func (x *PlatformMetadata) GetEmail() string { if x != nil { return x.Email } return "" } -func (x *Platform) GetBoards() []*Board { +func (x *PlatformMetadata) GetManuallyInstalled() bool { if x != nil { - return x.Boards + return x.ManuallyInstalled } - return nil + return false } -func (x *Platform) GetManuallyInstalled() bool { +func (x *PlatformMetadata) GetDeprecated() bool { if x != nil { - return x.ManuallyInstalled + return x.Deprecated } return false } -func (x *Platform) GetDeprecated() bool { +func (x *PlatformMetadata) GetIndexed() bool { if x != nil { - return x.Deprecated + return x.Indexed } return false } -func (x *Platform) GetType() []string { +// PlatformRelease contains information about a specific release of a platform. +type PlatformRelease struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Version of the platform release + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + // Type of the platform. + Type []string `protobuf:"bytes,3,rep,name=type,proto3" json:"type,omitempty"` + // True if the platform is installed + Installed bool `protobuf:"varint,4,opt,name=installed,proto3" json:"installed,omitempty"` + // List of boards provided by the platform. If the platform is installed, + // this is the boards listed in the platform's boards.txt. If the platform is + // not installed, this is an arbitrary list of board names provided by the + // platform author for display and may not match boards.txt. + Boards []*Board `protobuf:"bytes,5,rep,name=boards,proto3" json:"boards,omitempty"` + // A URL provided by the author of the platform's package, intended to point + // to their online help service. + Help *HelpResources `protobuf:"bytes,6,opt,name=help,proto3" json:"help,omitempty"` + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + MissingMetadata bool `protobuf:"varint,7,opt,name=missing_metadata,json=missingMetadata,proto3" json:"missing_metadata,omitempty"` + // True this release is deprecated + Deprecated bool `protobuf:"varint,8,opt,name=deprecated,proto3" json:"deprecated,omitempty"` +} + +func (x *PlatformRelease) Reset() { + *x = PlatformRelease{} + if protoimpl.UnsafeEnabled { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PlatformRelease) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PlatformRelease) ProtoMessage() {} + +func (x *PlatformRelease) ProtoReflect() protoreflect.Message { + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PlatformRelease.ProtoReflect.Descriptor instead. +func (*PlatformRelease) Descriptor() ([]byte, []int) { + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{10} +} + +func (x *PlatformRelease) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PlatformRelease) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *PlatformRelease) GetType() []string { if x != nil { return x.Type } return nil } -func (x *Platform) GetHelp() *HelpResources { +func (x *PlatformRelease) GetInstalled() bool { + if x != nil { + return x.Installed + } + return false +} + +func (x *PlatformRelease) GetBoards() []*Board { + if x != nil { + return x.Boards + } + return nil +} + +func (x *PlatformRelease) GetHelp() *HelpResources { if x != nil { return x.Help } return nil } -func (x *Platform) GetIndexed() bool { +func (x *PlatformRelease) GetMissingMetadata() bool { if x != nil { - return x.Indexed + return x.MissingMetadata } return false } -func (x *Platform) GetMissingMetadata() bool { +func (x *PlatformRelease) GetDeprecated() bool { if x != nil { - return x.MissingMetadata + return x.Deprecated } return false } @@ -679,7 +869,7 @@ type InstalledPlatformReference struct { func (x *InstalledPlatformReference) Reset() { *x = InstalledPlatformReference{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -692,7 +882,7 @@ func (x *InstalledPlatformReference) String() string { func (*InstalledPlatformReference) ProtoMessage() {} func (x *InstalledPlatformReference) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -705,7 +895,7 @@ func (x *InstalledPlatformReference) ProtoReflect() protoreflect.Message { // Deprecated: Use InstalledPlatformReference.ProtoReflect.Descriptor instead. func (*InstalledPlatformReference) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{8} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{11} } func (x *InstalledPlatformReference) GetId() string { @@ -751,7 +941,7 @@ type Board struct { func (x *Board) Reset() { *x = Board{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -764,7 +954,7 @@ func (x *Board) String() string { func (*Board) ProtoMessage() {} func (x *Board) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -777,7 +967,7 @@ func (x *Board) ProtoReflect() protoreflect.Message { // Deprecated: Use Board.ProtoReflect.Descriptor instead. func (*Board) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{9} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{12} } func (x *Board) GetName() string { @@ -808,7 +998,7 @@ type Profile struct { func (x *Profile) Reset() { *x = Profile{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -821,7 +1011,7 @@ func (x *Profile) String() string { func (*Profile) ProtoMessage() {} func (x *Profile) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -834,7 +1024,7 @@ func (x *Profile) ProtoReflect() protoreflect.Message { // Deprecated: Use Profile.ProtoReflect.Descriptor instead. func (*Profile) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{10} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{13} } func (x *Profile) GetName() string { @@ -864,7 +1054,7 @@ type HelpResources struct { func (x *HelpResources) Reset() { *x = HelpResources{} if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -877,7 +1067,7 @@ func (x *HelpResources) String() string { func (*HelpResources) ProtoMessage() {} func (x *HelpResources) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11] + mi := &file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -890,7 +1080,7 @@ func (x *HelpResources) ProtoReflect() protoreflect.Message { // Deprecated: Use HelpResources.ProtoReflect.Descriptor instead. func (*HelpResources) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{11} + return file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP(), []int{14} } func (x *HelpResources) GetOnline() string { @@ -951,59 +1141,96 @@ var file_cc_arduino_cli_commands_v1_common_proto_rawDesc = []byte{ 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xd6, 0x03, 0x0a, 0x08, 0x50, 0x6c, 0x61, - 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, - 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x1e, 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, - 0x18, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, - 0x39, 0x0a, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, - 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x61, - 0x72, 0x64, 0x52, 0x06, 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, 0x2d, 0x0a, 0x12, 0x6d, 0x61, - 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, - 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x3d, 0x0a, - 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9b, 0x01, 0x0a, 0x08, 0x50, 0x6c, 0x61, + 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, + 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, + 0x45, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x07, 0x72, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x63, + 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x55, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, + 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, + 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x75, 0x6d, 0x6d, + 0x61, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x69, + 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, + 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0d, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, + 0x68, 0x0a, 0x0d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x41, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2b, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, + 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xdb, 0x01, 0x0a, 0x10, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x61, 0x69, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x18, + 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2d, + 0x0a, 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, + 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, + 0x61, 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x1e, 0x0a, + 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x18, 0x0a, + 0x07, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, + 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x22, 0xb6, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, + 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x39, 0x0a, 0x06, 0x62, + 0x6f, 0x61, 0x72, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, - 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x18, 0x0a, 0x07, - 0x69, 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, - 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, - 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x2f, 0x0a, 0x05, - 0x42, 0x6f, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x31, 0x0a, - 0x07, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, - 0x22, 0x27, 0x0a, 0x0d, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, - 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, - 0x63, 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, - 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6f, 0x61, 0x72, 0x64, 0x52, 0x06, + 0x62, 0x6f, 0x61, 0x72, 0x64, 0x73, 0x12, 0x3d, 0x0a, 0x04, 0x68, 0x65, 0x6c, 0x70, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, + 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, + 0x04, 0x68, 0x65, 0x6c, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x1e, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x22, 0x88, 0x01, 0x0a, 0x1a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, + 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x44, 0x69, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x61, + 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0a, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x55, 0x72, 0x6c, 0x22, 0x2f, 0x0a, 0x05, 0x42, + 0x6f, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x31, 0x0a, 0x07, + 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, + 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, + 0x27, 0x0a, 0x0d, 0x48, 0x65, 0x6c, 0x70, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6f, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, + 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, + 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1018,7 +1245,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_common_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_cc_arduino_cli_commands_v1_common_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_cc_arduino_cli_commands_v1_common_proto_goTypes = []interface{}{ (*Instance)(nil), // 0: cc.arduino.cli.commands.v1.Instance (*DownloadProgress)(nil), // 1: cc.arduino.cli.commands.v1.DownloadProgress @@ -1028,22 +1255,31 @@ var file_cc_arduino_cli_commands_v1_common_proto_goTypes = []interface{}{ (*TaskProgress)(nil), // 5: cc.arduino.cli.commands.v1.TaskProgress (*Programmer)(nil), // 6: cc.arduino.cli.commands.v1.Programmer (*Platform)(nil), // 7: cc.arduino.cli.commands.v1.Platform - (*InstalledPlatformReference)(nil), // 8: cc.arduino.cli.commands.v1.InstalledPlatformReference - (*Board)(nil), // 9: cc.arduino.cli.commands.v1.Board - (*Profile)(nil), // 10: cc.arduino.cli.commands.v1.Profile - (*HelpResources)(nil), // 11: cc.arduino.cli.commands.v1.HelpResources + (*PlatformSummary)(nil), // 8: cc.arduino.cli.commands.v1.PlatformSummary + (*PlatformMetadata)(nil), // 9: cc.arduino.cli.commands.v1.PlatformMetadata + (*PlatformRelease)(nil), // 10: cc.arduino.cli.commands.v1.PlatformRelease + (*InstalledPlatformReference)(nil), // 11: cc.arduino.cli.commands.v1.InstalledPlatformReference + (*Board)(nil), // 12: cc.arduino.cli.commands.v1.Board + (*Profile)(nil), // 13: cc.arduino.cli.commands.v1.Profile + (*HelpResources)(nil), // 14: cc.arduino.cli.commands.v1.HelpResources + nil, // 15: cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry } var file_cc_arduino_cli_commands_v1_common_proto_depIdxs = []int32{ 2, // 0: cc.arduino.cli.commands.v1.DownloadProgress.start:type_name -> cc.arduino.cli.commands.v1.DownloadProgressStart 3, // 1: cc.arduino.cli.commands.v1.DownloadProgress.update:type_name -> cc.arduino.cli.commands.v1.DownloadProgressUpdate 4, // 2: cc.arduino.cli.commands.v1.DownloadProgress.end:type_name -> cc.arduino.cli.commands.v1.DownloadProgressEnd - 9, // 3: cc.arduino.cli.commands.v1.Platform.boards:type_name -> cc.arduino.cli.commands.v1.Board - 11, // 4: cc.arduino.cli.commands.v1.Platform.help:type_name -> cc.arduino.cli.commands.v1.HelpResources - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 9, // 3: cc.arduino.cli.commands.v1.Platform.metadata:type_name -> cc.arduino.cli.commands.v1.PlatformMetadata + 10, // 4: cc.arduino.cli.commands.v1.Platform.release:type_name -> cc.arduino.cli.commands.v1.PlatformRelease + 9, // 5: cc.arduino.cli.commands.v1.PlatformSummary.metadata:type_name -> cc.arduino.cli.commands.v1.PlatformMetadata + 15, // 6: cc.arduino.cli.commands.v1.PlatformSummary.releases:type_name -> cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry + 12, // 7: cc.arduino.cli.commands.v1.PlatformRelease.boards:type_name -> cc.arduino.cli.commands.v1.Board + 14, // 8: cc.arduino.cli.commands.v1.PlatformRelease.help:type_name -> cc.arduino.cli.commands.v1.HelpResources + 10, // 9: cc.arduino.cli.commands.v1.PlatformSummary.ReleasesEntry.value:type_name -> cc.arduino.cli.commands.v1.PlatformRelease + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_common_proto_init() } @@ -1149,7 +1385,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InstalledPlatformReference); i { + switch v := v.(*PlatformSummary); i { case 0: return &v.state case 1: @@ -1161,7 +1397,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Board); i { + switch v := v.(*PlatformMetadata); i { case 0: return &v.state case 1: @@ -1173,7 +1409,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Profile); i { + switch v := v.(*PlatformRelease); i { case 0: return &v.state case 1: @@ -1185,6 +1421,42 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { } } file_cc_arduino_cli_commands_v1_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*InstalledPlatformReference); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Board); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Profile); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cc_arduino_cli_commands_v1_common_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HelpResources); i { case 0: return &v.state @@ -1208,7 +1480,7 @@ func file_cc_arduino_cli_commands_v1_common_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_common_proto_rawDesc, NumEnums: 0, - NumMessages: 12, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/cc/arduino/cli/commands/v1/common.proto b/rpc/cc/arduino/cli/commands/v1/common.proto index 3cb0425872f..fae80bab09b 100644 --- a/rpc/cc/arduino/cli/commands/v1/common.proto +++ b/rpc/cc/arduino/cli/commands/v1/common.proto @@ -71,43 +71,76 @@ message Programmer { string name = 3; } +// Platform is a structure containing all the information about a single +// platform release. message Platform { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Information about a specific release of a platform + PlatformRelease release = 2; +} + +// PlatformSummary is a structure containing all the information about +// a platform and all its available releases. +message PlatformSummary { + // Generic information about a platform + PlatformMetadata metadata = 1; + // Maps version to the corresponding PlatformRelease + map releases = 2; + // The installed version of the platform, or empty string if none installed + string installed_version = 3; + // The latest available version of the platform, or empty if none available + string latest_version = 4; +} + +// PlatformMetadata contains generic information about a platform (not +// correlated to a specific release). +message PlatformMetadata { // Platform ID (e.g., `arduino:avr`). string id = 1; - // Version of the platform. - string installed = 2; - // Newest available version of the platform. - string latest = 3; - // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). - string name = 4; // Maintainer of the platform's package. - string maintainer = 5; + string maintainer = 2; // A URL provided by the author of the platform's package, intended to point // to their website. - string website = 6; + string website = 3; // Email of the maintainer of the platform's package. - string email = 7; + string email = 4; + // If true this Platform has been installed manually in the user' sketchbook + // hardware folder + bool manually_installed = 5; + // True if the latest release of this Platform has been deprecated + bool deprecated = 6; + // If true the platform is indexed + bool indexed = 7; +} + +// PlatformRelease contains information about a specific release of a platform. +message PlatformRelease { + // Name used to identify the platform to humans (e.g., "Arduino AVR Boards"). + string name = 1; + // Version of the platform release + string version = 2; + // Type of the platform. + repeated string type = 3; + // True if the platform is installed + bool installed = 4; // List of boards provided by the platform. If the platform is installed, // this is the boards listed in the platform's boards.txt. If the platform is // not installed, this is an arbitrary list of board names provided by the // platform author for display and may not match boards.txt. - repeated Board boards = 8; - // If true this Platform has been installed manually in the user' sketchbook - // hardware folder - bool manually_installed = 9; - // If true this Platform has been deprecated - bool deprecated = 10; - // Type of the platform. - repeated string type = 11; + repeated Board boards = 5; // A URL provided by the author of the platform's package, intended to point // to their online help service. - HelpResources help = 12; - // If true the platform is indexed - bool indexed = 13; - // This field is true when the platform is installed with the Arduino IDE 1.8. - // If the platform is also not indexed it may fail to work correctly in some - // circumstances, and it may need to be re-installed. - bool missing_metadata = 14; + HelpResources help = 6; + // This field is true if the platform is missing installation metadata (this + // happens if the platform has been installed with the legacy Arduino IDE + // <=1.8.x). If the platform miss metadata and it's not indexed through a + // package index, it may fail to work correctly in some circumstances, and it + // may need to be reinstalled. This should be evaluated only when the + // PlatformRelease is `Installed` otherwise is an undefined behaviour. + bool missing_metadata = 7; + // True this release is deprecated + bool deprecated = 8; } message InstalledPlatformReference { diff --git a/rpc/cc/arduino/cli/commands/v1/core.pb.go b/rpc/cc/arduino/cli/commands/v1/core.pb.go index c12b21374d0..dca289c80fd 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.pb.go +++ b/rpc/cc/arduino/cli/commands/v1/core.pb.go @@ -685,6 +685,9 @@ type PlatformSearchRequest struct { // Whether to show all available versions. `false` causes only the newest // versions of the cores to be listed in the search results. AllVersions bool `protobuf:"varint,3,opt,name=all_versions,json=allVersions,proto3" json:"all_versions,omitempty"` + // Whether to show manually installed platforms. `false` causes to skip + // manually installed platforms. + ManuallyInstalled bool `protobuf:"varint,4,opt,name=manually_installed,json=manuallyInstalled,proto3" json:"manually_installed,omitempty"` } func (x *PlatformSearchRequest) Reset() { @@ -740,13 +743,20 @@ func (x *PlatformSearchRequest) GetAllVersions() bool { return false } +func (x *PlatformSearchRequest) GetManuallyInstalled() bool { + if x != nil { + return x.ManuallyInstalled + } + return false +} + type PlatformSearchResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // Results of the search. - SearchOutput []*Platform `protobuf:"bytes,1,rep,name=search_output,json=searchOutput,proto3" json:"search_output,omitempty"` + SearchOutput []*PlatformSummary `protobuf:"bytes,1,rep,name=search_output,json=searchOutput,proto3" json:"search_output,omitempty"` } func (x *PlatformSearchResponse) Reset() { @@ -781,130 +791,13 @@ func (*PlatformSearchResponse) Descriptor() ([]byte, []int) { return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{11} } -func (x *PlatformSearchResponse) GetSearchOutput() []*Platform { +func (x *PlatformSearchResponse) GetSearchOutput() []*PlatformSummary { if x != nil { return x.SearchOutput } return nil } -type PlatformListRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Arduino Core Service instance from the `Init` response. - Instance *Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"` - // Set to true to only list platforms which have a newer version available - // than the one currently installed. - UpdatableOnly bool `protobuf:"varint,2,opt,name=updatable_only,json=updatableOnly,proto3" json:"updatable_only,omitempty"` - // Set to true to list platforms installed manually in the user' sketchbook - // hardware folder, installed with the PlatformManager through the CLI or - // IDE and that are available to install - All bool `protobuf:"varint,3,opt,name=all,proto3" json:"all,omitempty"` -} - -func (x *PlatformListRequest) Reset() { - *x = PlatformListRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformListRequest) ProtoMessage() {} - -func (x *PlatformListRequest) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformListRequest.ProtoReflect.Descriptor instead. -func (*PlatformListRequest) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{12} -} - -func (x *PlatformListRequest) GetInstance() *Instance { - if x != nil { - return x.Instance - } - return nil -} - -func (x *PlatformListRequest) GetUpdatableOnly() bool { - if x != nil { - return x.UpdatableOnly - } - return false -} - -func (x *PlatformListRequest) GetAll() bool { - if x != nil { - return x.All - } - return false -} - -type PlatformListResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The installed platforms. - InstalledPlatforms []*Platform `protobuf:"bytes,1,rep,name=installed_platforms,json=installedPlatforms,proto3" json:"installed_platforms,omitempty"` -} - -func (x *PlatformListResponse) Reset() { - *x = PlatformListResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PlatformListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PlatformListResponse) ProtoMessage() {} - -func (x *PlatformListResponse) ProtoReflect() protoreflect.Message { - mi := &file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use PlatformListResponse.ProtoReflect.Descriptor instead. -func (*PlatformListResponse) Descriptor() ([]byte, []int) { - return file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP(), []int{13} -} - -func (x *PlatformListResponse) GetInstalledPlatforms() []*Platform { - if x != nil { - return x.InstalledPlatforms - } - return nil -} - var File_cc_arduino_cli_commands_v1_core_proto protoreflect.FileDescriptor var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ @@ -1020,7 +913,7 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x9d, 0x01, + 0x6f, 0x72, 0x6d, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0xcc, 0x01, 0x0a, 0x15, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, 0x61, @@ -1030,35 +923,22 @@ var file_cc_arduino_cli_commands_v1_core_proto_rawDesc = []byte{ 0x72, 0x63, 0x68, 0x5f, 0x61, 0x72, 0x67, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x41, 0x72, 0x67, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x6c, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, - 0x16, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, - 0x68, 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, - 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, - 0x66, 0x6f, 0x72, 0x6d, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x22, 0x90, 0x01, 0x0a, 0x13, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x4c, - 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, - 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, - 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x6e, 0x6c, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x75, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4f, - 0x6e, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x03, 0x61, 0x6c, 0x6c, 0x22, 0x6d, 0x0a, 0x14, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, - 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, - 0x13, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x5f, 0x70, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x63, 0x63, 0x2e, - 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, - 0x52, 0x12, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x73, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, - 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, 0x63, 0x2f, 0x61, 0x72, - 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, - 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x0b, 0x61, 0x6c, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2d, 0x0a, + 0x12, 0x6d, 0x61, 0x6e, 0x75, 0x61, 0x6c, 0x6c, 0x79, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, + 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x6d, 0x61, 0x6e, 0x75, 0x61, + 0x6c, 0x6c, 0x79, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x6a, 0x0a, 0x16, + 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x5f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, + 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x0c, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x42, 0x48, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x61, + 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2d, 0x63, 0x6c, 0x69, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x63, + 0x63, 0x2f, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x69, 0x2f, 0x63, 0x6f, + 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, + 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1073,7 +953,7 @@ func file_cc_arduino_cli_commands_v1_core_proto_rawDescGZIP() []byte { return file_cc_arduino_cli_commands_v1_core_proto_rawDescData } -var file_cc_arduino_cli_commands_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_cc_arduino_cli_commands_v1_core_proto_msgTypes = make([]protoimpl.MessageInfo, 12) var file_cc_arduino_cli_commands_v1_core_proto_goTypes = []interface{}{ (*PlatformInstallRequest)(nil), // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest (*PlatformInstallResponse)(nil), // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse @@ -1087,34 +967,31 @@ var file_cc_arduino_cli_commands_v1_core_proto_goTypes = []interface{}{ (*PlatformUpgradeResponse)(nil), // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse (*PlatformSearchRequest)(nil), // 10: cc.arduino.cli.commands.v1.PlatformSearchRequest (*PlatformSearchResponse)(nil), // 11: cc.arduino.cli.commands.v1.PlatformSearchResponse - (*PlatformListRequest)(nil), // 12: cc.arduino.cli.commands.v1.PlatformListRequest - (*PlatformListResponse)(nil), // 13: cc.arduino.cli.commands.v1.PlatformListResponse - (*Instance)(nil), // 14: cc.arduino.cli.commands.v1.Instance - (*DownloadProgress)(nil), // 15: cc.arduino.cli.commands.v1.DownloadProgress - (*TaskProgress)(nil), // 16: cc.arduino.cli.commands.v1.TaskProgress - (*Platform)(nil), // 17: cc.arduino.cli.commands.v1.Platform + (*Instance)(nil), // 12: cc.arduino.cli.commands.v1.Instance + (*DownloadProgress)(nil), // 13: cc.arduino.cli.commands.v1.DownloadProgress + (*TaskProgress)(nil), // 14: cc.arduino.cli.commands.v1.TaskProgress + (*Platform)(nil), // 15: cc.arduino.cli.commands.v1.Platform + (*PlatformSummary)(nil), // 16: cc.arduino.cli.commands.v1.PlatformSummary } var file_cc_arduino_cli_commands_v1_core_proto_depIdxs = []int32{ - 14, // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 16, // 2: cc.arduino.cli.commands.v1.PlatformInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 14, // 3: cc.arduino.cli.commands.v1.PlatformDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 4: cc.arduino.cli.commands.v1.PlatformDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 14, // 5: cc.arduino.cli.commands.v1.PlatformUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 16, // 6: cc.arduino.cli.commands.v1.PlatformUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 14, // 7: cc.arduino.cli.commands.v1.PlatformUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 15, // 8: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress - 16, // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress - 17, // 10: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.platform:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // 11: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 12: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.Platform - 14, // 13: cc.arduino.cli.commands.v1.PlatformListRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance - 17, // 14: cc.arduino.cli.commands.v1.PlatformListResponse.installed_platforms:type_name -> cc.arduino.cli.commands.v1.Platform - 15, // [15:15] is the sub-list for method output_type - 15, // [15:15] is the sub-list for method input_type - 15, // [15:15] is the sub-list for extension type_name - 15, // [15:15] is the sub-list for extension extendee - 0, // [0:15] is the sub-list for field type_name + 12, // 0: cc.arduino.cli.commands.v1.PlatformInstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 1: cc.arduino.cli.commands.v1.PlatformInstallResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 14, // 2: cc.arduino.cli.commands.v1.PlatformInstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 12, // 3: cc.arduino.cli.commands.v1.PlatformDownloadRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 4: cc.arduino.cli.commands.v1.PlatformDownloadResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 12, // 5: cc.arduino.cli.commands.v1.PlatformUninstallRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 14, // 6: cc.arduino.cli.commands.v1.PlatformUninstallResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 12, // 7: cc.arduino.cli.commands.v1.PlatformUpgradeRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 13, // 8: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.progress:type_name -> cc.arduino.cli.commands.v1.DownloadProgress + 14, // 9: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.task_progress:type_name -> cc.arduino.cli.commands.v1.TaskProgress + 15, // 10: cc.arduino.cli.commands.v1.PlatformUpgradeResponse.platform:type_name -> cc.arduino.cli.commands.v1.Platform + 12, // 11: cc.arduino.cli.commands.v1.PlatformSearchRequest.instance:type_name -> cc.arduino.cli.commands.v1.Instance + 16, // 12: cc.arduino.cli.commands.v1.PlatformSearchResponse.search_output:type_name -> cc.arduino.cli.commands.v1.PlatformSummary + 13, // [13:13] is the sub-list for method output_type + 13, // [13:13] is the sub-list for method input_type + 13, // [13:13] is the sub-list for extension type_name + 13, // [13:13] is the sub-list for extension extendee + 0, // [0:13] is the sub-list for field type_name } func init() { file_cc_arduino_cli_commands_v1_core_proto_init() } @@ -1268,30 +1145,6 @@ func file_cc_arduino_cli_commands_v1_core_proto_init() { return nil } } - file_cc_arduino_cli_commands_v1_core_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformListRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cc_arduino_cli_commands_v1_core_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PlatformListResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1299,7 +1152,7 @@ func file_cc_arduino_cli_commands_v1_core_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cc_arduino_cli_commands_v1_core_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 12, NumExtensions: 0, NumServices: 0, }, diff --git a/rpc/cc/arduino/cli/commands/v1/core.proto b/rpc/cc/arduino/cli/commands/v1/core.proto index 70ec4d46886..67aa0b214c7 100644 --- a/rpc/cc/arduino/cli/commands/v1/core.proto +++ b/rpc/cc/arduino/cli/commands/v1/core.proto @@ -118,26 +118,12 @@ message PlatformSearchRequest { // Whether to show all available versions. `false` causes only the newest // versions of the cores to be listed in the search results. bool all_versions = 3; + // Whether to show manually installed platforms. `false` causes to skip + // manually installed platforms. + bool manually_installed = 4; } message PlatformSearchResponse { // Results of the search. - repeated Platform search_output = 1; -} - -message PlatformListRequest { - // Arduino Core Service instance from the `Init` response. - Instance instance = 1; - // Set to true to only list platforms which have a newer version available - // than the one currently installed. - bool updatable_only = 2; - // Set to true to list platforms installed manually in the user' sketchbook - // hardware folder, installed with the PlatformManager through the CLI or - // IDE and that are available to install - bool all = 3; -} - -message PlatformListResponse { - // The installed platforms. - repeated Platform installed_platforms = 1; + repeated PlatformSummary search_output = 1; }