Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 69de5e5

Browse filesBrowse files
author
Alberto Iannaccone
committed
use noOverwrite when install built-in libraries and platform
1 parent 9273813 commit 69de5e5
Copy full SHA for 69de5e5

File tree

Expand file treeCollapse file tree

10 files changed

+86
-4
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+86
-4
lines changed

‎arduino-ide-extension/package.json

Copy file name to clipboardExpand all lines: arduino-ide-extension/package.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@
156156
],
157157
"arduino": {
158158
"cli": {
159-
"version": "0.24.0"
159+
"version": {
160+
"owner": "arduino",
161+
"repo": "arduino-cli",
162+
"commitish": "ffe4232b359fcfa87238d68acf1c3b64a1621f14"
163+
}
160164
},
161165
"fwuploader": {
162166
"version": "2.2.0"

‎arduino-ide-extension/src/browser/contributions/init-libs-platforms.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/browser/contributions/init-libs-platforms.ts
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ export class InitLibsPlatforms extends Contribution {
3131
)[0];
3232

3333
if (avrPackage) {
34-
await this.boardsService.install({ item: avrPackage });
34+
await this.boardsService.install({
35+
item: avrPackage,
36+
noOverwrite: true, // We don't want to automatically replace custom platforms the user might already have in place
37+
});
3538
}
3639
if (builtInLibrary) {
3740
await this.libraryService.install({
3841
item: builtInLibrary,
3942
installDependencies: true,
43+
noOverwrite: true, // We don't want to automatically replace custom libraries the user might already have in place
4044
});
4145
}
4246
}

‎arduino-ide-extension/src/common/protocol/installable.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/common/protocol/installable.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface Installable<T extends ArduinoComponent> {
1717
item: T;
1818
progressId?: string;
1919
version?: Installable.Version;
20+
noOverwrite?: boolean;
2021
}): Promise<void>;
2122

2223
/**

‎arduino-ide-extension/src/common/protocol/library-service.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/common/protocol/library-service.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface LibraryService
1616
progressId?: string;
1717
version?: Installable.Version;
1818
installDependencies?: boolean;
19+
noOverwrite?: boolean;
1920
}): Promise<void>;
2021
installZip(options: {
2122
zipUri: string;

‎arduino-ide-extension/src/node/boards-service-impl.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/boards-service-impl.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ export class BoardsServiceImpl
395395
item: BoardsPackage;
396396
progressId?: string;
397397
version?: Installable.Version;
398+
noOverwrite?: boolean;
398399
}): Promise<void> {
399400
const item = options.item;
400401
const version = !!options.version
@@ -410,6 +411,7 @@ export class BoardsServiceImpl
410411
req.setArchitecture(architecture);
411412
req.setPlatformPackage(platform);
412413
req.setVersion(version);
414+
req.setNoOverwrite(Boolean(options.noOverwrite));
413415

414416
console.info('>>> Starting boards package installation...', item);
415417

‎arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.d.ts
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export class PlatformInstallRequest extends jspb.Message {
2626
getSkipPostInstall(): boolean;
2727
setSkipPostInstall(value: boolean): PlatformInstallRequest;
2828

29+
getNoOverwrite(): boolean;
30+
setNoOverwrite(value: boolean): PlatformInstallRequest;
31+
2932

3033
serializeBinary(): Uint8Array;
3134
toObject(includeInstance?: boolean): PlatformInstallRequest.AsObject;
@@ -44,6 +47,7 @@ export namespace PlatformInstallRequest {
4447
architecture: string,
4548
version: string,
4649
skipPostInstall: boolean,
50+
noOverwrite: boolean,
4751
}
4852
}
4953

‎arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/core_pb.js
+31-1Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.toObject = function(incl
339339
platformPackage: jspb.Message.getFieldWithDefault(msg, 2, ""),
340340
architecture: jspb.Message.getFieldWithDefault(msg, 3, ""),
341341
version: jspb.Message.getFieldWithDefault(msg, 4, ""),
342-
skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
342+
skipPostInstall: jspb.Message.getBooleanFieldWithDefault(msg, 5, false),
343+
noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 6, false)
343344
};
344345

345346
if (includeInstance) {
@@ -397,6 +398,10 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.deserializeBinaryFromRea
397398
var value = /** @type {boolean} */ (reader.readBool());
398399
msg.setSkipPostInstall(value);
399400
break;
401+
case 6:
402+
var value = /** @type {boolean} */ (reader.readBool());
403+
msg.setNoOverwrite(value);
404+
break;
400405
default:
401406
reader.skipField();
402407
break;
@@ -462,6 +467,13 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.serializeBinaryToWriter
462467
f
463468
);
464469
}
470+
f = message.getNoOverwrite();
471+
if (f) {
472+
writer.writeBool(
473+
6,
474+
f
475+
);
476+
}
465477
};
466478

