Skip to content

Commit

Permalink
[EdgeTPU] Update Toolchain run notification and log (Samsung#1698)
Browse files Browse the repository at this point in the history
Modify notiTitle in JobConfig.ts from 'Running onecc...' to 'Running tools...'
Use active toolchain name in notification and log of ToolchainProvider _run method

ONE-vscode-DCO-1.0-Signed-off-by: profornnan <[email protected]>
  • Loading branch information
profornnan authored Oct 11, 2023
1 parent 748b4fe commit 0107bfb
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/Toolchain/JobConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JobConfig extends JobCommand {
super(cmd);
this.jobType = JobType.tConfig;
this.name = "config";
this.notiTitle = "Running onecc...";
this.notiTitle = "Running tools...";
this.valid = true;
this.isCancelable = true;
}
Expand Down
1 change: 1 addition & 0 deletions src/Toolchain/ToolchainEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class ToolchainEnv extends Env {
return new Promise<boolean>((resolve, reject) => {
const jobs: Array<Job> = [];
const job = new JobConfig(toolchain.run(cfg));
job.notiTitle = `Running ${toolchain.info.name}`;
job.workDir = path.dirname(cfg);
job.successCallback = () => resolve(true);
job.failureCallback = () => reject();
Expand Down
24 changes: 13 additions & 11 deletions src/Toolchain/ToolchainProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,27 +316,29 @@ export class ToolchainProvider implements vscode.TreeDataProvider<BaseNode> {
}

public _run(cfg: string): boolean {
const [activeToolchainEnv, activeToolchain] =
this.checkAvailableToolchain();
if (!activeToolchainEnv || !activeToolchain) {
return false;
}

const activeToolchainName = activeToolchain.info.name;

/* istanbul ignore next */
const notifySuccess = () => {
vscode.window.showInformationMessage("Onecc has run successfully.");
vscode.window.showInformationMessage(
`${activeToolchainName} has run successfully.`
);
};

/* istanbul ignore next */
const notifyError = () => {
this.error("Running onecc has failed.");
this.error(`Running ${activeToolchainName} has failed.`);
};

const [activeToolchainEnv, activeToolchain] =
this.checkAvailableToolchain();
if (activeToolchainEnv === undefined || activeToolchain === undefined) {
return false;
}

Logger.info(
this.tag,
`Run onecc with ${cfg} cfg and ${
activeToolchain.info.name
}-${activeToolchain.info.version?.str()} toolchain.`
`Run ${activeToolchainName}-${activeToolchain.info.version?.str()} toolchain with ${cfg} cfg.`
);
activeToolchainEnv.run(cfg, activeToolchain).then(
() => notifySuccess(),
Expand Down

0 comments on commit 0107bfb

Please sign in to comment.