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

"build" task improvements #2938

Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Bug Fixes:
- CMake Tools should choose cmake.exe from the newest VS when it's not found in the PATH. [#2753](https://github.com/microsoft/vscode-cmake-tools/issues/2753)
- Calling build targets from CMake Project Outline always builds default target if useTasks option is set. [#2778](https://github.com/microsoft/vscode-cmake-tools/issues/2768) [@piomis]](https://github.com/piomis)
- Remove the default path for `cmake.mingwSearchDirs` since the path is world-writable. [PR #2942](https://github.com/microsoft/vscode-cmake-tools/pull/2942)
- Build command is not able to properly pick-up tasks from tasks.json file if configured with isDefault option and cancellation of running build task is not working. [#2935](https://github.com/microsoft/vscode-cmake-tools/issues/2935) [@piomis]](https://github.com/piomis)

## 1.12.27
Bug Fixes:
Expand Down
2 changes: 1 addition & 1 deletion src/cmakeBuildRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class CMakeBuildRunner {
this.currentBuildProcess = { child: undefined, result: new Promise<proc.ExecutionResult>(resolve => {
const disposable: vscode.Disposable = vscode.tasks.onDidEndTask((endEvent: vscode.TaskEndEvent) => {
if (endEvent.execution === this.taskExecutor) {
this.taskExecutor = undefined;
disposable.dispose();
resolve({ retc: 0, stdout: '', stderr: '' });
}
Expand All @@ -53,7 +54,6 @@ export class CMakeBuildRunner {
}
if (this.taskExecutor) {
this.taskExecutor.terminate();
this.taskExecutor = undefined;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cmakeTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class CMakeTaskProvider implements vscode.TaskProvider {
// Fetch all CMake task from `tasks.json` files.
const allTasks: vscode.Task[] = await vscode.tasks.fetchTasks({ type: CMakeTaskProvider.CMakeScriptType });
const tasks: (CMakeTask | undefined)[] = allTasks.map((task: any) => {
if (!task.definition.label || !task.group || (task.group && task.group !== vscode.TaskGroup.Build)) {
if (!task.definition.label || !task.group || (task.group && task.group.id !== vscode.TaskGroup.Build.id)) {
return undefined;
}
const definition: CMakeTaskDefinition = {
Expand Down Expand Up @@ -236,7 +236,7 @@ export class CMakeTaskProvider implements vscode.TaskProvider {
return matchingTargetTasks[0];
} else {
// Search for the matching default task.
const defaultTask: CMakeTask[] = matchingTargetTasks.filter(task => task.group?.isDefault);
const defaultTask: CMakeTask[] = matchingTargetTasks.filter(task => task.isDefault);
if (defaultTask.length === 1) {
return defaultTask[0];
} else {
Expand Down