Skip to content

Commit b0882e2

Browse files
authored
Revert "Add setting "postConfigureTask" (#4566)" (#4750)
This reverts commit 074387b.
1 parent 9e99b21 commit b0882e2

7 files changed

Lines changed: 1 addition & 48 deletions

File tree

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Features:
77
- Add command to clear build diagnostics from the Problems pane. [#4691](https://github.com/microsoft/vscode-cmake-tools/pull/4691)
88
- Add individual CTest test nodes to the Project Outline with inline run/debug buttons, and enable debugging tests from both the Outline and Test Explorer without requiring a launch.json. [#4721](https://github.com/microsoft/vscode-cmake-tools/pull/4721)
99
- Add "Delete Cache, Reconfigure and Build" command that chains cache deletion, reconfiguration, and build into a single action. [#4723](https://github.com/microsoft/vscode-cmake-tools/pull/4723)
10-
- Add `cmake.postConfigureTask` setting to execute a named VS Code task after every successful CMake configure. [#4566](https://github.com/microsoft/vscode-cmake-tools/pull/4566) [@Francois-Le](https://github.com/Francois-Le)
1110
- Add "Set Build and Launch/Debug Target" command that sets both the build target and launch target simultaneously. [#4732](https://github.com/microsoft/vscode-cmake-tools/pull/4732)
1211

1312
Improvements:

docs/cmake-settings.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ Options that support substitution, in the table below, allow variable references
3030
| `cmake.configureOnOpen` | Automatically configure CMake project directories when they are opened. | `true` | no |
3131
| `cmake.configureSettings` | An object containing `key:value` pairs, which will be passed to CMake when configuring. The same as passing `-DVAR_NAME=ON` via `cmake.configureArgs`. NOTE: Semicolons (`;`) in string values are automatically escaped to prevent CMake from interpreting them as list separators. If you want to pass a CMake list, use array notation instead, e.g. `"MY_LIST": [ "a", "b" ]`. | `{}` (no values) | yes |
3232
| `cmake.copyCompileCommands`| If not `null`, copies the `compile_commands.json` file generated by CMake to the path specified by this setting whenever CMake successfully configures. | `null` (do not copy the file) | yes |
33-
| `cmake.postConfigureTask`| If not `null`, the task with this name is executed whenever CMake successfully configures. | `null` (do not run any task) | yes |
3433
| `cmake.coverageInfoFiles` | LCOV coverage info files to be processed after running tests with coverage using the test explorer. | `[]` | yes |
3534
| `cmake.cpackArgs` | An array of additional arguments to pass to cpack. | `[]` | yes |
3635
| `cmake.cpackEnvironment` | An object containing `key:value` pairs of environment variables, which will be available when running cpack. | `{}` | yes |

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,12 +2912,6 @@
29122912
"description": "%cmake-tools.configuration.cmake.copyCompileCommands.description%",
29132913
"scope": "resource"
29142914
},
2915-
"cmake.postConfigureTask": {
2916-
"type": "string",
2917-
"default": null,
2918-
"description": "%cmake-tools.configuration.cmake.postConfigureTask.description%",
2919-
"scope": "resource"
2920-
},
29212915
"cmake.configureOnOpen": {
29222916
"type": "boolean",
29232917
"default": true,

package.nls.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@
226226
"cmake-tools.configuration.cmake.emscriptenSearchDirs.description": "Directories where Emscripten may be installed.",
227227
"cmake-tools.configuration.cmake.mergedCompileCommands.description": "Recursively collect and merge all compile_commands.json found in the cmake.buildDirectory.",
228228
"cmake-tools.configuration.cmake.copyCompileCommands.description": "Copy compile_commands.json to this location after a successful configure.",
229-
"cmake-tools.configuration.cmake.postConfigureTask.description": "If set, this named task will be executed after a successful CMake configure.",
230229
"cmake-tools.configuration.cmake.configureOnOpen.description": "Automatically configure CMake project directories when they are opened.",
231230
"cmake-tools.configuration.cmake.configureOnEdit.description": "Automatically configure CMake project directories when cmake.sourceDirectory or CMakeLists.txt content are saved.",
232231
"cmake-tools.configuration.cmake.deleteBuildDirOnCleanConfigure.description": "Delete the entire build directory when a clean configure is invoked.",

src/cmakeProject.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,36 +1615,6 @@ export class CMakeProject {
16151615
return;
16161616
}
16171617
}
1618-
1619-
}
1620-
1621-
/**
1622-
* Execute the postConfigureTask if configured
1623-
*/
1624-
private async executePostConfigureTask(): Promise<void> {
1625-
const postConfigureTask = this.workspaceContext.config.postConfigureTask;
1626-
if (postConfigureTask) {
1627-
try {
1628-
log.debug(localize('executing.post.configure.task', 'Executing post configure task: {0}', postConfigureTask));
1629-
1630-
// Fetch all available tasks
1631-
const tasks = await vscode.tasks.fetchTasks();
1632-
1633-
// Find the task by label
1634-
const task = tasks.find(t => t.name === postConfigureTask);
1635-
1636-
if (task) {
1637-
await vscode.tasks.executeTask(task);
1638-
} else {
1639-
const errorMsg = localize('task.not.found', 'Task "{0}" not found. Available tasks: {1}', postConfigureTask, tasks.map(t => t.name).join(', '));
1640-
void vscode.window.showErrorMessage(errorMsg);
1641-
log.error(errorMsg);
1642-
}
1643-
} catch (error: any) {
1644-
void vscode.window.showErrorMessage(localize('failed.to.execute.post.configure.task', 'Failed to execute post configure task: {0}', error.toString()));
1645-
log.error(localize('post.configure.task.error', 'Error executing post configure task'), error);
1646-
}
1647-
}
16481618
}
16491619

16501620
/**
@@ -1668,7 +1638,6 @@ export class CMakeProject {
16681638
const result: ConfigureResult = await drv.configure(trigger, []);
16691639
if (result.exitCode === 0) {
16701640
await this.refreshCompileDatabase(drv.expansionOptions);
1671-
await this.executePostConfigureTask();
16721641
} else {
16731642
log.showChannel(true);
16741643
}
@@ -1770,7 +1739,6 @@ export class CMakeProject {
17701739
if (result.exitCode === 0) {
17711740
await enableFullFeatureSet(true);
17721741
await this.refreshCompileDatabase(drv.expansionOptions);
1773-
await this.executePostConfigureTask();
17741742
} else if (result.exitCode !== 0 && (await this.getCMakeExecutable()).isDebuggerSupported && cmakeConfiguration.get(showDebuggerConfigurationString) && !forciblyCanceled && !cancelInformation.canceled && result.resultType === ConfigureResultType.NormalOperation) {
17751743
log.showChannel(true);
17761744
const yesButtonTitle: string = localize(

src/config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ export interface ExtensionConfigurationSettings {
204204
emscriptenSearchDirs: string[];
205205
mergedCompileCommands: string | null;
206206
copyCompileCommands: string | null;
207-
postConfigureTask: string | null;
208207
loadCompileCommands: boolean;
209208
configureOnOpen: boolean;
210209
configureOnEdit: boolean;
@@ -557,9 +556,6 @@ export class ConfigurationReader implements vscode.Disposable {
557556
get copyCompileCommands(): string | null {
558557
return this.configData.copyCompileCommands;
559558
}
560-
get postConfigureTask(): string | null {
561-
return this.configData.postConfigureTask;
562-
}
563559
get loadCompileCommands(): boolean {
564560
return this.configData.loadCompileCommands;
565561
}
@@ -667,7 +663,6 @@ export class ConfigurationReader implements vscode.Disposable {
667663
emscriptenSearchDirs: new vscode.EventEmitter<string[]>(),
668664
mergedCompileCommands: new vscode.EventEmitter<string | null>(),
669665
copyCompileCommands: new vscode.EventEmitter<string | null>(),
670-
postConfigureTask: new vscode.EventEmitter<string | null>(),
671666
loadCompileCommands: new vscode.EventEmitter<boolean>(),
672667
configureOnOpen: new vscode.EventEmitter<boolean>(),
673668
configureOnEdit: new vscode.EventEmitter<boolean>(),

test/unit-tests/config.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ function createConfig(conf: Partial<ExtensionConfigurationSettings>): Configurat
8585
preRunCoverageTarget: null,
8686
postRunCoverageTarget: null,
8787
coverageInfoFiles: [],
88-
useFolderPropertyInBuildTargetDropdown: true,
89-
postConfigureTask: null
88+
useFolderPropertyInBuildTargetDropdown: true
9089
});
9190
ret.updatePartial(conf);
9291
return ret;

0 commit comments

Comments
 (0)