Unverified Commit ebc28e1b authored by Cristian Maglie's avatar Cristian Maglie Committed by GitHub

Compile extract all artifacts in "sketch/build" folder (#687)

* Deprecated exportFile/importFile in favor of exportDir/importDir

* Updated compile/upload cli commands

* Compile now saves artifacts in 'sketch/build/<FQBN>/...' folder

* Upload now uses export folder

* Test fix: use --output-dir option instead of deprecated --output

* Text fix: no more need to check if "extension won't be added if already present"

* Added Debug.ImportDir and deprecated Debug.ImportFile

* Upload now uses export folder

* Fixed GetCommandLine test

* Fixed test_core_install_esp32
parent c3871677
......@@ -46,7 +46,7 @@ var (
uploadAfterCompile bool // Upload the binary after the compilation.
port string // Upload port, e.g.: COM10 or /dev/ttyACM0.
verify bool // Upload, verify uploaded binary after the upload.
exportFile string // The compiled binary is written to this file
exportDir string // The compiled binary is written to this file
dryRun bool // Use this flag to now write the output file
libraries []string // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
optimizeForDebug bool // Optimize compile output for debug, not for release
......@@ -67,7 +67,7 @@ func NewCommand() *cobra.Command {
command.Flags().BoolVar(&showProperties, "show-properties", false, "Show all build properties used instead of compiling.")
command.Flags().BoolVar(&preprocess, "preprocess", false, "Print preprocessed code to stdout instead of compiling.")
command.Flags().StringVar(&buildCachePath, "build-cache-path", "", "Builds of 'core.a' are saved into this path to be cached and reused.")
command.Flags().StringVarP(&exportFile, "output", "o", "", "Filename of the compile output.")
command.Flags().StringVarP(&exportDir, "output-dir", "", "", "Save build artifacts in this directory.")
command.Flags().BoolVarP(&dryRun, "dry-run", "n", false, "Perform the build but do not copy the compile output file.")
command.Flags().StringVar(&buildPath, "build-path", "",
"Path where to save compiled files. If omitted, a directory will be created in the default temporary path of your OS.")
......@@ -115,7 +115,7 @@ func run(cmd *cobra.Command, args []string) {
Verbose: verbose,
Quiet: quiet,
VidPid: vidPid,
ExportFile: exportFile,
ExportDir: exportDir,
DryRun: dryRun,
Libraries: libraries,
OptimizeForDebug: optimizeForDebug,
......@@ -134,7 +134,7 @@ func run(cmd *cobra.Command, args []string) {
Port: port,
Verbose: verbose,
Verify: verify,
ImportFile: exportFile,
ImportDir: exportDir,
}, os.Stdout, os.Stderr)
if err != nil {
......
......@@ -37,7 +37,7 @@ var (
verbose bool
verify bool
interpreter string
importFile string
importDir string
)
// NewCommand created a new `upload` command
......@@ -54,7 +54,7 @@ func NewCommand() *cobra.Command {
debugCommand.Flags().StringVarP(&fqbn, "fqbn", "b", "", "Fully Qualified Board Name, e.g.: arduino:avr:uno")
debugCommand.Flags().StringVarP(&port, "port", "p", "", "Debug port, e.g.: COM10 or /dev/ttyACM0")
debugCommand.Flags().StringVar(&interpreter, "interpreter", "console", "Debug interpreter e.g.: console, mi, mi1, mi2, mi3")
debugCommand.Flags().StringVarP(&importFile, "input", "i", "", "Input file to be uploaded for debug.")
debugCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Direcory containing binaries for debug.")
return debugCommand
}
......@@ -82,7 +82,7 @@ func run(command *cobra.Command, args []string) {
SketchPath: sketchPath.String(),
Port: port,
Interpreter: interpreter,
ImportFile: importFile,
ImportDir: importDir,
}, os.Stdin, os.Stdout, ctrlc); err != nil {
feedback.Errorf("Error during Debug: %v", err)
os.Exit(errorcodes.ErrGeneric)
......
......@@ -30,11 +30,11 @@ import (
)
var (
fqbn string
port string
verbose bool
verify bool
importFile string
fqbn string
port string
verbose bool
verify bool
importDir string
)
// NewCommand created a new `upload` command
......@@ -50,7 +50,7 @@ func NewCommand() *cobra.Command {
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(&importFile, "input", "i", "", "Input file to be uploaded.")
uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", "Direcory containing binaries 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.")
......@@ -77,7 +77,7 @@ func run(command *cobra.Command, args []string) {
Port: port,
Verbose: verbose,
Verify: verify,
ImportFile: importFile,
ImportDir: importDir,
}, os.Stdout, os.Stderr); err != nil {
feedback.Errorf("Error during Upload: %v", err)
os.Exit(errorcodes.ErrGeneric)
......
......@@ -17,7 +17,6 @@ package compile
import (
"context"
"errors"
"fmt"
"io"
"path/filepath"
......@@ -37,6 +36,7 @@ import (
"github.com/arduino/arduino-cli/telemetry"
paths "github.com/arduino/go-paths-helper"
properties "github.com/arduino/go-properties-orderedmap"
"github.com/pkg/errors"
"github.com/segmentio/stats/v4"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
......@@ -55,11 +55,16 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
"verbose": strconv.FormatBool(req.Verbose),
"quiet": strconv.FormatBool(req.Quiet),
"vidPid": req.VidPid,
"exportFile": telemetry.Sanitize(req.ExportFile),
"exportFile": telemetry.Sanitize(req.ExportFile), // deprecated
"exportDir": telemetry.Sanitize(req.GetExportDir()),
"jobs": strconv.FormatInt(int64(req.Jobs), 10),
"libraries": strings.Join(req.Libraries, ","),
}
if req.GetExportFile() != "" {
outStream.Write([]byte(fmt.Sprintln("Compile.ExportFile has been deprecated. The ExportFile parameter will be ignored, use ExportDir instead.")))
}
// Use defer func() to evaluate tags map when function returns
// and set success flag inspecting the error named return parameter
defer func() {
......@@ -197,54 +202,38 @@ func Compile(ctx context.Context, req *rpc.CompileReq, outStream, errStream io.W
}
if !req.GetDryRun() {
// FIXME: Make a function to obtain these info...
outputPath := paths.New(
builderCtx.BuildProperties.ExpandPropsInString("{build.path}/{recipe.output.tmp_file}")) // "/build/path/sketch.ino.bin"
ext := outputPath.Ext() // ".hex" | ".bin"
base := outputPath.Base() // "sketch.ino.hex"
base = base[:len(base)-len(ext)] // "sketch.ino"
// FIXME: Make a function to produce a better name...
// Make the filename without the FQBN configs part
fqbnSuffix := strings.Replace(fqbn.StringWithoutConfig(), ":", ".", -1)
var exportPath *paths.Path
var exportFile string
if req.GetExportFile() == "" {
exportPath = sketch.FullPath
exportFile = sketch.Name + "." + fqbnSuffix // "sketch.arduino.avr.uno"
if exportDir := req.GetExportDir(); exportDir != "" {
exportPath = paths.New(exportDir)
} else {
exportPath = paths.New(req.GetExportFile()).Parent()
exportFile = paths.New(req.GetExportFile()).Base()
if strings.HasSuffix(exportFile, ext) {
exportFile = exportFile[:len(exportFile)-len(ext)]
}
exportPath = sketch.FullPath
// Add FQBN (without configs part) to export path
fqbnSuffix := strings.Replace(fqbn.StringWithoutConfig(), ":", ".", -1)
exportPath = exportPath.Join("build").Join(fqbnSuffix)
}
logrus.WithField("path", exportPath).Trace("Saving sketch to export path.")
if err := exportPath.MkdirAll(); err != nil {
return nil, errors.Wrap(err, "creating output dir")
}
// Copy "sketch.ino.*.hex" / "sketch.ino.*.bin" artifacts to sketch directory
srcDir, err := outputPath.Parent().ReadDir() // read "/build/path/*"
if err != nil {
return nil, fmt.Errorf("reading build directory: %s", err)
// Copy all "sketch.ino.*" artifacts to the export directory
baseName, ok := builderCtx.BuildProperties.GetOk("build.project_name") // == "sketch.ino"
if !ok {
return nil, errors.New("missing 'build.project_name' build property")
}
srcDir.FilterPrefix(base + ".")
srcDir.FilterSuffix(ext)
for _, srcOutput := range srcDir {
srcFilename := srcOutput.Base() // "sketch.ino.*.bin"
srcFilename = srcFilename[len(base):] // ".*.bin"
dstOutput := exportPath.Join(exportFile + srcFilename)
logrus.WithField("from", srcOutput).WithField("to", dstOutput).Debug("copying sketch build output")
if err = srcOutput.CopyTo(dstOutput); err != nil {
return nil, fmt.Errorf("copying output file: %s", err)
}
buildFiles, err := builderCtx.BuildPath.ReadDir()
if err != nil {
return nil, errors.Errorf("reading build directory: %s", err)
}
// Copy .elf file to sketch directory
srcElf := outputPath.Parent().Join(base + ".elf")
if srcElf.Exist() {
dstElf := exportPath.Join(exportFile + ".elf")
logrus.WithField("from", srcElf).WithField("to", dstElf).Debug("copying sketch build output")
if err = srcElf.CopyTo(dstElf); err != nil {
return nil, fmt.Errorf("copying elf file: %s", err)
buildFiles.FilterPrefix(baseName)
for _, buildFile := range buildFiles {
exportedFile := exportPath.Join(buildFile.Base())
logrus.
WithField("src", buildFile).
WithField("dest", exportedFile).
Trace("Copying artifact.")
if err = buildFile.CopyTo(exportedFile); err != nil {
return nil, errors.Wrapf(err, "copying output file %s", buildFile)
}
}
}
......
......@@ -115,6 +115,10 @@ func Debug(ctx context.Context, req *dbg.DebugConfigReq, inStream io.Reader, out
// getCommandLine compose a debug command represented by a core recipe
func getCommandLine(req *dbg.DebugConfigReq, pm *packagemanager.PackageManager) ([]string, error) {
if req.GetImportFile() != "" {
return nil, errors.New("the ImportFile parameter has been deprecated, use ImportDir instead")
}
// TODO: make a generic function to extract sketch from request
// and remove duplication in commands/compile.go
if req.GetSketchPath() == "" {
......@@ -185,40 +189,24 @@ func getCommandLine(req *dbg.DebugConfigReq, pm *packagemanager.PackageManager)
}
}
// Set path to compiled binary
// Make the filename without the FQBN configs part
fqbn.Configs = properties.NewMap()
fqbnSuffix := strings.Replace(fqbn.String(), ":", ".", -1)
var importPath *paths.Path
var importFile string
if req.GetImportFile() == "" {
importPath = sketch.FullPath
importFile = sketch.Name + "." + fqbnSuffix
if importDir := req.GetImportDir(); importDir != "" {
importPath = paths.New(importDir)
} else {
importPath = paths.New(req.GetImportFile()).Parent()
importFile = paths.New(req.GetImportFile()).Base()
// 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)
}
outputTmpFile, ok := toolProperties.GetOk("recipe.output.tmp_file")
outputTmpFile = toolProperties.ExpandPropsInString(outputTmpFile)
if !ok {
return nil, fmt.Errorf("property 'recipe.output.tmp_file' not defined")
if !importPath.Exist() {
return nil, fmt.Errorf("compiled sketch not found in %s", importPath)
}
ext := filepath.Ext(outputTmpFile)
if strings.HasSuffix(importFile, ext) {
importFile = importFile[:len(importFile)-len(ext)]
if !importPath.IsDir() {
return nil, fmt.Errorf("expected compiled sketch in directory %s, but is a file instead", importPath)
}
toolProperties.SetPath("build.path", importPath)
toolProperties.Set("build.project_name", importFile)
uploadFile := importPath.Join(importFile + ext)
if _, err := uploadFile.Stat(); err != nil {
if os.IsNotExist(err) {
return nil, fmt.Errorf("compiled sketch %s not found", uploadFile.String())
}
return nil, errors.Wrap(err, "cannot open sketch")
}
toolProperties.Set("build.project_name", sketch.Name+".ino")
// Set debug port property
port := req.GetPort()
......
......@@ -56,7 +56,7 @@ func TestGetCommandLine(t *testing.T) {
fmt.Sprintf(" %s/arduino-test/tools/openocd/0.10.0-arduino7/bin/openocd%s", dataDir, toolExtension) +
fmt.Sprintf(" -s \"%s/arduino-test/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\"", dataDir) +
fmt.Sprintf(" --file \"%s/arduino-test/samd/variants/arduino_zero/openocd_scripts/arduino_zero.cfg\"", customHardware) +
fmt.Sprintf(" -c \"gdb_port pipe\" -c \"telnet_port 0\" -c init -c halt %s/hello.arduino-test.samd.arduino_zero_edbg.elf", sketchPath)
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)
......@@ -77,7 +77,7 @@ func TestGetCommandLine(t *testing.T) {
fmt.Sprintf(" %s/arduino-test/tools/openocd/0.10.0-arduino7/bin/openocd%s", dataDir, toolExtension) +
fmt.Sprintf(" -s \"%s/arduino-test/tools/openocd/0.10.0-arduino7/share/openocd/scripts/\"", dataDir) +
fmt.Sprintf(" --file \"%s/arduino-test/samd/variants/mkr1000/openocd_scripts/arduino_zero.cfg\"", customHardware) +
fmt.Sprintf(" -c \"gdb_port pipe\" -c \"telnet_port 0\" -c init -c halt %s/hello.arduino-test.samd.mkr1000.elf", sketchPath)
fmt.Sprintf(" -c \"gdb_port pipe\" -c \"telnet_port 0\" -c init -c halt %s/build/arduino-test.samd.mkr1000/hello.ino.elf", sketchPath)
command2, err := getCommandLine(req2, pm)
assert.Nil(t, err)
......
......@@ -20,8 +20,6 @@ import (
"fmt"
"io"
"net/url"
"os"
"path/filepath"
"strings"
"time"
......@@ -147,40 +145,25 @@ func Upload(ctx context.Context, req *rpc.UploadReq, outStream io.Writer, errStr
uploadProperties.Set("upload.verify", uploadProperties.Get("upload.params.noverify"))
}
// Set path to compiled binary
// Make the filename without the FQBN configs part
fqbn.Configs = properties.NewMap()
fqbnSuffix := strings.Replace(fqbn.String(), ":", ".", -1)
var importPath *paths.Path
var importFile string
if req.GetImportFile() == "" {
importPath = sketch.FullPath
importFile = sketch.Name + "." + fqbnSuffix
if importDir := req.GetImportDir(); importDir != "" {
importPath = paths.New(importDir)
} else {
importPath = paths.New(req.GetImportFile()).Parent()
importFile = paths.New(req.GetImportFile()).Base()
// 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)
}
outputTmpFile, ok := uploadProperties.GetOk("recipe.output.tmp_file")
outputTmpFile = uploadProperties.ExpandPropsInString(outputTmpFile)
if !ok {
return nil, fmt.Errorf("property 'recipe.output.tmp_file' not defined")
if !importPath.Exist() {
return nil, fmt.Errorf("compiled sketch not found in %s", importPath)
}
ext := filepath.Ext(outputTmpFile)
if strings.HasSuffix(importFile, ext) {
importFile = importFile[:len(importFile)-len(ext)]
if !importPath.IsDir() {
return nil, fmt.Errorf("expected compiled sketch in directory %s, but is a file instead", importPath)
}
uploadProperties.SetPath("build.path", importPath)
uploadProperties.Set("build.project_name", importFile)
uploadFile := importPath.Join(importFile + ext)
if _, err := uploadFile.Stat(); err != nil {
if os.IsNotExist(err) {
return nil, fmt.Errorf("compiled sketch %s not found", uploadFile.String())
}
return nil, fmt.Errorf("cannot open sketch: %s", err)
}
uploadProperties.Set("build.project_name", sketch.Name+".ino")
// Perform reset via 1200bps touch if requested
if uploadProperties.GetBoolean("upload.use_1200bps_touch") {
......
......@@ -8,6 +8,8 @@ import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -617,11 +619,11 @@ var fileDescriptor_3690061a1131852d = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
const _ = grpc.SupportPackageIsVersion6
// ArduinoCoreClient is the client API for ArduinoCore service.
//
......@@ -674,10 +676,10 @@ type ArduinoCoreClient interface {
}
type arduinoCoreClient struct {
cc *grpc.ClientConn
cc grpc.ClientConnInterface
}
func NewArduinoCoreClient(cc *grpc.ClientConn) ArduinoCoreClient {
func NewArduinoCoreClient(cc grpc.ClientConnInterface) ArduinoCoreClient {
return &arduinoCoreClient{cc}
}
......@@ -1276,6 +1278,86 @@ type ArduinoCoreServer interface {
LibraryList(context.Context, *LibraryListReq) (*LibraryListResp, error)
}
// UnimplementedArduinoCoreServer can be embedded to have forward compatible implementations.
type UnimplementedArduinoCoreServer struct {
}
func (*UnimplementedArduinoCoreServer) Init(req *InitReq, srv ArduinoCore_InitServer) error {
return status.Errorf(codes.Unimplemented, "method Init not implemented")
}
func (*UnimplementedArduinoCoreServer) Destroy(ctx context.Context, req *DestroyReq) (*DestroyResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Destroy not implemented")
}
func (*UnimplementedArduinoCoreServer) Rescan(ctx context.Context, req *RescanReq) (*RescanResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Rescan not implemented")
}
func (*UnimplementedArduinoCoreServer) UpdateIndex(req *UpdateIndexReq, srv ArduinoCore_UpdateIndexServer) error {
return status.Errorf(codes.Unimplemented, "method UpdateIndex not implemented")
}
func (*UnimplementedArduinoCoreServer) UpdateLibrariesIndex(req *UpdateLibrariesIndexReq, srv ArduinoCore_UpdateLibrariesIndexServer) error {
return status.Errorf(codes.Unimplemented, "method UpdateLibrariesIndex not implemented")
}
func (*UnimplementedArduinoCoreServer) Version(ctx context.Context, req *VersionReq) (*VersionResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}
func (*UnimplementedArduinoCoreServer) BoardDetails(ctx context.Context, req *BoardDetailsReq) (*BoardDetailsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BoardDetails not implemented")
}
func (*UnimplementedArduinoCoreServer) BoardAttach(req *BoardAttachReq, srv ArduinoCore_BoardAttachServer) error {
return status.Errorf(codes.Unimplemented, "method BoardAttach not implemented")
}
func (*UnimplementedArduinoCoreServer) BoardList(ctx context.Context, req *BoardListReq) (*BoardListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BoardList not implemented")
}
func (*UnimplementedArduinoCoreServer) BoardListAll(ctx context.Context, req *BoardListAllReq) (*BoardListAllResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method BoardListAll not implemented")
}
func (*UnimplementedArduinoCoreServer) Compile(req *CompileReq, srv ArduinoCore_CompileServer) error {
return status.Errorf(codes.Unimplemented, "method Compile not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformInstall(req *PlatformInstallReq, srv ArduinoCore_PlatformInstallServer) error {
return status.Errorf(codes.Unimplemented, "method PlatformInstall not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformDownload(req *PlatformDownloadReq, srv ArduinoCore_PlatformDownloadServer) error {
return status.Errorf(codes.Unimplemented, "method PlatformDownload not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformUninstall(req *PlatformUninstallReq, srv ArduinoCore_PlatformUninstallServer) error {
return status.Errorf(codes.Unimplemented, "method PlatformUninstall not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformUpgrade(req *PlatformUpgradeReq, srv ArduinoCore_PlatformUpgradeServer) error {
return status.Errorf(codes.Unimplemented, "method PlatformUpgrade not implemented")
}
func (*UnimplementedArduinoCoreServer) Upload(req *UploadReq, srv ArduinoCore_UploadServer) error {
return status.Errorf(codes.Unimplemented, "method Upload not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformSearch(ctx context.Context, req *PlatformSearchReq) (*PlatformSearchResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlatformSearch not implemented")
}
func (*UnimplementedArduinoCoreServer) PlatformList(ctx context.Context, req *PlatformListReq) (*PlatformListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlatformList not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryDownload(req *LibraryDownloadReq, srv ArduinoCore_LibraryDownloadServer) error {
return status.Errorf(codes.Unimplemented, "method LibraryDownload not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryInstall(req *LibraryInstallReq, srv ArduinoCore_LibraryInstallServer) error {
return status.Errorf(codes.Unimplemented, "method LibraryInstall not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryUninstall(req *LibraryUninstallReq, srv ArduinoCore_LibraryUninstallServer) error {
return status.Errorf(codes.Unimplemented, "method LibraryUninstall not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryUpgradeAll(req *LibraryUpgradeAllReq, srv ArduinoCore_LibraryUpgradeAllServer) error {
return status.Errorf(codes.Unimplemented, "method LibraryUpgradeAll not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryResolveDependencies(ctx context.Context, req *LibraryResolveDependenciesReq) (*LibraryResolveDependenciesResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method LibraryResolveDependencies not implemented")
}
func (*UnimplementedArduinoCoreServer) LibrarySearch(ctx context.Context, req *LibrarySearchReq) (*LibrarySearchResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method LibrarySearch not implemented")
}
func (*UnimplementedArduinoCoreServer) LibraryList(ctx context.Context, req *LibraryListReq) (*LibraryListResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method LibraryList not implemented")
}
func RegisterArduinoCoreServer(s *grpc.Server, srv ArduinoCoreServer) {
s.RegisterService(&_ArduinoCore_serviceDesc, srv)
}
......
......@@ -33,11 +33,12 @@ type CompileReq struct {
Verbose bool `protobuf:"varint,10,opt,name=verbose,proto3" json:"verbose,omitempty"`
Quiet bool `protobuf:"varint,11,opt,name=quiet,proto3" json:"quiet,omitempty"`
VidPid string `protobuf:"bytes,12,opt,name=vidPid,proto3" json:"vidPid,omitempty"`
ExportFile string `protobuf:"bytes,13,opt,name=exportFile,proto3" json:"exportFile,omitempty"`
ExportFile string `protobuf:"bytes,13,opt,name=exportFile,proto3" json:"exportFile,omitempty"` // Deprecated: Do not use.
Jobs int32 `protobuf:"varint,14,opt,name=jobs,proto3" json:"jobs,omitempty"`
Libraries []string `protobuf:"bytes,15,rep,name=libraries,proto3" json:"libraries,omitempty"`
OptimizeForDebug bool `protobuf:"varint,16,opt,name=optimizeForDebug,proto3" json:"optimizeForDebug,omitempty"`
DryRun bool `protobuf:"varint,17,opt,name=dryRun,proto3" json:"dryRun,omitempty"`
ExportDir string `protobuf:"bytes,18,opt,name=export_dir,json=exportDir,proto3" json:"export_dir,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
......@@ -152,6 +153,7 @@ func (m *CompileReq) GetVidPid() string {
return ""
}
// Deprecated: Do not use.
func (m *CompileReq) GetExportFile() string {
if m != nil {
return m.ExportFile
......@@ -187,6 +189,13 @@ func (m *CompileReq) GetDryRun() bool {
return false
}
func (m *CompileReq) GetExportDir() string {
if m != nil {
return m.ExportDir
}
return ""
}
type CompileResp struct {
OutStream []byte `protobuf:"bytes,1,opt,name=out_stream,json=outStream,proto3" json:"out_stream,omitempty"`
ErrStream []byte `protobuf:"bytes,2,opt,name=err_stream,json=errStream,proto3" json:"err_stream,omitempty"`
......@@ -242,33 +251,34 @@ func init() {
func init() { proto.RegisterFile("commands/compile.proto", fileDescriptor_86bc582849c76c3d) }
var fileDescriptor_86bc582849c76c3d = []byte{
// 437 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6f, 0xd3, 0x30,
0x14, 0xc6, 0x95, 0xad, 0xed, 0x9a, 0xd7, 0xb1, 0x0d, 0x0b, 0x86, 0x35, 0x01, 0x0a, 0x3b, 0xa0,
0x08, 0xb4, 0x54, 0x82, 0x33, 0x17, 0x86, 0x26, 0x21, 0x2e, 0x55, 0xb8, 0x71, 0x41, 0x89, 0xf3,
0x68, 0x0c, 0x49, 0x9c, 0x3e, 0x3b, 0x2b, 0xf0, 0x5f, 0xf1, 0x1f, 0x22, 0xbf, 0x34, 0x6d, 0x55,
0xc4, 0xc9, 0x7e, 0xbf, 0xf7, 0xf9, 0xf9, 0xb3, 0xf5, 0xc1, 0xa5, 0x32, 0x75, 0x9d, 0x35, 0x85,
0x9d, 0x2b, 0x53, 0xb7, 0xba, 0xc2, 0xa4, 0x25, 0xe3, 0x8c, 0x78, 0xa2, 0x54, 0x92, 0x51, 0xd1,
0xe9, 0xc6, 0x24, 0xaa, 0xd2, 0xc9, 0x20, 0xbb, 0x7a, 0xbc, 0x7f, 0xa0, 0x36, 0x4d, 0xaf, 0xbf,
0xfe, 0x33, 0x02, 0xb8, 0xed, 0x27, 0xa4, 0xb8, 0x12, 0xef, 0x60, 0xaa, 0x1b, 0xeb, 0xb2, 0x46,
0xa1, 0x0c, 0xa2, 0x20, 0x9e, 0xbd, 0x79, 0x91, 0xfc, 0x67, 0x62, 0xf2, 0x71, 0x23, 0x4c, 0xb7,
0x47, 0x84, 0x80, 0xd1, 0xb7, 0x55, 0xde, 0xc8, 0xa3, 0x28, 0x88, 0xc3, 0x94, 0xf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 0xbc, 0x60, 0x2b, 0xff, 0x70, 0xef, 0xaa, 0xa0, 0x5f,
0x69, 0xd7, 0xc8, 0x87, 0xac, 0xd8, 0x54, 0xd7, 0x9f, 0x60, 0xb6, 0x8d, 0x8c, 0x6d, 0xc5, 0x33,
0x00, 0xd3, 0xb9, 0xaf, 0xd6, 0x11, 0x66, 0x35, 0xa7, 0xe6, 0x34, 0x0d, 0x4d, 0xe7, 0x3e, 0x33,
0xf0, 0x6d, 0x24, 0x1a, 0xda, 0x47, 0x7d, 0x1b, 0x89, 0xfa, 0xf6, 0xfb, 0x9b, 0x2f, 0xaf, 0x97,
0xda, 0x95, 0x5d, 0xee, 0x83, 0x35, 0xdf, 0x04, 0x6d, 0x58, 0x6f, 0x54, 0xa5, 0xe7, 0xd4, 0xaa,
0xf9, 0x10, 0xba, 0x7c, 0xc2, 0xb1, 0x7d, 0xfb, 0x37, 0x00, 0x00, 0xff, 0xff, 0xda, 0x5b, 0x4b,
0x18, 0x00, 0x03, 0x00, 0x00,
// 453 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x41, 0x6f, 0xd3, 0x40,
0x10, 0x85, 0xe5, 0x34, 0x49, 0xe3, 0x49, 0x69, 0xcb, 0x0a, 0xca, 0xaa, 0x02, 0x64, 0x72, 0x40,
0x16, 0xa8, 0x8e, 0x04, 0x67, 0x2e, 0x6d, 0x55, 0x09, 0x71, 0x89, 0xcc, 0x8d, 0x4b, 0x65, 0xaf,
0x97, 0x78, 0xc0, 0xf6, 0x3a, 0xb3, 0xeb, 0x06, 0xf8, 0x9d, 0xfc, 0x20, 0xe4, 0x71, 0x9c, 0x44,
0x41, 0x3d, 0xc5, 0xf3, 0xcd, 0xdb, 0xb7, 0x2f, 0xab, 0x07, 0x17, 0xca, 0x94, 0x65, 0x52, 0x65,
0x76, 0xae, 0x4c, 0x59, 0x63, 0xa1, 0xa3, 0x9a, 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b, 0x39, 0x65, 0xde, 0x0d, 0xe2, 0x02, 0xc6, 0x0f, 0x98, 0x2d, 0x30, 0x93, 0x27, 0xec, 0xb4,
0x99, 0xc4, 0x0c, 0x40, 0xff, 0xaa, 0x0d, 0xb9, 0x3b, 0x2c, 0xb4, 0x7c, 0xd2, 0xee, 0xae, 0x07,
0xd2, 0x8b, 0xf7, 0x68, 0xfb, 0xe6, 0x3f, 0x4c, 0x6a, 0xe5, 0x69, 0xe0, 0x85, 0xa3, 0x98, 0xbf,
0xdb, 0xff, 0x58, 0x60, 0x4a, 0x09, 0xb5, 0xf9, 0xcf, 0x38, 0xff, 0x0e, 0x88, 0x77, 0x70, 0x6e,
0x6a, 0x87, 0x25, 0xfe, 0xd1, 0x77, 0x86, 0x6e, 0x75, 0xda, 0x2c, 0xe5, 0x39, 0xc7, 0xf9, 0x8f,
0xb7, 0xc9, 0x32, 0xfa, 0x1d, 0x37, 0x95, 0x7c, 0xca, 0x8a, 0xcd, 0x24, 0x5e, 0xf5, 0xc9, 0xee,
0x33, 0x24, 0x29, 0xba, 0x67, 0xec, 0xc8, 0x2d, 0xd2, 0xec, 0x0b, 0x4c, 0xb7, 0xad, 0xb2, 0x75,
0xab, 0x36, 0x8d, 0xbb, 0xb7, 0x8e, 0x74, 0x52, 0x72, 0xb1, 0x4e, 0x62, 0xdf, 0x34, 0xee, 0x2b,
0x03, 0x36, 0x23, 0xea, 0xd7, 0x83, 0x6e, 0xad, 0x89, 0xba, 0xf5, 0xf5, 0xd5, 0xb7, 0xf7, 0x4b,
0x74, 0x79, 0x93, 0xb6, 0xdd, 0x9b, 0x6f, 0xba, 0xd8, 0xff, 0x5e, 0xa9, 0x02, 0xe7, 0x54, 0xab,
0x79, 0xdf, 0xcb, 0x74, 0xcc, 0xcd, 0xfe, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x40, 0x39, 0x20,
0x0a, 0x23, 0x03, 0x00, 0x00,
}
......@@ -34,11 +34,12 @@ message CompileReq {
bool verbose = 10; // Turns on verbose mode.
bool quiet = 11; // Suppresses almost every output.
string vidPid = 12; // VID/PID specific build properties.
string exportFile = 13; // The compiled binary is written to this file
string exportFile = 13 [deprecated = true]; // DEPRECATED: use exportDir instead
int32 jobs = 14; // The max number of concurrent compiler instances to run (as make -jx)
repeated string libraries = 15; // List of custom libraries paths separated by commas. Or can be used multiple times for multiple libraries paths.
bool optimizeForDebug = 16; // Optimize compile output for debug, not for release
bool dryRun = 17; // When set to true the compiled binary will not be copied to the export directory
string export_dir = 18; // Optional: save the build artifacts in this directory, the directory must exist
}
message CompileResp {
......
......@@ -27,7 +27,8 @@ type UploadReq struct {
Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"`
Verbose bool `protobuf:"varint,5,opt,name=verbose,proto3" json:"verbose,omitempty"`
Verify bool `protobuf:"varint,6,opt,name=verify,proto3" json:"verify,omitempty"`
ImportFile string `protobuf:"bytes,7,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"`
ImportFile string `protobuf:"bytes,7,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"` // Deprecated: Do not use.
ImportDir string `protobuf:"bytes,8,opt,name=import_dir,json=importDir,proto3" json:"import_dir,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
......@@ -100,6 +101,7 @@ func (m *UploadReq) GetVerify() bool {
return false
}
// Deprecated: Do not use.
func (m *UploadReq) GetImportFile() string {
if m != nil {
return m.ImportFile
......@@ -107,6 +109,13 @@ func (m *UploadReq) GetImportFile() string {
return ""
}
func (m *UploadReq) GetImportDir() string {
if m != nil {
return m.ImportDir
}
return ""
}
type UploadResp struct {
OutStream []byte `protobuf:"bytes,1,opt,name=out_stream,json=outStream,proto3" json:"out_stream,omitempty"`
ErrStream []byte `protobuf:"bytes,2,opt,name=err_stream,json=errStream,proto3" json:"err_stream,omitempty"`
......@@ -162,24 +171,25 @@ func init() {
func init() { proto.RegisterFile("commands/upload.proto", fileDescriptor_cd642cc079f8acdb) }
var fileDescriptor_cd642cc079f8acdb = []byte{
// 291 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x4f, 0x4b, 0xc4, 0x30,
0x10, 0xc5, 0xe9, 0xba, 0xee, 0x9f, 0x59, 0x4f, 0x01, 0x35, 0x08, 0xe2, 0xba, 0xa7, 0x05, 0xd9,
0x14, 0xf4, 0xec, 0xc5, 0x83, 0xa0, 0x27, 0xa9, 0x78, 0xf1, 0x52, 0xd2, 0x34, 0xb5, 0xc1, 0x36,
0xc9, 0x26, 0xe9, 0x82, 0x5f, 0xd8, 0xcf, 0x21, 0x49, 0x1a, 0x3d, 0x79, 0xca, 0x64, 0x7e, 0xef,
0xcd, 0x30, 0x0f, 0x4e, 0x99, 0xea, 0x7b, 0x2a, 0x6b, 0x9b, 0x0f, 0xba, 0x53, 0xb4, 0x26, 0xda,
0x28, 0xa7, 0xd0, 0x39, 0x63, 0x84, 0x9a, 0x7a, 0x10, 0x52, 0x11, 0xd6, 0x09, 0x92, 0x54, 0x17,
0x7f, 0x7a, 0x5f, 0x28, 0x19, 0xf5, 0x9b, 0xef, 0x0c, 0x96, 0x6f, 0x61, 0x40, 0xc1, 0xf7, 0xe8,
0x1e, 0x16, 0x42, 0x5a, 0x47, 0x25, 0xe3, 0x38, 0x5b, 0x67, 0xdb, 0xd5, 0xed, 0x35, 0xf9, 0x67,
0x20, 0x79, 0x1a, 0x85, 0xc5, 0xaf, 0x05, 0x21, 0x98, 0x36, 0xfb, 0x4a, 0xe2, 0xc9, 0x3a, 0xdb,
0x2e, 0x8b, 0x50, 0xa3, 0x2b, 0x58, 0xd9, 0x4f, 0xee, 0x58, 0x5b, 0x6a, 0xea, 0x5a, 0x7c, 0x14,
0x10, 0xc4, 0xd6, 0x0b, 0x75, 0xad, 0x37, 0x69, 0x65, 0x1c, 0x9e, 0x46, 0x93, 0xaf, 0x11, 0x86,
0xf9, 0x81, 0x9b, 0x4a, 0x59, 0x8e, 0x8f, 0xd7, 0xd9, 0x76, 0x51, 0xa4, 0x2f, 0x3a, 0x83, 0xd9,
0x81, 0x1b, 0xd1, 0x7c, 0xe1, 0x59, 0x00, 0xe3, 0xcf, 0xaf, 0x11, 0xbd, 0xf7, 0x96, 0x8d, 0xe8,
0x38, 0x9e, 0xc7, 0x35, 0xb1, 0xf5, 0x28, 0x3a, 0xbe, 0x79, 0x06, 0x48, 0x77, 0x5a, 0x8d, 0x2e,
0x01, 0xd4, 0xe0, 0x4a, 0xeb, 0x0c, 0xa7, 0x7d, 0x38, 0xf5, 0xa4, 0x58, 0xaa, 0xc1, 0xbd, 0x86,
0x86, 0xc7, 0xdc, 0x98, 0x84, 0x27, 0x11, 0x73, 0x63, 0x22, 0x7e, 0xd8, 0xbd, 0xdf, 0x7c, 0x08,
0xd7, 0x0e, 0x95, 0x4f, 0x23, 0x1f, 0xd3, 0x49, 0xef, 0x8e, 0x75, 0x22, 0x37, 0x9a, 0xe5, 0x29,
0xa9, 0x6a, 0x16, 0xa2, 0xbe, 0xfb, 0x09, 0x00, 0x00, 0xff, 0xff, 0xfc, 0xf8, 0xc5, 0x33, 0xb3,
0x01, 0x00, 0x00,
// 312 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4b, 0xfc, 0x30,
0x10, 0xc5, 0x69, 0xff, 0xfb, 0xdf, 0xdd, 0xce, 0x7a, 0x0a, 0xa8, 0x41, 0x10, 0xd7, 0xf5, 0xb2,
0x20, 0xdb, 0x82, 0x9e, 0xbd, 0x2c, 0x22, 0xe8, 0x49, 0x2a, 0x5e, 0xbc, 0x94, 0x34, 0xcd, 0xda,
0x60, 0xdb, 0x74, 0x27, 0xe9, 0x82, 0x1f, 0xc1, 0x6f, 0x2d, 0x49, 0x1a, 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0x6f, 0xcd, 0x6a, 0x30, 0x85, 0x36, 0x28, 0x58, 0xeb, 0xda, 0x38,
0xca, 0x13, 0x35, 0x98, 0x17, 0x27, 0x58, 0x2c, 0x10, 0x03, 0x8e, 0x3d, 0x16, 0x88, 0x1e, 0x6f,
0x37, 0x6f, 0xd7, 0xef, 0xd2, 0xd4, 0x43, 0x69, 0x0b, 0xcb, 0xc6, 0x02, 0xc3, 0x77, 0xc3, 0x1b,
0x99, 0x61, 0xcf, 0xb3, 0x50, 0x66, 0x39, 0x75, 0xaf, 0x71, 0xfb, 0x1d, 0x00, 0x00, 0xff, 0xff,
0xb9, 0xb9, 0xe0, 0xf7, 0xd6, 0x01, 0x00, 0x00,
}
......@@ -28,7 +28,8 @@ message UploadReq {
string port = 4;
bool verbose = 5;
bool verify = 6;
string import_file = 7;
string import_file = 7 [deprecated = true]; // DEPRECTAED: Use import_dir instead
string import_dir = 8;
}
message UploadResp {
......
......@@ -9,6 +9,8 @@ import (
commands "github.com/arduino/arduino-cli/rpc/commands"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -89,15 +91,17 @@ func (m *DebugReq) GetSendInterrupt() bool {
}
type DebugConfigReq struct {
Instance *commands.Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"`
Fqbn string `protobuf:"bytes,2,opt,name=fqbn,proto3" json:"fqbn,omitempty"`
SketchPath string `protobuf:"bytes,3,opt,name=sketch_path,json=sketchPath,proto3" json:"sketch_path,omitempty"`
Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"`
Interpreter string `protobuf:"bytes,5,opt,name=interpreter,proto3" json:"interpreter,omitempty"`
ImportFile string `protobuf:"bytes,6,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
Instance *commands.Instance `protobuf:"bytes,1,opt,name=instance,proto3" json:"instance,omitempty"`
Fqbn string `protobuf:"bytes,2,opt,name=fqbn,proto3" json:"fqbn,omitempty"`
SketchPath string `protobuf:"bytes,3,opt,name=sketch_path,json=sketchPath,proto3" json:"sketch_path,omitempty"`
Port string `protobuf:"bytes,4,opt,name=port,proto3" json:"port,omitempty"`
Interpreter string `protobuf:"bytes,5,opt,name=interpreter,proto3" json:"interpreter,omitempty"`
// DEPRECATED: use import_dir instead
ImportFile string `protobuf:"bytes,7,opt,name=import_file,json=importFile,proto3" json:"import_file,omitempty"` // Deprecated: Do not use.
ImportDir string `protobuf:"bytes,8,opt,name=import_dir,json=importDir,proto3" json:"import_dir,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *DebugConfigReq) Reset() { *m = DebugConfigReq{} }
......@@ -160,6 +164,7 @@ func (m *DebugConfigReq) GetInterpreter() string {
return ""
}
// Deprecated: Do not use.
func (m *DebugConfigReq) GetImportFile() string {
if m != nil {
return m.ImportFile
......@@ -167,6 +172,13 @@ func (m *DebugConfigReq) GetImportFile() string {
return ""
}
func (m *DebugConfigReq) GetImportDir() string {
if m != nil {
return m.ImportDir
}
return ""
}
//
type DebugResp struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
......@@ -224,39 +236,40 @@ func init() {
func init() { proto.RegisterFile("debug/debug.proto", fileDescriptor_5ae24eab94cb53d5) }
var fileDescriptor_5ae24eab94cb53d5 = []byte{
// 356 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x51, 0x4b, 0xeb, 0x30,
0x18, 0xbd, 0xb9, 0x77, 0x1b, 0x5d, 0x76, 0xef, 0xe0, 0x86, 0x09, 0x65, 0x0f, 0xae, 0x16, 0x85,
0x22, 0xd8, 0x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7e, 0x63, 0x86, 0x96, 0x4b, 0x45,
0x4c, 0xe9, 0x92, 0x0c, 0x31, 0xf4, 0xd4, 0x33, 0x31, 0xa5, 0x35, 0x29, 0xa9, 0x4d, 0xd8, 0xf3,
0x26, 0x8b, 0x51, 0x04, 0x47, 0x2e, 0xbc, 0xd2, 0xcc, 0x30, 0x1d, 0xf6, 0xdd, 0x68, 0x9f, 0xb2,
0x6b, 0xf9, 0xc6, 0x6a, 0x97, 0x2b, 0x5e, 0xb1, 0x70, 0xe0, 0xd7, 0x7a, 0xea, 0x91, 0x57, 0x2c,
0xbe, 0x86, 0xc3, 0xb6, 0xe6, 0x5a, 0xed, 0x5a, 0x02, 0x7b, 0x2d, 0x4d, 0x60, 0x9f, 0x69, 0x2d,
0x75, 0x9b, 0xd6, 0x7f, 0xcc, 0x5f, 0x60, 0xdf, 0xd9, 0xd0, 0x53, 0x07, 0x8e, 0x0f, 0x9c, 0x08,
0x66, 0xdb, 0xe9, 0xec, 0xe0, 0xbc, 0x56, 0xf1, 0xaf, 0x04, 0x5c, 0x82, 0xbb, 0xf3, 0xd7, 0x64,
0xcd, 0x4d, 0xd9, 0xe4, 0xb6, 0xc1, 0xac, 0xd5, 0x77, 0xef, 0x0b, 0x5a, 0xf1, 0x4c, 0x2b, 0xea,
0xaf, 0x55, 0x3e, 0x70, 0x57, 0xe5, 0xea, 0x33, 0x00, 0x00, 0xff, 0xff, 0x1b, 0x73, 0x1a, 0x21,
0x6c, 0x02, 0x00, 0x00,
// 375 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x52, 0x51, 0xcb, 0xd3, 0x30,
0x14, 0x35, 0x9f, 0x9b, 0xb6, 0xb7, 0x3a, 0x30, 0x4c, 0x08, 0x03, 0x5d, 0xad, 0x0a, 0x45, 0xb0,
0x95, 0x89, 0x8f, 0x82, 0xcc, 0x21, 0xec, 0x45, 0x24, 0x2f, 0x82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, 0xd4, 0xb7, 0xd2, 0x36, 0xce, 0xa4, 0x95, 0xb1, 0x64, 0x36, 0x98, 0x1c, 0xc6,
0x31, 0x44, 0x3e, 0xbc, 0x36, 0xdc, 0x72, 0x43, 0xe6, 0xbe, 0x74, 0x4d, 0xe1, 0x97, 0x10, 0x89,
0x93, 0xd3, 0x16, 0x07, 0xd1, 0x72, 0xf2, 0xd0, 0x29, 0xb6, 0x77, 0x04, 0x51, 0x18, 0xe8, 0x2f,
0xa2, 0xe5, 0xf8, 0x19, 0x8c, 0xa7, 0xa2, 0x16, 0x86, 0x04, 0xbe, 0x4b, 0x38, 0x30, 0x3b, 0x61,
0x92, 0x0f, 0x10, 0x8e, 0x2f, 0xd1, 0xe9, 0xcb, 0x20, 0xd1, 0xd5, 0x20, 0x97, 0x30, 0xe7, 0xc6,
0x28, 0x33, 0x5e, 0x68, 0x38, 0x6c, 0xbe, 0xc3, 0xdc, 0xdb, 0xf0, 0xd7, 0x09, 0x3c, 0xbf, 0xf1,
0x68, 0x94, 0x9f, 0x57, 0xeb, 0x9b, 0xf5, 0x4e, 0x27, 0xf7, 0x52, 0xf4, 0x0e, 0x6d, 0xdf, 0xfc,
0x48, 0x8f, 0xc2, 0x36, 0x7d, 0xe5, 0x86, 0x9c, 0x8f, 0xfa, 0xe9, 0xff, 0x96, 0xb5, 0x22, 0x37,
0x9a, 0x0d, 0x9b, 0x57, 0x3d, 0xf0, 0xdb, 0xf4, 0xfe, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4,
0xb6, 0x03, 0x86, 0x8f, 0x02, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
const _ = grpc.SupportPackageIsVersion6
// DebugClient is the client API for Debug service.
//
......@@ -266,10 +279,10 @@ type DebugClient interface {
}
type debugClient struct {
cc *grpc.ClientConn
cc grpc.ClientConnInterface
}
func NewDebugClient(cc *grpc.ClientConn) DebugClient {
func NewDebugClient(cc grpc.ClientConnInterface) DebugClient {
return &debugClient{cc}
}
......@@ -309,6 +322,14 @@ type DebugServer interface {
Debug(Debug_DebugServer) error
}
// UnimplementedDebugServer can be embedded to have forward compatible implementations.
type UnimplementedDebugServer struct {
}
func (*UnimplementedDebugServer) Debug(srv Debug_DebugServer) error {
return status.Errorf(codes.Unimplemented, "method Debug not implemented")
}
func RegisterDebugServer(s *grpc.Server, srv DebugServer) {
s.RegisterService(&_Debug_serviceDesc, srv)
}
......
......@@ -53,7 +53,9 @@ message DebugConfigReq {
string sketch_path = 3;
string port = 4;
string interpreter = 5;
string import_file = 6;
// DEPRECATED: use import_dir instead
string import_file = 7 [deprecated = true];
string import_dir = 8;
}
//
......
......@@ -9,6 +9,8 @@ import (
proto "github.com/golang/protobuf/proto"
_struct "github.com/golang/protobuf/ptypes/struct"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -270,11 +272,11 @@ var fileDescriptor_94d5950496a7550d = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
const _ = grpc.SupportPackageIsVersion6
// MonitorClient is the client API for Monitor service.
//
......@@ -286,10 +288,10 @@ type MonitorClient interface {
}
type monitorClient struct {
cc *grpc.ClientConn
cc grpc.ClientConnInterface
}
func NewMonitorClient(cc *grpc.ClientConn) MonitorClient {
func NewMonitorClient(cc grpc.ClientConnInterface) MonitorClient {
return &monitorClient{cc}
}
......@@ -331,6 +333,14 @@ type MonitorServer interface {
StreamingOpen(Monitor_StreamingOpenServer) error
}
// UnimplementedMonitorServer can be embedded to have forward compatible implementations.
type UnimplementedMonitorServer struct {
}
func (*UnimplementedMonitorServer) StreamingOpen(srv Monitor_StreamingOpenServer) error {
return status.Errorf(codes.Unimplemented, "method StreamingOpen not implemented")
}
func RegisterMonitorServer(s *grpc.Server, srv MonitorServer) {
s.RegisterService(&_Monitor_serviceDesc, srv)
}
......
......@@ -8,6 +8,8 @@ import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
......@@ -279,11 +281,11 @@ var fileDescriptor_a4bfd59e429426d0 = []byte{
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
const _ = grpc.SupportPackageIsVersion6
// SettingsClient is the client API for Settings service.
//
......@@ -300,10 +302,10 @@ type SettingsClient interface {
}
type settingsClient struct {
cc *grpc.ClientConn
cc grpc.ClientConnInterface
}
func NewSettingsClient(cc *grpc.ClientConn) SettingsClient {
func NewSettingsClient(cc grpc.ClientConnInterface) SettingsClient {
return &settingsClient{cc}
}
......@@ -355,6 +357,23 @@ type SettingsServer interface {
SetValue(context.Context, *Value) (*SetValueResponse, error)
}
// UnimplementedSettingsServer can be embedded to have forward compatible implementations.
type UnimplementedSettingsServer struct {
}
func (*UnimplementedSettingsServer) GetAll(ctx context.Context, req *GetAllRequest) (*RawData, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetAll not implemented")
}
func (*UnimplementedSettingsServer) Merge(ctx context.Context, req *RawData) (*MergeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Merge not implemented")
}
func (*UnimplementedSettingsServer) GetValue(ctx context.Context, req *GetValueRequest) (*Value, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetValue not implemented")
}
func (*UnimplementedSettingsServer) SetValue(ctx context.Context, req *Value) (*SetValueResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetValue not implemented")
}
func RegisterSettingsServer(s *grpc.Server, srv SettingsServer) {
s.RegisterService(&_Settings_serviceDesc, srv)
}
......
......@@ -74,15 +74,15 @@ def test_compile_with_simple_sketch(run_command, data_dir, working_dir):
expected_trace_sequence, json_log_lines
)
# Test the --output flag with absolute path
target = os.path.join(data_dir, "test.hex")
# Test the --output-dir flag with absolute path
target = os.path.join(data_dir, "test_dir")
result = run_command(
"compile -b {fqbn} {sketch_path} -o {target}".format(
"compile -b {fqbn} {sketch_path} --output-dir {target}".format(
fqbn=fqbn, sketch_path=sketch_path, target=target
)
)
assert result.ok
assert os.path.exists(target)
assert os.path.exists(target) and os.path.isdir(target)
@pytest.mark.skipif(
......@@ -104,23 +104,15 @@ def test_output_flag_default_path(run_command, data_dir, working_dir):
result = run_command("sketch new {}".format(sketch_path))
assert result.ok
# Test the --output flag defaulting to current working dir
# Test the --output-dir flag defaulting to current working dir
result = run_command(
"compile -b {fqbn} {sketch_path} -o test".format(
"compile -b {fqbn} {sketch_path} --output-dir test".format(
fqbn=fqbn, sketch_path=sketch_path
)
)
assert result.ok
assert os.path.exists(os.path.join(working_dir, "test.hex"))
# Test extension won't be added if already present
result = run_command(
"compile -b {fqbn} {sketch_path} -o test2.hex".format(
fqbn=fqbn, sketch_path=sketch_path
)
)
assert result.ok
assert os.path.exists(os.path.join(working_dir, "test2.hex"))
target = os.path.join(working_dir, "test")
assert os.path.exists(target) and os.path.isdir(target)
def test_compile_with_sketch_with_symlink_selfloop(run_command, data_dir):
......
......@@ -122,7 +122,7 @@ def test_core_install_esp32(run_command, data_dir):
# prevent regressions for https://github.com/arduino/arduino-cli/issues/163
assert os.path.exists(
os.path.join(
sketch_path, "test_core_install_esp32.esp32.esp32.esp32.partitions.bin"
sketch_path, "build/esp32.esp32.esp32/test_core_install_esp32.ino.partitions.bin"
)
)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment