Expose golang fqbn package for public use (#2768) · arduino/arduino-cli@84fc413 (original) (raw)
`@@ -32,6 +32,7 @@ import (
`
32
32
`"github.com/arduino/arduino-cli/internal/arduino/globals"
`
33
33
`"github.com/arduino/arduino-cli/internal/arduino/sketch"
`
34
34
`"github.com/arduino/arduino-cli/internal/i18n"
`
``
35
`+
"github.com/arduino/arduino-cli/pkg/fqbn"
`
35
36
` rpc "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
`
36
37
` paths "github.com/arduino/go-paths-helper"
`
37
38
` properties "github.com/arduino/go-properties-orderedmap"
`
`@@ -53,15 +54,15 @@ func (s *arduinoCoreServerImpl) SupportedUserFields(ctx context.Context, req *rp
`
53
54
` }
`
54
55
`defer release()
`
55
56
``
56
``
`-
fqbn, err := cores.ParseFQBN(req.GetFqbn())
`
``
57
`+
fqbn, err := fqbn.Parse(req.GetFqbn())
`
57
58
`if err != nil {
`
58
59
`return nil, &cmderrors.InvalidFQBNError{Cause: err}
`
59
60
` }
`
60
61
``
61
62
`_, platformRelease, _, boardProperties, _, err := pme.ResolveFQBN(fqbn)
`
62
63
`if platformRelease == nil {
`
63
64
`return nil, &cmderrors.PlatformNotFoundError{
`
64
``
`-
Platform: fmt.Sprintf("%s:%s", fqbn.Package, fqbn.PlatformArch),
`
``
65
`+
Platform: fmt.Sprintf("%s:%s", fqbn.Packager, fqbn.Architecture),
`
65
66
`Cause: err,
`
66
67
` }
`
67
68
` } else if err != nil {
`
`@@ -282,7 +283,7 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
`
282
283
`return nil, &cmderrors.MissingProgrammerError{}
`
283
284
` }
`
284
285
``
285
``
`-
fqbn, err := cores.ParseFQBN(fqbnIn)
`
``
286
`+
fqbn, err := fqbn.Parse(fqbnIn)
`
286
287
`if err != nil {
`
287
288
`return nil, &cmderrors.InvalidFQBNError{Cause: err}
`
288
289
` }
`
`@@ -292,7 +293,7 @@ func (s *arduinoCoreServerImpl) runProgramAction(ctx context.Context, pme *packa
`
292
293
`_, boardPlatform, board, boardProperties, buildPlatform, err := pme.ResolveFQBN(fqbn)
`
293
294
`if boardPlatform == nil {
`
294
295
`return nil, &cmderrors.PlatformNotFoundError{
`
295
``
`-
Platform: fmt.Sprintf("%s:%s", fqbn.Package, fqbn.PlatformArch),
`
``
296
`+
Platform: fmt.Sprintf("%s:%s", fqbn.Packager, fqbn.Architecture),
`
296
297
`Cause: err,
`
297
298
` }
`
298
299
` } else if err != nil {
`