#374: ensure compile verbose pref is included on upload (#1237)

* ensure compile verbose pref is included on upload

* better verbose typings

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>

Co-authored-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Dave Simpson 2022-07-26 14:05:12 +02:00 committed by GitHub
parent 5087ff08f2
commit 9373a0bcaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View File

@ -214,9 +214,10 @@ export class UploadSketch extends CoreServiceContribution {
fqbn,
{ selectedProgrammer },
verify,
verbose,
uploadVerbose,
sourceOverride,
optimizeForDebug,
compileVerbose,
] = await Promise.all([
this.boardsDataStore.appendConfigToFqbn(
boardsConfig.selectedBoard?.fqbn
@ -228,8 +229,10 @@ export class UploadSketch extends CoreServiceContribution {
this.commandService.executeCommand<boolean>(
'arduino-is-optimize-for-debug'
),
this.preferences.get('arduino.compile.verbose'),
]);
const verbose = { compile: compileVerbose, upload: uploadVerbose };
const board = {
...boardsConfig.selectedBoard,
name: boardsConfig.selectedBoard?.name || '',

View File

@ -84,11 +84,12 @@ export namespace CoreService {
}
export namespace Upload {
export interface Options extends Compile.Options {
export interface Options extends Omit<Compile.Options, 'verbose'> {
readonly port?: Port;
readonly programmer?: Programmer | undefined;
readonly verify: boolean;
readonly userFields: BoardUserField[];
readonly verbose: { compile: boolean; upload: boolean };
}
}

View File

@ -200,7 +200,11 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
) => ApplicationError<number, CoreError.ErrorLocation[]>,
task: string
): Promise<void> {
await this.compile(Object.assign(options, { exportBinaries: false }));
await this.compile({
...options,
verbose: options.verbose.compile,
exportBinaries: false,
});
const coreClient = await this.coreClient;
const { client, instance } = coreClient;
@ -262,7 +266,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
if (programmer) {
request.setProgrammer(programmer.id);
}
request.setVerbose(options.verbose);
request.setVerbose(options.verbose.upload);
request.setVerify(options.verify);
options.userFields.forEach((e) => {