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

Sign up
Appearance settings

Commit 1280a34

Browse files
Akos Kittakittaakos
Akos Kitta
authored andcommitted
ATL-806: Fixed always_export_binaries CLI config
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent f1c8004 commit 1280a34

File tree

9 files changed

+130
-43
lines changed

9 files changed

+130
-43
lines changed

‎arduino-ide-extension/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
],
124124
"arduino": {
125125
"cli": {
126-
"version": "0.15.2"
126+
"version": "20210212"
127127
}
128128
}
129129
}

‎arduino-ide-extension/src/browser/contributions/verify-sketch.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class VerifySketch extends SketchContribution {
6868
});
6969
}
7070

71-
async verifySketch(exportBinaries: boolean=false): Promise<void> {
71+
async verifySketch(exportBinaries?: boolean): Promise<void> {
7272
const sketch = await this.sketchServiceClient.currentSketch();
7373
if (!sketch) {
7474
return;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Programmer } from './boards-service';
33
export const CoreServicePath = '/services/core-service';
44
export const CoreService = Symbol('CoreService');
55
export interface CoreService {
6-
compile(options: CoreService.Compile.Options & Readonly<{ exportBinaries: boolean }>): Promise<void>;
6+
compile(options: CoreService.Compile.Options & Readonly<{ exportBinaries?: boolean }>): Promise<void>;
77
upload(options: CoreService.Upload.Options): Promise<void>;
88
uploadUsingProgrammer(options: CoreService.Upload.Options): Promise<void>;
99
burnBootloader(options: CoreService.Bootloader.Options): Promise<void>;

‎arduino-ide-extension/src/node/cli-protocol/commands/commands_grpc_pb.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ libraryInstall: {
11751175
responseSerialize: serialize_cc_arduino_cli_commands_LibraryInstallResp,
11761176
responseDeserialize: deserialize_cc_arduino_cli_commands_LibraryInstallResp,
11771177
},
1178-
// Install a library from a Zip File
1178+
// Install a library from a Zip File
11791179
zipLibraryInstall: {
11801180
path: '/cc.arduino.cli.commands.ArduinoCore/ZipLibraryInstall',
11811181
requestStream: false,

‎arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.d.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,11 @@ export class LoadSketchResp extends jspb.Message {
512512
setAdditionalFilesList(value: Array<string>): LoadSketchResp;
513513
addAdditionalFiles(value: string, index?: number): string;
514514

515+
clearRootFolderFilesList(): void;
516+
getRootFolderFilesList(): Array<string>;
517+
setRootFolderFilesList(value: Array<string>): LoadSketchResp;
518+
addRootFolderFiles(value: string, index?: number): string;
519+
515520

516521
serializeBinary(): Uint8Array;
517522
toObject(includeInstance?: boolean): LoadSketchResp.AsObject;
@@ -529,6 +534,7 @@ export namespace LoadSketchResp {
529534
locationPath: string,
530535
otherSketchFilesList: Array<string>,
531536
additionalFilesList: Array<string>,
537+
rootFolderFilesList: Array<string>,
532538
}
533539
}
534540

‎arduino-ide-extension/src/node/cli-protocol/commands/commands_pb.js‎

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,7 +3639,7 @@ proto.cc.arduino.cli.commands.LoadSketchReq.prototype.setSketchPath = function(v
36393639
* @private {!Array<number>}
36403640
* @const
36413641
*/
3642-
proto.cc.arduino.cli.commands.LoadSketchResp.repeatedFields_ = [3,4];
3642+
proto.cc.arduino.cli.commands.LoadSketchResp.repeatedFields_ = [3,4,5];
36433643

36443644

36453645

@@ -3675,7 +3675,8 @@ proto.cc.arduino.cli.commands.LoadSketchResp.toObject = function(includeInstance
36753675
mainFile: jspb.Message.getFieldWithDefault(msg, 1, ""),
36763676
locationPath: jspb.Message.getFieldWithDefault(msg, 2, ""),
36773677
otherSketchFilesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
3678-
additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
3678+
additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f,
3679+
rootFolderFilesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f
36793680
};
36803681

36813682
if (includeInstance) {
@@ -3728,6 +3729,10 @@ proto.cc.arduino.cli.commands.LoadSketchResp.deserializeBinaryFromReader = funct
37283729
var value = /** @type {string} */ (reader.readString());
37293730
msg.addAdditionalFiles(value);
37303731
break;
3732+
case 5:
3733+
var value = /** @type {string} */ (reader.readString());
3734+
msg.addRootFolderFiles(value);
3735+
break;
37313736
default:
37323737
reader.skipField();
37333738
break;
@@ -3785,6 +3790,13 @@ proto.cc.arduino.cli.commands.LoadSketchResp.serializeBinaryToWriter = function(
37853790
f
37863791
);
37873792
}
3793+
f = message.getRootFolderFilesList();
3794+
if (f.length > 0) {
3795+
writer.writeRepeatedString(
3796+
5,
3797+
f
3798+
);
3799+
}
37883800
};
37893801

37903802

@@ -3898,6 +3910,43 @@ proto.cc.arduino.cli.commands.LoadSketchResp.prototype.clearAdditionalFilesList
38983910
};
38993911

39003912

3913+
/**
3914+
* repeated string root_folder_files = 5;
3915+
* @return {!Array<string>}
3916+
*/
3917+
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.getRootFolderFilesList = function() {
3918+
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5));
3919+
};
3920+
3921+
3922+
/**
3923+
* @param {!Array<string>} value
3924+
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
3925+
*/
3926+
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.setRootFolderFilesList = function(value) {
3927+
return jspb.Message.setField(this, 5, value || []);
3928+
};
3929+
3930+
3931+
/**
3932+
* @param {string} value
3933+
* @param {number=} opt_index
3934+
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
3935+
*/
3936+
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.addRootFolderFiles = function(value, opt_index) {
3937+
return jspb.Message.addToRepeatedField(this, 5, value, opt_index);
3938+
};
3939+
3940+
3941+
/**
3942+
* Clears the list making it empty but non-null.
3943+
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
3944+
*/
3945+
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.clearRootFolderFilesList = function() {
3946+
return this.setRootFolderFilesList([]);
3947+
};
3948+
3949+
39013950

39023951

39033952

‎arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.d.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/* eslint-disable */
66

77
import * as jspb from "google-protobuf";
8+
import * as google_protobuf_wrappers_pb from "google-protobuf/google/protobuf/wrappers_pb";
89
import * as commands_common_pb from "../commands/common_pb";
910
import * as commands_lib_pb from "../commands/lib_pb";
1011

@@ -67,9 +68,6 @@ export class CompileReq extends jspb.Message {
6768
getClean(): boolean;
6869
setClean(value: boolean): CompileReq;
6970

70-
getExportBinaries(): boolean;
71-
setExportBinaries(value: boolean): CompileReq;
72-
7371
getCreateCompilationDatabaseOnly(): boolean;
7472
setCreateCompilationDatabaseOnly(value: boolean): CompileReq;
7573

@@ -78,6 +76,12 @@ export class CompileReq extends jspb.Message {
7876
clearSourceOverrideMap(): void;
7977

8078

79+
hasExportBinaries(): boolean;
80+
clearExportBinaries(): void;
81+
getExportBinaries(): google_protobuf_wrappers_pb.BoolValue | undefined;
82+
setExportBinaries(value?: google_protobuf_wrappers_pb.BoolValue): CompileReq;
83+
84+
8185
serializeBinary(): Uint8Array;
8286
toObject(includeInstance?: boolean): CompileReq.AsObject;
8387
static toObject(includeInstance: boolean, msg: CompileReq): CompileReq.AsObject;
@@ -107,10 +111,10 @@ export namespace CompileReq {
107111
optimizefordebug: boolean,
108112
exportDir: string,
109113
clean: boolean,
110-
exportBinaries: boolean,
111114
createCompilationDatabaseOnly: boolean,
112115

113116
sourceOverrideMap: Array<[string, string]>,
117+
exportBinaries?: google_protobuf_wrappers_pb.BoolValue.AsObject,
114118
}
115119
}
116120

‎arduino-ide-extension/src/node/cli-protocol/commands/compile_pb.js‎

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ var jspb = require('google-protobuf');
1414
var goog = jspb;
1515
var global = Function('return this')();
1616

17+
var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js');
18+
goog.object.extend(proto, google_protobuf_wrappers_pb);
1719
var commands_common_pb = require('../commands/common_pb.js');
1820
goog.object.extend(proto, commands_common_pb);
1921
var commands_lib_pb = require('../commands/lib_pb.js');
@@ -140,9 +142,9 @@ proto.cc.arduino.cli.commands.CompileReq.toObject = function(includeInstance, ms
140142
optimizefordebug: jspb.Message.getBooleanFieldWithDefault(msg, 16, false),
141143
exportDir: jspb.Message.getFieldWithDefault(msg, 18, ""),
142144
clean: jspb.Message.getBooleanFieldWithDefault(msg, 19, false),
143-
exportBinaries: jspb.Message.getBooleanFieldWithDefault(msg, 20, false),
144145
createCompilationDatabaseOnly: jspb.Message.getBooleanFieldWithDefault(msg, 21, false),
145-
sourceOverrideMap: (f = msg.getSourceOverrideMap()) ? f.toObject(includeInstance, undefined) : []
146+
sourceOverrideMap: (f = msg.getSourceOverrideMap()) ? f.toObject(includeInstance, undefined) : [],
147+
exportBinaries: (f = msg.getExportBinaries()) && google_protobuf_wrappers_pb.BoolValue.toObject(includeInstance, f)
146148
};
147149

148150
if (includeInstance) {
@@ -248,10 +250,6 @@ proto.cc.arduino.cli.commands.CompileReq.deserializeBinaryFromReader = function(
248250
var value = /** @type {boolean} */ (reader.readBool());
249251
msg.setClean(value);
250252
break;
251-
case 20:
252-
var value = /** @type {boolean} */ (reader.readBool());
253-
msg.setExportBinaries(value);
254-
break;
255253
case 21:
256254
var value = /** @type {boolean} */ (reader.readBool());
257255
msg.setCreateCompilationDatabaseOnly(value);
@@ -262,6 +260,11 @@ proto.cc.arduino.cli.commands.CompileReq.deserializeBinaryFromReader = function(
262260
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
263261
});
264262
break;
263+
case 23:
264+
var value = new google_protobuf_wrappers_pb.BoolValue;
265+
reader.readMessage(value,google_protobuf_wrappers_pb.BoolValue.deserializeBinaryFromReader);
266+
msg.setExportBinaries(value);
267+
break;
265268
default:
266269
reader.skipField();
267270
break;
@@ -411,13 +414,6 @@ proto.cc.arduino.cli.commands.CompileReq.serializeBinaryToWriter = function(mess
411414
f
412415
);
413416
}
414-
f = message.getExportBinaries();
415-
if (f) {
416-
writer.writeBool(
417-
20,
418-
f
419-
);
420-
}
421417
f = message.getCreateCompilationDatabaseOnly();
422418
if (f) {
423419
writer.writeBool(
@@ -429,6 +425,14 @@ proto.cc.arduino.cli.commands.CompileReq.serializeBinaryToWriter = function(mess
429425
if (f && f.getLength() > 0) {
430426
f.serializeBinary(22, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
431427
}
428+
f = message.getExportBinaries();
429+
if (f != null) {
430+
writer.writeMessage(
431+
23,
432+
f,
433+
google_protobuf_wrappers_pb.BoolValue.serializeBinaryToWriter
434+
);
435+
}
432436
};
433437

434438

@@ -795,24 +799,6 @@ proto.cc.arduino.cli.commands.CompileReq.prototype.setClean = function(value) {
795799
};
796800

797801

798-
/**
799-
* optional bool export_binaries = 20;
800-
* @return {boolean}
801-
*/
802-
proto.cc.arduino.cli.commands.CompileReq.prototype.getExportBinaries = function() {
803-
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 20, false));
804-
};
805-
806-
807-
/**
808-
* @param {boolean} value
809-
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
810-
*/
811-
proto.cc.arduino.cli.commands.CompileReq.prototype.setExportBinaries = function(value) {
812-
return jspb.Message.setProto3BooleanField(this, 20, value);
813-
};
814-
815-
816802
/**
817803
* optional bool create_compilation_database_only = 21;
818804
* @return {boolean}
@@ -853,6 +839,43 @@ proto.cc.arduino.cli.commands.CompileReq.prototype.clearSourceOverrideMap = func
853839
return this;};
854840

855841

842+
/**
843+
* optional google.protobuf.BoolValue export_binaries = 23;
844+
* @return {?proto.google.protobuf.BoolValue}
845+
*/
846+
proto.cc.arduino.cli.commands.CompileReq.prototype.getExportBinaries = function() {
847+
return /** @type{?proto.google.protobuf.BoolValue} */ (
848+
jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.BoolValue, 23));
849+
};
850+
851+
852+
/**
853+
* @param {?proto.google.protobuf.BoolValue|undefined} value
854+
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
855+
*/
856+
proto.cc.arduino.cli.commands.CompileReq.prototype.setExportBinaries = function(value) {
857+
return jspb.Message.setWrapperField(this, 23, value);
858+
};
859+
860+
861+
/**
862+
* Clears the message field making it undefined.
863+
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
864+
*/
865+
proto.cc.arduino.cli.commands.CompileReq.prototype.clearExportBinaries = function() {
866+
return this.setExportBinaries(undefined);
867+
};
868+
869+
870+
/**
871+
* Returns whether this field is set.
872+
* @return {boolean}
873+
*/
874+
proto.cc.arduino.cli.commands.CompileReq.prototype.hasExportBinaries = function() {
875+
return jspb.Message.getField(this, 23) != null;
876+
};
877+
878+
856879

857880
/**
858881
* List of repeated fields within this message type.

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { NotificationServiceServer } from '../common/protocol';
1111
import { ClientReadableStream } from '@grpc/grpc-js';
1212
import { ArduinoCoreClient } from './cli-protocol/commands/commands_grpc_pb';
1313
import { firstToUpperCase, firstToLowerCase } from '../common/utils';
14+
import { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';
1415

1516
@injectable()
1617
export class CoreServiceImpl implements CoreService {
@@ -24,7 +25,7 @@ export class CoreServiceImpl implements CoreService {
2425
@inject(NotificationServiceServer)
2526
protected readonly notificationService: NotificationServiceServer;
2627

27-
async compile(options: CoreService.Compile.Options & { exportBinaries: boolean }): Promise<void> {
28+
async compile(options: CoreService.Compile.Options & { exportBinaries?: boolean }): Promise<void> {
2829
const { sketchUri, fqbn } = options;
2930
const sketchPath = FileUri.fsPath(sketchUri);
3031

@@ -41,7 +42,11 @@ export class CoreServiceImpl implements CoreService {
4142
compilerReq.setPreprocess(false);
4243
compilerReq.setVerbose(options.verbose);
4344
compilerReq.setQuiet(false);
44-
compilerReq.setExportBinaries(options.exportBinaries);
45+
if (typeof options.exportBinaries === 'boolean') {
46+
const exportBinaries = new BoolValue();
47+
exportBinaries.setValue(options.exportBinaries);
48+
compilerReq.setExportBinaries(exportBinaries);
49+
}
4550
this.mergeSourceOverrides(compilerReq, options);
4651

4752
const result = client.compile(compilerReq);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /