diff --git a/.gitignore b/.gitignore index 6e7b8d65eb0..2b918c4df3f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,8 @@ venv # gRPC client example folder /client_example/client_example -*.bin -*.elf +/client_example/**/*.bin +/client_example/**/*.elf # Misc. .DS_Store diff --git a/arduino/sketches/sketches.go b/arduino/sketches/sketches.go index 10627920d80..601853f1590 100644 --- a/arduino/sketches/sketches.go +++ b/arduino/sketches/sketches.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/arduino/go-paths-helper" + "github.com/pkg/errors" ) // Sketch is a sketch for Arduino @@ -43,9 +44,17 @@ type BoardMetadata struct { // NewSketchFromPath loads a sketch from the specified path func NewSketchFromPath(path *paths.Path) (*Sketch, error) { + path, err := path.Abs() + if err != nil { + return nil, errors.Errorf("getting sketch path: %s", err) + } if !path.IsDir() { path = path.Parent() } + sketchFile := path.Join(path.Base() + ".ino") + if !sketchFile.Exist() { + return nil, errors.Errorf("no valid sketch found in %s: missing %s", path, sketchFile.Base()) + } sketch := &Sketch{ FullPath: path, Name: path.Base(), diff --git a/cli/upload/upload.go b/cli/upload/upload.go index 1a598dae0a1..3922ba2f4a3 100644 --- a/cli/upload/upload.go +++ b/cli/upload/upload.go @@ -36,6 +36,7 @@ var ( verbose bool verify bool importDir string + importFile string programmer string ) @@ -47,12 +48,14 @@ func NewCommand() *cobra.Command { Long: "Upload Arduino sketches. This does NOT compile the sketch prior to upload.", Example: " " + os.Args[0] + " upload /home/user/Arduino/MySketch", Args: cobra.MaximumNArgs(1), + PreRun: checkFlagsConflicts, Run: run, } uploadCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno") uploadCommand.Flags().StringVarP(&port, "port", "p", "", "Upload port, e.g.: COM10 or /dev/ttyACM0") uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Directory containing binaries to upload.") + uploadCommand.Flags().StringVarP(&importFile, "input-file", "i", "", "Binary file to upload.") uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, "Verify uploaded binary after the upload.") uploadCommand.Flags().BoolVarP(&verbose, "verbose", "v", false, "Optional, turns on verbose mode.") uploadCommand.Flags().StringVarP(&programmer, "programmer", "P", "", "Optional, use the specified programmer to upload or 'list' to list supported programmers.") @@ -60,6 +63,13 @@ func NewCommand() *cobra.Command { return uploadCommand } +func checkFlagsConflicts(command *cobra.Command, args []string) { + if importFile != "" && importDir != "" { + feedback.Errorf("error: --input-file and --input-dir flags cannot be used together") + os.Exit(errorcodes.ErrBadArgument) + } +} + func run(command *cobra.Command, args []string) { instance, err := instance.CreateInstance() if err != nil { @@ -80,6 +90,7 @@ func run(command *cobra.Command, args []string) { Port: port, Verbose: verbose, Verify: verify, + ImportFile: importFile, ImportDir: importDir, Programmer: programmer, }, os.Stdout, os.Stderr); err != nil { diff --git a/commands/debug/debug_test.go b/commands/debug/debug_test.go index 0e352f07a87..8d0fd57ad7f 100644 --- a/commands/debug/debug_test.go +++ b/commands/debug/debug_test.go @@ -26,14 +26,16 @@ import ( dbg "github.com/arduino/arduino-cli/rpc/debug" "github.com/arduino/go-paths-helper" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) -var customHardware = paths.New("testdata", "custom_hardware") -var dataDir = paths.New("testdata", "data_dir", "packages") -var sketch = "hello" -var sketchPath = paths.New("testdata", sketch) - func TestGetCommandLine(t *testing.T) { + customHardware := paths.New("testdata", "custom_hardware") + dataDir := paths.New("testdata", "data_dir", "packages") + sketch := "hello" + sketchPath := paths.New("testdata", sketch) + require.NoError(t, sketchPath.ToAbs()) + pm := packagemanager.NewPackageManager(nil, nil, nil, nil) pm.LoadHardwareFromDirectory(customHardware) pm.LoadHardwareFromDirectory(dataDir) @@ -59,9 +61,9 @@ func TestGetCommandLine(t *testing.T) { fmt.Sprintf(" -c \"gdb_port pipe\" -c \"telnet_port 0\" -c init -c halt %s/build/arduino-test.samd.arduino_zero_edbg/hello.ino.elf", sketchPath) command, err := getCommandLine(req, pm) - assert.Nil(t, err) + require.Nil(t, err) commandToTest := strings.Join(command[:], " ") - assert.Equal(t, filepath.FromSlash(goldCommand), filepath.FromSlash(commandToTest)) + require.Equal(t, filepath.FromSlash(goldCommand), filepath.FromSlash(commandToTest)) // Other samd boards such as mkr1000 can be debugged using an external tool such as Atmel ICE connected to // the board debug port @@ -83,5 +85,4 @@ func TestGetCommandLine(t *testing.T) { assert.Nil(t, err) commandToTest2 := strings.Join(command2[:], " ") assert.Equal(t, filepath.FromSlash(goldCommand2), filepath.FromSlash(commandToTest2)) - } diff --git a/commands/debug/testdata/hello/hello.ino b/commands/debug/testdata/hello/hello.ino new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/burnbootloader.go b/commands/upload/burnbootloader.go index 212c1f50ff7..31f02df0216 100644 --- a/commands/upload/burnbootloader.go +++ b/commands/upload/burnbootloader.go @@ -37,6 +37,7 @@ func BurnBootloader(ctx context.Context, req *rpc.BurnBootloaderReq, outStream i err := runProgramAction( pm, nil, // sketch + "", // importFile "", // importDir req.GetFqbn(), req.GetPort(), diff --git a/commands/upload/testdata/Blonk/Blonk.ino b/commands/upload/testdata/Blonk/Blonk.ino new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.bin b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.elf b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.elf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.hex b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.map b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.map new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.with_bootloader.bin b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.with_bootloader.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.with_bootloader.hex b/commands/upload/testdata/Blonk/build/arduino.samd.mkr1000/Blonk.ino.with_bootloader.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_1/sketch.ino.bin b/commands/upload/testdata/build_path_1/sketch.ino.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.bin b/commands/upload/testdata/build_path_2/Blink.ino.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.elf b/commands/upload/testdata/build_path_2/Blink.ino.elf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.hex b/commands/upload/testdata/build_path_2/Blink.ino.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.map b/commands/upload/testdata/build_path_2/Blink.ino.map new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.with_bootloader.bin b/commands/upload/testdata/build_path_2/Blink.ino.with_bootloader.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_2/Blink.ino.with_bootloader.hex b/commands/upload/testdata/build_path_2/Blink.ino.with_bootloader.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/AnotherSketch.ino.bin b/commands/upload/testdata/build_path_3/AnotherSketch.ino.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.bin b/commands/upload/testdata/build_path_3/Blink.ino.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.elf b/commands/upload/testdata/build_path_3/Blink.ino.elf new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.hex b/commands/upload/testdata/build_path_3/Blink.ino.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.map b/commands/upload/testdata/build_path_3/Blink.ino.map new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.with_bootloader.bin b/commands/upload/testdata/build_path_3/Blink.ino.with_bootloader.bin new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_3/Blink.ino.with_bootloader.hex b/commands/upload/testdata/build_path_3/Blink.ino.with_bootloader.hex new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/testdata/build_path_4/some_other_files.txt b/commands/upload/testdata/build_path_4/some_other_files.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/commands/upload/upload.go b/commands/upload/upload.go index 72fcda080ee..1e1dc9701e6 100644 --- a/commands/upload/upload.go +++ b/commands/upload/upload.go @@ -20,6 +20,7 @@ import ( "fmt" "io" "net/url" + "path/filepath" "strings" "time" @@ -32,6 +33,7 @@ import ( rpc "github.com/arduino/arduino-cli/rpc/commands" paths "github.com/arduino/go-paths-helper" properties "github.com/arduino/go-properties-orderedmap" + "github.com/pkg/errors" "github.com/sirupsen/logrus" "go.bug.st/serial" ) @@ -42,12 +44,9 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr // TODO: make a generic function to extract sketch from request // and remove duplication in commands/compile.go - if req.GetSketchPath() == "" { - return nil, fmt.Errorf("missing sketchPath") - } sketchPath := paths.New(req.GetSketchPath()) sketch, err := sketches.NewSketchFromPath(sketchPath) - if err != nil { + if err != nil && req.GetImportDir() == "" && req.GetImportFile() == "" { return nil, fmt.Errorf("opening sketch: %s", err) } @@ -56,6 +55,7 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr err = runProgramAction( pm, sketch, + req.GetImportFile(), req.GetImportDir(), req.GetFqbn(), req.GetPort(), @@ -73,10 +73,11 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr } func runProgramAction(pm *packagemanager.PackageManager, - sketch *sketches.Sketch, importDir string, fqbnIn string, port string, + sketch *sketches.Sketch, + importFile, importDir, fqbnIn, port string, programmerID string, verbose, verify, burnBootloader bool, - outStream io.Writer, errStream io.Writer) error { + outStream, errStream io.Writer) error { if burnBootloader && programmerID == "" { return fmt.Errorf("no programmer specified for burning bootloader") @@ -239,22 +240,11 @@ func runProgramAction(pm *packagemanager.PackageManager, uploadProperties.Set("program.verify", uploadProperties.Get("program.params.noverify")) } - var importPath *paths.Path if !burnBootloader { - if sketch == nil { - return fmt.Errorf(("no sketch specified")) - } - - if importDir != "" { - importPath = paths.New(importDir) - } else { - // TODO: Create a function to obtain importPath from sketch - importPath = sketch.FullPath - // Add FQBN (without configs part) to export path - fqbnSuffix := strings.Replace(fqbn.StringWithoutConfig(), ":", ".", -1) - importPath = importPath.Join("build").Join(fqbnSuffix) + importPath, sketchName, err := determineBuildPathAndSketchName(importFile, importDir, sketch, fqbn) + if err != nil { + return errors.Errorf("retrieving build artifacts: %s", err) } - if !importPath.Exist() { return fmt.Errorf("compiled sketch not found in %s", importPath) } @@ -262,7 +252,7 @@ func runProgramAction(pm *packagemanager.PackageManager, return fmt.Errorf("expected compiled sketch in directory %s, but is a file instead", importPath) } uploadProperties.SetPath("build.path", importPath) - uploadProperties.Set("build.project_name", sketch.Name+".ino") + uploadProperties.Set("build.project_name", sketchName) } // If not using programmer perform some action required @@ -449,3 +439,102 @@ func waitForNewSerialPort() (string, error) { return "", nil } + +func determineBuildPathAndSketchName(importFile, importDir string, sketch *sketches.Sketch, fqbn *cores.FQBN) (*paths.Path, string, error) { + // In general, compiling a sketch will produce a set of files that are + // named as the sketch but have different extensions, for example Sketch.ino + // may produce: Sketch.ino.bin; Sketch.ino.hex; Sketch.ino.zip; etc... + // These files are created together in the build directory and anyone of + // them may be required for upload. + + // The upload recipes are already written using the 'build.project_name' property + // concatenated with an explicit extension. To perform the upload we should now + // determine the project name (e.g. 'sketch.ino) and set the 'build.project_name' + // property accordingly, together with the 'build.path' property to point to the + // directory containing the build artifacts. + + // Case 1: importFile flag has been specified + if importFile != "" { + if importDir != "" { + return nil, "", fmt.Errorf("importFile and importDir cannot be used together") + } + + // We have a path like "path/to/my/build/SketchName.ino.bin". We are going to + // ignore the extension and set: + // - "build.path" as "path/to/my/build" + // - "build.project_name" as "SketchName.ino" + + importFilePath := paths.New(importFile) + if !importFilePath.Exist() { + return nil, "", fmt.Errorf("binary file not found in %s", importFilePath) + } + return importFilePath.Parent(), strings.TrimSuffix(importFilePath.Base(), importFilePath.Ext()), nil + } + + if importDir != "" { + // Case 2: importDir flag has been specified + + // In this case we have a build path but ignore the sketch name, we'll + // try to determine the sketch name by applying some euristics to the build folder. + // - "build.path" as importDir + // - "build.project_name" after trying to autodetect it from the build folder. + buildPath := paths.New(importDir) + sketchName, err := detectSketchNameFromBuildPath(buildPath) + if err != nil { + return nil, "", errors.Errorf("autodetect build artifact: %s", err) + } + return buildPath, sketchName, nil + } + + // Case 3: nothing given... + if sketch == nil { + return nil, "", fmt.Errorf("no sketch or build directory/file specified") + } + + // Case 4: only sketch specified. In this case we use the default sketch build path + // and the given sketch name. + + // TODO: Create a function to obtain importPath from sketch + // Add FQBN (without configs part) to export path + if fqbn == nil { + return nil, "", fmt.Errorf("missing FQBN") + } + fqbnSuffix := strings.Replace(fqbn.StringWithoutConfig(), ":", ".", -1) + return sketch.FullPath.Join("build").Join(fqbnSuffix), sketch.Name + ".ino", nil +} + +func detectSketchNameFromBuildPath(buildPath *paths.Path) (string, error) { + files, err := buildPath.ReadDir() + if err != nil { + return "", err + } + + candidateName := "" + var candidateFile *paths.Path + for _, file := range files { + // Build artifacts are usually names as "Blink.ino.hex" or "Blink.ino.bin". + // Extract the "Blink.ino" part + name := strings.TrimSuffix(file.Base(), file.Ext()) + + // Sometimes we may have particular files like: + // Blink.ino.with_bootloader.bin + if filepath.Ext(name) != ".ino" { + // just ignore those files + continue + } + + if candidateName == "" { + candidateName = name + candidateFile = file + } + + if candidateName != name { + return "", errors.Errorf("multiple build artifacts found: '%s' and '%s'", candidateFile, file) + } + } + + if candidateName == "" { + return "", errors.New("could not find a valid build artifact") + } + return candidateName, nil +} diff --git a/commands/upload/upload_test.go b/commands/upload/upload_test.go new file mode 100644 index 00000000000..54f34155e7e --- /dev/null +++ b/commands/upload/upload_test.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 upload + +import ( + "fmt" + "testing" + + "github.com/arduino/arduino-cli/arduino/cores" + "github.com/arduino/arduino-cli/arduino/sketches" + paths "github.com/arduino/go-paths-helper" + "github.com/stretchr/testify/require" +) + +func TestDetectSketchNameFromBuildPath(t *testing.T) { + sk1, err1 := detectSketchNameFromBuildPath(paths.New("testdata/build_path_1")) + require.NoError(t, err1) + require.Equal(t, "sketch.ino", sk1) + + sk2, err2 := detectSketchNameFromBuildPath(paths.New("testdata/build_path_2")) + require.NoError(t, err2) + require.Equal(t, "Blink.ino", sk2) + + sk3, err3 := detectSketchNameFromBuildPath(paths.New("testdata/build_path_3")) + require.Error(t, err3) + require.Equal(t, "", sk3) + + sk4, err4 := detectSketchNameFromBuildPath(paths.New("testdata/build_path_4")) + require.Error(t, err4) + require.Equal(t, "", sk4) + + sk5, err5 := detectSketchNameFromBuildPath(paths.New("testdata/build_path_invalid")) + require.Error(t, err5) + require.Equal(t, "", sk5) +} + +func TestDetermineBuildPathAndSketchName(t *testing.T) { + type test struct { + importFile string + importDir string + sketch *sketches.Sketch + fqbn *cores.FQBN + resBuildPath string + resSketchName string + hasError bool + } + + blonk, err := sketches.NewSketchFromPath(paths.New("testdata/Blonk")) + require.NoError(t, err) + + fqbn, err := cores.ParseFQBN("arduino:samd:mkr1000") + require.NoError(t, err) + + tests := []test{ + // 00: error: no data passed in + {"", "", nil, nil, "", "", true}, + // 01: use importFile to detect build.path and project_name + {"testdata/build_path_2/Blink.ino.hex", "", nil, nil, "testdata/build_path_2", "Blink.ino", false}, + // 02: use importPath as build.path and project_name + {"", "testdata/build_path_2", nil, nil, "testdata/build_path_2", "Blink.ino", false}, + // 03: error: used both importPath and importFile + {"testdata/build_path_2/Blink.ino.hex", "testdata/build_path_2", nil, nil, "", "", true}, + // 04: error: only sketch without FQBN + {"", "", blonk, nil, "", "", true}, + // 05: use importFile to detect build.path and project_name, sketch is ignored. + {"testdata/build_path_2/Blink.ino.hex", "", blonk, nil, "testdata/build_path_2", "Blink.ino", false}, + // 06: use importPath as build.path and Blink as project name, ignore the sketch Blonk + {"", "testdata/build_path_2", blonk, nil, "testdata/build_path_2", "Blink.ino", false}, + // 07: error: used both importPath and importFile + {"testdata/build_path_2/Blink.ino.hex", "testdata/build_path_2", blonk, nil, "", "", true}, + + // 08: error: no data passed in + {"", "", nil, fqbn, "", "", true}, + // 09: use importFile to detect build.path and project_name, fqbn ignored + {"testdata/build_path_2/Blink.ino.hex", "", nil, fqbn, "testdata/build_path_2", "Blink.ino", false}, + // 10: use importPath as build.path and project_name, fqbn ignored + {"", "testdata/build_path_2", nil, fqbn, "testdata/build_path_2", "Blink.ino", false}, + // 11: error: used both importPath and importFile + {"testdata/build_path_2/Blink.ino.hex", "testdata/build_path_2", nil, fqbn, "", "", true}, + // 12: use sketch to determine project name and sketch+fqbn to determine build path + {"", "", blonk, fqbn, "testdata/Blonk/build/arduino.samd.mkr1000", "Blonk.ino", false}, + // 13: use importFile to detect build.path and project_name, sketch+fqbn is ignored. + {"testdata/build_path_2/Blink.ino.hex", "", blonk, fqbn, "testdata/build_path_2", "Blink.ino", false}, + // 14: use importPath as build.path and Blink as project name, ignore the sketch Blonk, ignore fqbn + {"", "testdata/build_path_2", blonk, fqbn, "testdata/build_path_2", "Blink.ino", false}, + // 15: error: used both importPath and importFile + {"testdata/build_path_2/Blink.ino.hex", "testdata/build_path_2", blonk, fqbn, "", "", true}, + } + for i, test := range tests { + t.Run(fmt.Sprintf("SubTest%02d", i), func(t *testing.T) { + buildPath, sketchName, err := determineBuildPathAndSketchName(test.importFile, test.importDir, test.sketch, test.fqbn) + if test.hasError { + require.Error(t, err) + } else { + require.NoError(t, err) + } + if test.resBuildPath == "" { + require.Nil(t, buildPath) + } else { + resBuildPath := paths.New(test.resBuildPath) + require.NoError(t, resBuildPath.ToAbs()) + require.NoError(t, buildPath.ToAbs()) + require.Equal(t, resBuildPath.String(), buildPath.String()) + } + require.Equal(t, test.resSketchName, sketchName) + }) + } +} diff --git a/go.mod b/go.mod index 92a3cc2d8f4..dcc2c64ab90 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( bou.ke/monkey v1.0.1 github.com/GeertJohan/go.rice v1.0.0 github.com/arduino/board-discovery v0.0.0-20180823133458-1ba29327fb0c - github.com/arduino/go-paths-helper v1.3.1 + github.com/arduino/go-paths-helper v1.3.2 github.com/arduino/go-properties-orderedmap v1.3.0 github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b github.com/arduino/go-win32-utils v0.0.0-20180330194947-ed041402e83b diff --git a/go.sum b/go.sum index 46b9fa660b9..cf093eae332 100644 --- a/go.sum +++ b/go.sum @@ -16,8 +16,8 @@ github.com/arduino/go-paths-helper v1.0.1 h1:utYXLM2RfFlc9qp/MJTIYp3t6ux/xM6mWje github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-paths-helper v1.2.0 h1:qDW93PR5IZUN/jzO4rCtexiwF8P4OIcOmcSgAYLZfY4= github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.3.1 h1:Gz+PVt0luQyH4nffDePd8WBs/O5P05jADtJsY8NqvCM= -github.com/arduino/go-paths-helper v1.3.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= +github.com/arduino/go-paths-helper v1.3.2 h1:5U9TSKQODiwSVgTxskC0PNl0l0Vf40GUlp99Zy2SK8w= +github.com/arduino/go-paths-helper v1.3.2/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= github.com/arduino/go-properties-orderedmap v1.3.0 h1:4No/vQopB36e7WUIk6H6TxiSEJPiMrVOCZylYmua39o= github.com/arduino/go-properties-orderedmap v1.3.0/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-timeutils v0.0.0-20171220113728-d1dd9e313b1b h1:9hDi4F2st6dbLC3y4i02zFT5quS4X6iioWifGlVwfy4= diff --git a/rpc/commands/board.pb.go b/rpc/commands/board.pb.go index a2db846ddda..8e1692836e6 100644 --- a/rpc/commands/board.pb.go +++ b/rpc/commands/board.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/board.proto package commands diff --git a/rpc/commands/commands.pb.go b/rpc/commands/commands.pb.go index 0a0db9ed929..daa6c609523 100644 --- a/rpc/commands/commands.pb.go +++ b/rpc/commands/commands.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/commands.proto package commands diff --git a/rpc/commands/common.pb.go b/rpc/commands/common.pb.go index 6d6629fa077..5cb44f8a351 100644 --- a/rpc/commands/common.pb.go +++ b/rpc/commands/common.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/common.proto package commands diff --git a/rpc/commands/compile.pb.go b/rpc/commands/compile.pb.go index ed4efd99a3e..021c906d0d7 100644 --- a/rpc/commands/compile.pb.go +++ b/rpc/commands/compile.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/compile.proto package commands diff --git a/rpc/commands/core.pb.go b/rpc/commands/core.pb.go index b50430ed524..6302b691249 100644 --- a/rpc/commands/core.pb.go +++ b/rpc/commands/core.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/core.proto package commands diff --git a/rpc/commands/lib.pb.go b/rpc/commands/lib.pb.go index 913963df787..ded72bfc3b1 100644 --- a/rpc/commands/lib.pb.go +++ b/rpc/commands/lib.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/lib.proto package commands diff --git a/rpc/commands/upload.pb.go b/rpc/commands/upload.pb.go index 724a56c620b..dbf3969a664 100644 --- a/rpc/commands/upload.pb.go +++ b/rpc/commands/upload.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: commands/upload.proto package commands @@ -62,8 +62,9 @@ type UploadReq struct { // After upload, verify that the contents of the memory on the board match the // uploaded binary. Verify bool `protobuf:"varint,6,opt,name=verify,proto3" json:"verify,omitempty"` - // Deprecated: Do not use. - ImportFile string `protobuf:"bytes,7,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"` // DEPRECATED: Use import_dir instead + // When `import_file` is specified, it overrides the `import_dir` and `sketch_path` + // params. + ImportFile string `protobuf:"bytes,7,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"` // Custom path to a directory containing compiled files. When `import_dir` is // not specified, the standard build directory under `sketch_path` is used. ImportDir string `protobuf:"bytes,8,opt,name=import_dir,json=importDir,proto3" json:"import_dir,omitempty"` @@ -144,7 +145,6 @@ func (x *UploadReq) GetVerify() bool { return false } -// Deprecated: Do not use. func (x *UploadReq) GetImportFile() string { if x != nil { return x.ImportFile @@ -483,7 +483,7 @@ var file_commands_upload_proto_rawDesc = []byte{ 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x17, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, 0x75, 0x69, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x69, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x1a, 0x15, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa9, 0x02, 0x0a, 0x09, 0x55, 0x70, 0x6c, 0x6f, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x02, 0x0a, 0x09, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 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, @@ -496,54 +496,53 @@ var file_commands_upload_proto_rawDesc = []byte{ 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, - 0x23, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x64, - 0x69, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, - 0x44, 0x69, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, - 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, - 0x6d, 0x65, 0x72, 0x22, 0x4a, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, - 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, - 0xcc, 0x01, 0x0a, 0x11, 0x42, 0x75, 0x72, 0x6e, 0x42, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x63, 0x2e, 0x61, 0x72, 0x64, + 0x1f, 0x0a, 0x0b, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x46, 0x69, 0x6c, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x5f, 0x64, 0x69, 0x72, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x44, 0x69, 0x72, 0x12, + 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x22, + 0x4a, 0x0a, 0x0a, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, + 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, + 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0xcc, 0x01, 0x0a, 0x11, + 0x42, 0x75, 0x72, 0x6e, 0x42, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, + 0x01, 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, 0x49, 0x6e, + 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x66, 0x71, 0x62, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x62, + 0x6f, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, 0x65, 0x72, 0x62, 0x6f, + 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, + 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x12, 0x42, 0x75, + 0x72, 0x6e, 0x42, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, + 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x22, 0x79, + 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, + 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 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, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, + 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x6e, 0x0a, 0x25, 0x4c, 0x69, 0x73, + 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x73, 0x41, 0x76, 0x61, 0x69, + 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x12, 0x45, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 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, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x08, 0x69, 0x6e, 0x73, 0x74, - 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f, 0x72, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x18, 0x0a, 0x07, - 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x76, - 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x12, 0x1e, - 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x22, 0x52, - 0x0a, 0x12, 0x42, 0x75, 0x72, 0x6e, 0x42, 0x6f, 0x6f, 0x74, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x6f, 0x75, 0x74, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, - 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x65, 0x72, 0x72, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x22, 0x79, 0x0a, 0x24, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x6d, 0x65, 0x72, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x6f, - 0x72, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x71, 0x12, 0x3d, 0x0a, 0x08, 0x69, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 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, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x71, 0x62, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x71, 0x62, 0x6e, 0x22, 0x6e, 0x0a, - 0x25, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x73, - 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x46, 0x6f, 0x72, 0x55, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x45, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x6d, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 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, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, - 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x73, 0x42, 0x2d, 0x5a, - 0x2b, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x52, 0x0b, 0x70, 0x72, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x6d, 0x65, 0x72, 0x73, 0x42, 0x2d, 0x5a, 0x2b, 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, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/rpc/commands/upload.proto b/rpc/commands/upload.proto index b2477a712e8..0f5e04e196c 100644 --- a/rpc/commands/upload.proto +++ b/rpc/commands/upload.proto @@ -39,7 +39,9 @@ message UploadReq { // After upload, verify that the contents of the memory on the board match the // uploaded binary. bool verify = 6; - string import_file = 7 [deprecated = true]; // DEPRECATED: Use import_dir instead + // When `import_file` is specified, it overrides the `import_dir` and `sketch_path` + // params. + string import_file = 7; // Custom path to a directory containing compiled files. When `import_dir` is // not specified, the standard build directory under `sketch_path` is used. string import_dir = 8; diff --git a/rpc/debug/debug.pb.go b/rpc/debug/debug.pb.go index 78459b85514..baad7cd1832 100644 --- a/rpc/debug/debug.pb.go +++ b/rpc/debug/debug.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: debug/debug.proto package debug diff --git a/rpc/monitor/monitor.pb.go b/rpc/monitor/monitor.pb.go index 9ac0cb7da6b..d3fdcc2942c 100644 --- a/rpc/monitor/monitor.pb.go +++ b/rpc/monitor/monitor.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: monitor/monitor.proto package monitor diff --git a/rpc/settings/settings.pb.go b/rpc/settings/settings.pb.go index a020f54189c..eb5d02fa8b6 100644 --- a/rpc/settings/settings.pb.go +++ b/rpc/settings/settings.pb.go @@ -16,7 +16,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 -// protoc v3.12.4 +// protoc v3.11.3 // source: settings/settings.proto package settings diff --git a/test/test_upload.py b/test/test_upload.py index 439bd98d084..52354092ef5 100644 --- a/test/test_upload.py +++ b/test/test_upload.py @@ -13,6 +13,7 @@ # software without disclosing the source code of your own applications. To purchase # a commercial license, send an email to license@arduino.cc. import os +import time import pytest @@ -30,7 +31,8 @@ def test_upload(run_command, data_dir, detected_boards): # Download core assert run_command("core install {}".format(board.core)) # Create a sketch - sketch_path = os.path.join(data_dir, "foo") + sketch_name = "foo" + sketch_path = os.path.join(data_dir, sketch_name) assert run_command("sketch new {}".format(sketch_path)) # Build sketch assert run_command("compile -b {fqbn} {sketch_path}".format(fqbn=board.fqbn, sketch_path=sketch_path)) @@ -44,6 +46,26 @@ def test_upload(run_command, data_dir, detected_boards): ) ) + # multiple uploads requires some pauses + time.sleep(2) + # Upload using --input-dir reusing standard sketch "build" folder artifacts + assert run_command( + "upload -b {fqbn} -p {port} --input-dir {sketch_path}/build/{fqbn_path} {sketch_path}".format( + sketch_path=sketch_path, fqbn=board.fqbn, port=board.address, + fqbn_path=board.fqbn.replace(":", ".") + ) + ) + + # multiple uploads requires some pauses + time.sleep(2) + # Upload using --input-file reusing standard sketch "build" folder artifacts + assert run_command( + "upload -b {fqbn} -p {port} --input-file {sketch_path}/build/{fqbn_path}/{sketch_name}.ino.bin".format( + sketch_path=sketch_path, fqbn=board.fqbn, port=board.address, sketch_name=sketch_name, + fqbn_path=board.fqbn.replace(":", ".") + ) + ) + def test_upload_after_attach(run_command, data_dir, detected_boards): # Init the environment explicitly