Skip to content

Commit

Permalink
arduino#374: ensure compile verbose pref is included on upload (ardui…
Browse files Browse the repository at this point in the history
…no#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>
  • Loading branch information
davegarthsimpson and Akos Kitta authored Jul 26, 2022
1 parent 5087ff0 commit 9373a0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 || '',
Expand Down
3 changes: 2 additions & 1 deletion arduino-ide-extension/src/common/protocol/core-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
}
}

Expand Down
8 changes: 6 additions & 2 deletions arduino-ide-extension/src/node/core-service-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit 9373a0b

Please sign in to comment.