Skip to content

Commit

Permalink
Revert "AddgRPC interface to collect every sketch file (#926)"
Browse files Browse the repository at this point in the history
This reverts commit 21d2533.
  • Loading branch information
silvanocerza authored Aug 31, 2020
1 parent 21d2533 commit b1a290c
Show file tree
Hide file tree
Showing 17 changed files with 200 additions and 544 deletions.
48 changes: 0 additions & 48 deletions client_example/go.sum

Large diffs are not rendered by default.

18 changes: 0 additions & 18 deletions client_example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ func main() {
log.Println("calling Version")
callVersion(client)

log.Println("calling LoadSketch")
callLoadSketch(client)

// Use SetValue to configure the arduino-cli directories.
log.Println("calling SetValue")
callSetValue(settingsClient)
Expand Down Expand Up @@ -881,18 +878,3 @@ func waitForPrompt(debugStreamingOpenClient dbg.Debug_DebugClient, prompt string
}
}
}

func callLoadSketch(client rpc.ArduinoCoreClient) {
currDir, _ := os.Getwd()
sketch, err := client.LoadSketch(context.Background(), &rpc.LoadSketchReq{
SketchPath: filepath.Join(currDir, "hello"),
})
if err != nil {
log.Fatalf("Error getting version: %s", err)
}

log.Printf("Sketch main file: %s", sketch.GetMainFile())
log.Printf("Sketch location: %s", sketch.GetLocationPath())
log.Printf("Other sketch files: %v", sketch.GetOtherSketchFiles())
log.Printf("Sketch additional files: %v", sketch.GetAdditionalFiles())
}
5 changes: 0 additions & 5 deletions commands/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ func (s *ArduinoCoreServerImpl) Version(ctx context.Context, req *rpc.VersionReq
return &rpc.VersionResp{Version: s.VersionString}, nil
}

// LoadSketch FIXMEDOC
func (s *ArduinoCoreServerImpl) LoadSketch(ctx context.Context, req *rpc.LoadSketchReq) (*rpc.LoadSketchResp, error) {
return commands.LoadSketch(ctx, req)
}

// Compile FIXMEDOC
func (s *ArduinoCoreServerImpl) Compile(req *rpc.CompileReq, stream rpc.ArduinoCore_CompileServer) error {
resp, err := compile.Compile(
Expand Down
26 changes: 0 additions & 26 deletions commands/instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"net/url"
"path"

"github.com/arduino/arduino-cli/arduino/builder"
"github.com/arduino/arduino-cli/arduino/cores"
"github.com/arduino/arduino-cli/arduino/cores/packageindex"
"github.com/arduino/arduino-cli/arduino/cores/packagemanager"
Expand Down Expand Up @@ -677,28 +676,3 @@ func createInstance(ctx context.Context, getLibOnly bool) (*createInstanceResult

return res, nil
}

// LoadSketch collects and returns all files composing a sketch
func LoadSketch(ctx context.Context, req *rpc.LoadSketchReq) (*rpc.LoadSketchResp, error) {
sketch, err := builder.SketchLoad(req.SketchPath, "")
if err != nil {
return nil, fmt.Errorf("Error loading sketch %v: %v", req.SketchPath, err)
}

otherSketchFiles := make([]string, len(sketch.OtherSketchFiles))
for i, file := range sketch.OtherSketchFiles {
otherSketchFiles[i] = file.Path
}

additionalFiles := make([]string, len(sketch.AdditionalFiles))
for i, file := range sketch.AdditionalFiles {
additionalFiles[i] = file.Path
}

return &rpc.LoadSketchResp{
MainFile: sketch.MainFile.Path,
LocationPath: sketch.LocationPath,
OtherSketchFiles: otherSketchFiles,
AdditionalFiles: additionalFiles,
}, nil
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/fluxio/iohelpers v0.0.0-20160419043813-3a4dd67a94d2 // indirect
github.com/fluxio/multierror v0.0.0-20160419044231-9c68d39025e5 // indirect
github.com/gofrs/uuid v3.2.0+incompatible
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.4.1
github.com/h2non/filetype v1.0.8 // indirect
github.com/imjasonmiller/godice v0.1.2
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1 h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
Expand Down Expand Up @@ -322,7 +320,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
Expand Down
2 changes: 1 addition & 1 deletion rpc/commands/board.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b1a290c

Please sign in to comment.