mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-06-04 03:06:32 +00:00
ATL-806: Fixed always_export_binaries
CLI config
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
f1c80041fe
commit
1280a344a7
@ -123,7 +123,7 @@
|
||||
],
|
||||
"arduino": {
|
||||
"cli": {
|
||||
"version": "0.15.2"
|
||||
"version": "20210212"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ export class VerifySketch extends SketchContribution {
|
||||
});
|
||||
}
|
||||
|
||||
async verifySketch(exportBinaries: boolean = false): Promise<void> {
|
||||
async verifySketch(exportBinaries?: boolean): Promise<void> {
|
||||
const sketch = await this.sketchServiceClient.currentSketch();
|
||||
if (!sketch) {
|
||||
return;
|
||||
|
@ -3,7 +3,7 @@ import { Programmer } from './boards-service';
|
||||
export const CoreServicePath = '/services/core-service';
|
||||
export const CoreService = Symbol('CoreService');
|
||||
export interface CoreService {
|
||||
compile(options: CoreService.Compile.Options & Readonly<{ exportBinaries: boolean }>): Promise<void>;
|
||||
compile(options: CoreService.Compile.Options & Readonly<{ exportBinaries?: boolean }>): Promise<void>;
|
||||
upload(options: CoreService.Upload.Options): Promise<void>;
|
||||
uploadUsingProgrammer(options: CoreService.Upload.Options): Promise<void>;
|
||||
burnBootloader(options: CoreService.Bootloader.Options): Promise<void>;
|
||||
|
@ -1175,7 +1175,7 @@ libraryInstall: {
|
||||
responseSerialize: serialize_cc_arduino_cli_commands_LibraryInstallResp,
|
||||
responseDeserialize: deserialize_cc_arduino_cli_commands_LibraryInstallResp,
|
||||
},
|
||||
// Install a library from a Zip File
|
||||
// Install a library from a Zip File
|
||||
zipLibraryInstall: {
|
||||
path: '/cc.arduino.cli.commands.ArduinoCore/ZipLibraryInstall',
|
||||
requestStream: false,
|
||||
|
@ -512,6 +512,11 @@ export class LoadSketchResp extends jspb.Message {
|
||||
setAdditionalFilesList(value: Array<string>): LoadSketchResp;
|
||||
addAdditionalFiles(value: string, index?: number): string;
|
||||
|
||||
clearRootFolderFilesList(): void;
|
||||
getRootFolderFilesList(): Array<string>;
|
||||
setRootFolderFilesList(value: Array<string>): LoadSketchResp;
|
||||
addRootFolderFiles(value: string, index?: number): string;
|
||||
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): LoadSketchResp.AsObject;
|
||||
@ -529,6 +534,7 @@ export namespace LoadSketchResp {
|
||||
locationPath: string,
|
||||
otherSketchFilesList: Array<string>,
|
||||
additionalFilesList: Array<string>,
|
||||
rootFolderFilesList: Array<string>,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3639,7 +3639,7 @@ proto.cc.arduino.cli.commands.LoadSketchReq.prototype.setSketchPath = function(v
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.repeatedFields_ = [3,4];
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.repeatedFields_ = [3,4,5];
|
||||
|
||||
|
||||
|
||||
@ -3675,7 +3675,8 @@ proto.cc.arduino.cli.commands.LoadSketchResp.toObject = function(includeInstance
|
||||
mainFile: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
||||
locationPath: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
||||
otherSketchFilesList: (f = jspb.Message.getRepeatedField(msg, 3)) == null ? undefined : f,
|
||||
additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f
|
||||
additionalFilesList: (f = jspb.Message.getRepeatedField(msg, 4)) == null ? undefined : f,
|
||||
rootFolderFilesList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -3728,6 +3729,10 @@ proto.cc.arduino.cli.commands.LoadSketchResp.deserializeBinaryFromReader = funct
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addAdditionalFiles(value);
|
||||
break;
|
||||
case 5:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addRootFolderFiles(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@ -3785,6 +3790,13 @@ proto.cc.arduino.cli.commands.LoadSketchResp.serializeBinaryToWriter = function(
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getRootFolderFilesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
5,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -3898,6 +3910,43 @@ proto.cc.arduino.cli.commands.LoadSketchResp.prototype.clearAdditionalFilesList
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string root_folder_files = 5;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.getRootFolderFilesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.setRootFolderFilesList = function(value) {
|
||||
return jspb.Message.setField(this, 5, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.addRootFolderFiles = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 5, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.cc.arduino.cli.commands.LoadSketchResp} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.LoadSketchResp.prototype.clearRootFolderFilesList = function() {
|
||||
return this.setRootFolderFilesList([]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
/* eslint-disable */
|
||||
|
||||
import * as jspb from "google-protobuf";
|
||||
import * as google_protobuf_wrappers_pb from "google-protobuf/google/protobuf/wrappers_pb";
|
||||
import * as commands_common_pb from "../commands/common_pb";
|
||||
import * as commands_lib_pb from "../commands/lib_pb";
|
||||
|
||||
@ -67,9 +68,6 @@ export class CompileReq extends jspb.Message {
|
||||
getClean(): boolean;
|
||||
setClean(value: boolean): CompileReq;
|
||||
|
||||
getExportBinaries(): boolean;
|
||||
setExportBinaries(value: boolean): CompileReq;
|
||||
|
||||
getCreateCompilationDatabaseOnly(): boolean;
|
||||
setCreateCompilationDatabaseOnly(value: boolean): CompileReq;
|
||||
|
||||
@ -78,6 +76,12 @@ export class CompileReq extends jspb.Message {
|
||||
clearSourceOverrideMap(): void;
|
||||
|
||||
|
||||
hasExportBinaries(): boolean;
|
||||
clearExportBinaries(): void;
|
||||
getExportBinaries(): google_protobuf_wrappers_pb.BoolValue | undefined;
|
||||
setExportBinaries(value?: google_protobuf_wrappers_pb.BoolValue): CompileReq;
|
||||
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): CompileReq.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: CompileReq): CompileReq.AsObject;
|
||||
@ -107,10 +111,10 @@ export namespace CompileReq {
|
||||
optimizefordebug: boolean,
|
||||
exportDir: string,
|
||||
clean: boolean,
|
||||
exportBinaries: boolean,
|
||||
createCompilationDatabaseOnly: boolean,
|
||||
|
||||
sourceOverrideMap: Array<[string, string]>,
|
||||
exportBinaries?: google_protobuf_wrappers_pb.BoolValue.AsObject,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@ var jspb = require('google-protobuf');
|
||||
var goog = jspb;
|
||||
var global = Function('return this')();
|
||||
|
||||
var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js');
|
||||
goog.object.extend(proto, google_protobuf_wrappers_pb);
|
||||
var commands_common_pb = require('../commands/common_pb.js');
|
||||
goog.object.extend(proto, commands_common_pb);
|
||||
var commands_lib_pb = require('../commands/lib_pb.js');
|
||||
@ -140,9 +142,9 @@ proto.cc.arduino.cli.commands.CompileReq.toObject = function(includeInstance, ms
|
||||
optimizefordebug: jspb.Message.getBooleanFieldWithDefault(msg, 16, false),
|
||||
exportDir: jspb.Message.getFieldWithDefault(msg, 18, ""),
|
||||
clean: jspb.Message.getBooleanFieldWithDefault(msg, 19, false),
|
||||
exportBinaries: jspb.Message.getBooleanFieldWithDefault(msg, 20, false),
|
||||
createCompilationDatabaseOnly: jspb.Message.getBooleanFieldWithDefault(msg, 21, false),
|
||||
sourceOverrideMap: (f = msg.getSourceOverrideMap()) ? f.toObject(includeInstance, undefined) : []
|
||||
sourceOverrideMap: (f = msg.getSourceOverrideMap()) ? f.toObject(includeInstance, undefined) : [],
|
||||
exportBinaries: (f = msg.getExportBinaries()) && google_protobuf_wrappers_pb.BoolValue.toObject(includeInstance, f)
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
@ -248,10 +250,6 @@ proto.cc.arduino.cli.commands.CompileReq.deserializeBinaryFromReader = function(
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setClean(value);
|
||||
break;
|
||||
case 20:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setExportBinaries(value);
|
||||
break;
|
||||
case 21:
|
||||
var value = /** @type {boolean} */ (reader.readBool());
|
||||
msg.setCreateCompilationDatabaseOnly(value);
|
||||
@ -262,6 +260,11 @@ proto.cc.arduino.cli.commands.CompileReq.deserializeBinaryFromReader = function(
|
||||
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readString, null, "", "");
|
||||
});
|
||||
break;
|
||||
case 23:
|
||||
var value = new google_protobuf_wrappers_pb.BoolValue;
|
||||
reader.readMessage(value,google_protobuf_wrappers_pb.BoolValue.deserializeBinaryFromReader);
|
||||
msg.setExportBinaries(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
@ -411,13 +414,6 @@ proto.cc.arduino.cli.commands.CompileReq.serializeBinaryToWriter = function(mess
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getExportBinaries();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
20,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getCreateCompilationDatabaseOnly();
|
||||
if (f) {
|
||||
writer.writeBool(
|
||||
@ -429,6 +425,14 @@ proto.cc.arduino.cli.commands.CompileReq.serializeBinaryToWriter = function(mess
|
||||
if (f && f.getLength() > 0) {
|
||||
f.serializeBinary(22, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeString);
|
||||
}
|
||||
f = message.getExportBinaries();
|
||||
if (f != null) {
|
||||
writer.writeMessage(
|
||||
23,
|
||||
f,
|
||||
google_protobuf_wrappers_pb.BoolValue.serializeBinaryToWriter
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -795,24 +799,6 @@ proto.cc.arduino.cli.commands.CompileReq.prototype.setClean = function(value) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool export_binaries = 20;
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.getExportBinaries = function() {
|
||||
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 20, false));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {boolean} value
|
||||
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.setExportBinaries = function(value) {
|
||||
return jspb.Message.setProto3BooleanField(this, 20, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional bool create_compilation_database_only = 21;
|
||||
* @return {boolean}
|
||||
@ -853,6 +839,43 @@ proto.cc.arduino.cli.commands.CompileReq.prototype.clearSourceOverrideMap = func
|
||||
return this;};
|
||||
|
||||
|
||||
/**
|
||||
* optional google.protobuf.BoolValue export_binaries = 23;
|
||||
* @return {?proto.google.protobuf.BoolValue}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.getExportBinaries = function() {
|
||||
return /** @type{?proto.google.protobuf.BoolValue} */ (
|
||||
jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.BoolValue, 23));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?proto.google.protobuf.BoolValue|undefined} value
|
||||
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.setExportBinaries = function(value) {
|
||||
return jspb.Message.setWrapperField(this, 23, value);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the message field making it undefined.
|
||||
* @return {!proto.cc.arduino.cli.commands.CompileReq} returns this
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.clearExportBinaries = function() {
|
||||
return this.setExportBinaries(undefined);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether this field is set.
|
||||
* @return {boolean}
|
||||
*/
|
||||
proto.cc.arduino.cli.commands.CompileReq.prototype.hasExportBinaries = function() {
|
||||
return jspb.Message.getField(this, 23) != null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
|
@ -11,6 +11,7 @@ import { NotificationServiceServer } from '../common/protocol';
|
||||
import { ClientReadableStream } from '@grpc/grpc-js';
|
||||
import { ArduinoCoreClient } from './cli-protocol/commands/commands_grpc_pb';
|
||||
import { firstToUpperCase, firstToLowerCase } from '../common/utils';
|
||||
import { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
||||
|
||||
@injectable()
|
||||
export class CoreServiceImpl implements CoreService {
|
||||
@ -24,7 +25,7 @@ export class CoreServiceImpl implements CoreService {
|
||||
@inject(NotificationServiceServer)
|
||||
protected readonly notificationService: NotificationServiceServer;
|
||||
|
||||
async compile(options: CoreService.Compile.Options & { exportBinaries: boolean }): Promise<void> {
|
||||
async compile(options: CoreService.Compile.Options & { exportBinaries?: boolean }): Promise<void> {
|
||||
const { sketchUri, fqbn } = options;
|
||||
const sketchPath = FileUri.fsPath(sketchUri);
|
||||
|
||||
@ -41,7 +42,11 @@ export class CoreServiceImpl implements CoreService {
|
||||
compilerReq.setPreprocess(false);
|
||||
compilerReq.setVerbose(options.verbose);
|
||||
compilerReq.setQuiet(false);
|
||||
compilerReq.setExportBinaries(options.exportBinaries);
|
||||
if (typeof options.exportBinaries === 'boolean') {
|
||||
const exportBinaries = new BoolValue();
|
||||
exportBinaries.setValue(options.exportBinaries);
|
||||
compilerReq.setExportBinaries(exportBinaries);
|
||||
}
|
||||
this.mergeSourceOverrides(compilerReq, options);
|
||||
|
||||
const result = client.compile(compilerReq);
|
||||
|
Loading…
x
Reference in New Issue
Block a user