467479

@@ -574,6 +586,24 @@ proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setSkipPostIns
574586
};
575587

576588

589+
/**
590+
* optional bool no_overwrite = 6;
591+
* @return {boolean}
592+
*/
593+
proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.getNoOverwrite = function() {
594+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false));
595+
};
596+
597+
598+
/**
599+
* @param {boolean} value
600+
* @return {!proto.cc.arduino.cli.commands.v1.PlatformInstallRequest} returns this
601+
*/
602+
proto.cc.arduino.cli.commands.v1.PlatformInstallRequest.prototype.setNoOverwrite = function(value) {
603+
return jspb.Message.setProto3BooleanField(this, 6, value);
604+
};
605+
606+
577607

578608

579609

‎arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.d.ts
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export class LibraryInstallRequest extends jspb.Message {
7979
getNoDeps(): boolean;
8080
setNoDeps(value: boolean): LibraryInstallRequest;
8181

82+
getNoOverwrite(): boolean;
83+
setNoOverwrite(value: boolean): LibraryInstallRequest;
84+
8285

8386
serializeBinary(): Uint8Array;
8487
toObject(includeInstance?: boolean): LibraryInstallRequest.AsObject;
@@ -96,6 +99,7 @@ export namespace LibraryInstallRequest {
9699
name: string,
97100
version: string,
98101
noDeps: boolean,
102+
noOverwrite: boolean,
99103
}
100104
}
101105

‎arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/cli-protocol/cc/arduino/cli/commands/v1/lib_pb.js
+31-1Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,8 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.toObject = function(inclu
967967
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
968968
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
969969
version: jspb.Message.getFieldWithDefault(msg, 3, ""),
970-
noDeps: jspb.Message.getBooleanFieldWithDefault(msg, 4, false)
970+
noDeps: jspb.Message.getBooleanFieldWithDefault(msg, 4, false),
971+
noOverwrite: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
971972
};
972973

973974
if (includeInstance) {
@@ -1021,6 +1022,10 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.deserializeBinaryFromRead
10211022
var value = /** @type {boolean} */ (reader.readBool());
10221023
msg.setNoDeps(value);
10231024
break;
1025+
case 5:
1026+
var value = /** @type {boolean} */ (reader.readBool());
1027+
msg.setNoOverwrite(value);
1028+
break;
10241029
default:
10251030
reader.skipField();
10261031
break;
@@ -1079,6 +1084,13 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.serializeBinaryToWriter =
10791084
f
10801085
);
10811086
}
1087+
f = message.getNoOverwrite();
1088+
if (f) {
1089+
writer.writeBool(
1090+
5,
1091+
f
1092+
);
1093+
}
10821094
};
10831095

10841096

@@ -1173,6 +1185,24 @@ proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.setNoDeps = fun
11731185
};
11741186

11751187

1188+
/**
1189+
* optional bool no_overwrite = 5;
1190+
* @return {boolean}
1191+
*/
1192+
proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.getNoOverwrite = function() {
1193+
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
1194+
};
1195+
1196+
1197+
/**
1198+
* @param {boolean} value
1199+
* @return {!proto.cc.arduino.cli.commands.v1.LibraryInstallRequest} returns this
1200+
*/
1201+
proto.cc.arduino.cli.commands.v1.LibraryInstallRequest.prototype.setNoOverwrite = function(value) {
1202+
return jspb.Message.setProto3BooleanField(this, 5, value);
1203+
};
1204+
1205+
11761206

11771207

11781208

‎arduino-ide-extension/src/node/library-service-impl.ts

Copy file name to clipboardExpand all lines: arduino-ide-extension/src/node/library-service-impl.ts
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ export class LibraryServiceImpl
252252
progressId?: string;
253253
version?: Installable.Version;
254254
installDependencies?: boolean;
255+
noOverwrite?: boolean;
255256
}): Promise<void> {
256257
const item = options.item;
257258
const version = !!options.version
@@ -265,6 +266,7 @@ export class LibraryServiceImpl
265266
req.setName(item.name);
266267
req.setVersion(version);
267268
req.setNoDeps(!options.installDependencies);
269+
req.setNoOverwrite(Boolean(options.noOverwrite));
268270

269271
console.info('>>> Starting library package installation...', item);
270272

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.