// This file is part of arduino-cli.
//
// Copyright 2020 ARDUINO SA (http://www.arduino.cc/)
// Copyright 2015 Matthijs Kooijman
//
// 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.

// compile me with: protoc -I proto/ proto/builder.proto  --go_out=plugins=grpc:proto

syntax = "proto3";

option java_multiple_files = true;
option java_package = "cc.arduino.builder";
option java_outer_classname = "BuilderProto";

package proto;

// Interface exported by the server.
service Builder {

  // A server-to-client streaming RPC.
  //
  // Obtains the Features available within the given Rectangle.  Results are
  // streamed rather than returned at once (e.g. in a response message with a
  // repeated field), as the rectangle may cover a large area and contain a
  // huge number of features.
  rpc Build(BuildParams) returns (stream Response) {}

  rpc Autocomplete(BuildParams) returns (Response) {}

  rpc DropCache(VerboseParams) returns (Response) {}
}

message BuildParams {
  string hardwareFolders = 1;
  string toolsFolders = 2;
  string builtInLibrariesFolders = 3;
  string otherLibrariesFolders = 4;
  string sketchLocation = 5;
  string fQBN = 6;
  string arduinoAPIVersion = 7;
  string customBuildProperties = 8;
  string buildCachePath = 9;
  string buildPath = 10;
  string warningsLevel = 11;
  string codeCompleteAt = 12;
  bool verbose = 13;
}

message VerboseParams {
  bool verbose = 1;
}

message Response {
  string line = 1;
}
