Skip to content

Commit

Permalink
feat: use Arduino CLI 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocusinato committed Nov 21, 2024
1 parent 8773bd6 commit d106588
Show file tree
Hide file tree
Showing 18 changed files with 1,035 additions and 520 deletions.
2 changes: 1 addition & 1 deletion arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
],
"arduino": {
"arduino-cli": {
"version": "1.0.4"
"version": "1.1.0"
},
"arduino-fwuploader": {
"version": "2.4.1"
Expand Down
4 changes: 2 additions & 2 deletions arduino-ide-extension/src/browser/contributions/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ export class Debug
): Promise<boolean> {
if (err instanceof Error) {
try {
const tempBuildPaths = await this.sketchesService.tempBuildPath(sketch);
return tempBuildPaths.some((tempBuildPath) =>
const buildPaths = await this.sketchesService.getBuildPath(sketch);
return buildPaths.some((tempBuildPath) =>
err.message.includes(tempBuildPath)
);
} catch {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ export interface SketchesService {
/**
* This is the JS/TS re-implementation of [`GenBuildPath`](https://github.com/arduino/arduino-cli/blob/c0d4e4407d80aabad81142693513b3306759cfa6/arduino/sketch/sketch.go#L296-L306) of the CLI.
* Pass in a sketch and get the build temporary folder filesystem path calculated from the main sketch file location. Can be multiple ones. This method does not check the existence of the sketch.
* Since CLI v1.1.0 the default sketch folder is the os user cache dir. See https://github.com/arduino/arduino-cli/pull/2673/commits/d2ffeb06ca6360a211d5aa7ddd11505212ffb1b9
*
* The case sensitivity of the drive letter on Windows matters when the CLI calculates the MD5 hash of the temporary build folder.
* IDE2 does not know and does not want to rely on how the CLI treats the paths: with lowercase or uppercase drive letters.
* Hence, IDE2 has to provide multiple build paths on Windows. This hack will be obsolete when the CLI can provide error codes:
* https://github.com/arduino/arduino-cli/issues/1762.
*/
tempBuildPath(sketch: SketchRef): Promise<string[]>;
getBuildPath(sketch: SketchRef): Promise<string[]>;
}

export interface SketchRef {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

import * as grpc from "@grpc/grpc-js";
import * as cc_arduino_cli_commands_v1_commands_pb from "../../../../../cc/arduino/cli/commands/v1/commands_pb";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb";
import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb";
import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb";
import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb";
import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb";
import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb";
import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb";
import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb";
import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";

interface IArduinoCoreServiceService extends grpc.ServiceDefinition<grpc.UntypedServiceImplementation> {
create: IArduinoCoreServiceService_ICreate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
//
'use strict';
var cc_arduino_cli_commands_v1_commands_pb = require('../../../../../cc/arduino/cli/commands/v1/commands_pb.js');
var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js');
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js');
var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js');
var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js');
var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js');
var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js');
var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js');
var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js');
var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js');
var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js');
var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');

function serialize_cc_arduino_cli_commands_v1_ArchiveSketchRequest(arg) {
if (!(arg instanceof cc_arduino_cli_commands_v1_commands_pb.ArchiveSketchRequest)) {
Expand Down Expand Up @@ -1109,9 +1109,9 @@ function deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse(buffer
}


// The main Arduino Platform service API
// The main Arduino Platform service API.
var ArduinoCoreServiceService = exports['cc.arduino.cli.commands.v1.ArduinoCoreService'] = {
// Create a new Arduino Core instance
// Create a new Arduino Core instance.
create: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Create',
requestStream: false,
Expand All @@ -1124,7 +1124,7 @@ create: {
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CreateResponse,
},
// Initializes an existing Arduino Core instance by loading platforms and
// libraries
// libraries.
init: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Init',
requestStream: false,
Expand All @@ -1136,7 +1136,7 @@ init: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_InitResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_InitResponse,
},
// Destroy an instance of the Arduino Core Service
// Destroy an instance of the Arduino Core Service.
destroy: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Destroy',
requestStream: false,
Expand All @@ -1148,7 +1148,7 @@ destroy: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_DestroyResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_DestroyResponse,
},
// Update package index of the Arduino Core Service
// Update package index of the Arduino Core Service.
updateIndex: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateIndex',
requestStream: false,
Expand All @@ -1160,7 +1160,7 @@ updateIndex: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_UpdateIndexResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_UpdateIndexResponse,
},
// Update libraries index
// Update libraries index.
updateLibrariesIndex: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/UpdateLibrariesIndex',
requestStream: false,
Expand All @@ -1184,7 +1184,7 @@ version: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_VersionResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_VersionResponse,
},
// Create a new Sketch
// Create a new Sketch.
newSketch: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/NewSketch',
requestStream: false,
Expand All @@ -1196,7 +1196,7 @@ newSketch: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_NewSketchResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_NewSketchResponse,
},
// Returns all files composing a Sketch
// Returns all files composing a Sketch.
loadSketch: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/LoadSketch',
requestStream: false,
Expand All @@ -1208,7 +1208,7 @@ loadSketch: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_LoadSketchResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LoadSketchResponse,
},
// Creates a zip file containing all files of specified Sketch
// Creates a zip file containing all files of specified Sketch.
archiveSketch: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ArchiveSketch',
requestStream: false,
Expand All @@ -1234,10 +1234,7 @@ setSketchDefaults: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SetSketchDefaultsResponse,
},
// BOARD COMMANDS
// --------------
//
// Requests details about a board
// Requests details about a board.
boardDetails: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/BoardDetails',
requestStream: false,
Expand Down Expand Up @@ -1469,7 +1466,7 @@ libraryUpgrade: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_LibraryUpgradeResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LibraryUpgradeResponse,
},
// Install a library from a Zip File
// Install a library from a Zip File.
zipLibraryInstall: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ZipLibraryInstall',
requestStream: false,
Expand All @@ -1481,7 +1478,7 @@ zipLibraryInstall: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ZipLibraryInstallResponse,
},
// Download and install a library from a git url
// Download and install a library from a git url.
gitLibraryInstall: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/GitLibraryInstall',
requestStream: false,
Expand Down Expand Up @@ -1554,7 +1551,7 @@ libraryList: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_LibraryListResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_LibraryListResponse,
},
// Open a monitor connection to a board port
// Open a monitor connection to a board port.
monitor: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/Monitor',
requestStream: true,
Expand All @@ -1566,7 +1563,7 @@ monitor: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_MonitorResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_MonitorResponse,
},
// Returns the parameters that can be set in the MonitorRequest calls
// Returns the parameters that can be set in the MonitorRequest calls.
enumerateMonitorPortSettings: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/EnumerateMonitorPortSettings',
requestStream: false,
Expand Down Expand Up @@ -1638,7 +1635,7 @@ cleanDownloadCacheDirectory: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_CleanDownloadCacheDirectoryResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_CleanDownloadCacheDirectoryResponse,
},
// Writes the settings currently stored in memory in a YAML file
// Writes the settings currently stored in memory in a YAML file.
configurationSave: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationSave',
requestStream: false,
Expand All @@ -1650,7 +1647,7 @@ configurationSave: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationSaveResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationSaveResponse,
},
// Read the settings from a YAML file
// Read the settings from a YAML file.
configurationOpen: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationOpen',
requestStream: false,
Expand All @@ -1662,7 +1659,8 @@ configurationOpen: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationOpenResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationOpenResponse,
},
configurationGet: {
// Get the current configuration.
configurationGet: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/ConfigurationGet',
requestStream: false,
responseStream: false,
Expand All @@ -1673,7 +1671,7 @@ configurationOpen: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_ConfigurationGetResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_ConfigurationGetResponse,
},
// Enumerate all the keys/values pairs available in the configuration
// Enumerate all the keys/values pairs available in the configuration.
settingsEnumerate: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsEnumerate',
requestStream: false,
Expand All @@ -1685,7 +1683,7 @@ settingsEnumerate: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsEnumerateResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsEnumerateResponse,
},
// Get a single configuration value
// Get a single configuration value.
settingsGetValue: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsGetValue',
requestStream: false,
Expand All @@ -1697,7 +1695,7 @@ settingsGetValue: {
responseSerialize: serialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse,
responseDeserialize: deserialize_cc_arduino_cli_commands_v1_SettingsGetValueResponse,
},
// Set a single configuration value
// Set a single configuration value.
settingsSetValue: {
path: '/cc.arduino.cli.commands.v1.ArduinoCoreService/SettingsSetValue',
requestStream: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
/* eslint-disable */

import * as jspb from "google-protobuf";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_board_pb from "../../../../../cc/arduino/cli/commands/v1/board_pb";
import * as cc_arduino_cli_commands_v1_common_pb from "../../../../../cc/arduino/cli/commands/v1/common_pb";
import * as cc_arduino_cli_commands_v1_compile_pb from "../../../../../cc/arduino/cli/commands/v1/compile_pb";
import * as cc_arduino_cli_commands_v1_core_pb from "../../../../../cc/arduino/cli/commands/v1/core_pb";
import * as cc_arduino_cli_commands_v1_debug_pb from "../../../../../cc/arduino/cli/commands/v1/debug_pb";
import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb";
import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb";
import * as cc_arduino_cli_commands_v1_lib_pb from "../../../../../cc/arduino/cli/commands/v1/lib_pb";
import * as cc_arduino_cli_commands_v1_monitor_pb from "../../../../../cc/arduino/cli/commands/v1/monitor_pb";
import * as cc_arduino_cli_commands_v1_settings_pb from "../../../../../cc/arduino/cli/commands/v1/settings_pb";
import * as cc_arduino_cli_commands_v1_upload_pb from "../../../../../cc/arduino/cli/commands/v1/upload_pb";
import * as google_rpc_status_pb from "../../../../../google/rpc/status_pb";

export class CreateRequest extends jspb.Message {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ var global = (function() {
return Function('return this')();
}.call(null));

var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');
goog.object.extend(proto, google_rpc_status_pb);
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);
var cc_arduino_cli_commands_v1_board_pb = require('../../../../../cc/arduino/cli/commands/v1/board_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_board_pb);
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);
var cc_arduino_cli_commands_v1_compile_pb = require('../../../../../cc/arduino/cli/commands/v1/compile_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_compile_pb);
var cc_arduino_cli_commands_v1_core_pb = require('../../../../../cc/arduino/cli/commands/v1/core_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_core_pb);
var cc_arduino_cli_commands_v1_debug_pb = require('../../../../../cc/arduino/cli/commands/v1/debug_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_debug_pb);
var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_monitor_pb);
var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_upload_pb);
var cc_arduino_cli_commands_v1_lib_pb = require('../../../../../cc/arduino/cli/commands/v1/lib_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_lib_pb);
var cc_arduino_cli_commands_v1_monitor_pb = require('../../../../../cc/arduino/cli/commands/v1/monitor_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_monitor_pb);
var cc_arduino_cli_commands_v1_settings_pb = require('../../../../../cc/arduino/cli/commands/v1/settings_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_settings_pb);
var cc_arduino_cli_commands_v1_upload_pb = require('../../../../../cc/arduino/cli/commands/v1/upload_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_upload_pb);
var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');
goog.object.extend(proto, google_rpc_status_pb);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.ArchiveSketchResponse', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.CheckForArduinoCLIUpdatesRequest', null, global);
Expand Down
Loading

0 comments on commit d106588

Please sign in to comment.