Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EdgeTPU] Update Toolchain run notification and log #1745

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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...";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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 @@ -182,6 +182,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 @@ -322,31 +322,33 @@ 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 = (err?: Error) => {
let str = "Running onecc has failed. ";
let str = `Running ${activeToolchainName} has failed. `;
if (err) {
str += err.message;
}
vscode.window.showErrorMessage(str);
};

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)
Expand Down