8000 Add setting for deleting whole build dir when clean configuring by andreeis · Pull Request #3783 · microsoft/vscode-cmake-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add setting for deleting whole build dir when clean configuring #3783

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

Merged
merged 6 commits into from
Jun 24, 2024
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Features:
- Add support for CMake Language Support natively in this extension. [#3559](https://github.com/microsoft/vscode-cmake-tools/issues/3559)
- Upgrade `cmake_minimum_required` version 3.0.0 -> 3.5.0. [#3793](https://github.com/microsoft/vscode-cmake-tools/issues/3793)

Improvements:

- Add setting for deleting entire build dir when clean configuring. [#3515](https://github.com/microsoft/vscode-cmake-tools/issues/3515)

Bug Fixes:

- Fix issue "Logs are unavailable when running tests from the Test Explorer" and display properly the test output. [#3140](https://github.com/microsoft/vscode-cmake-tools/issues/3140)
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,12 @@
"description": "%cmake-tools.configuration.cmake.configureOnEdit.description%",
"scope": "resource"
},
"cmake.deleteBuildDirOnCleanConfigure": {
"type": "boolean",
"default": false,
"description": "%cmake-tools.configuration.cmake.deleteBuildDirOnCleanCconfigure.description%",
"scope": "resource"
},
"cmake.setBuildTypeOnMultiConfig": {
"type": "boolean",
"default": false,
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
"cmake-tools.configuration.cmake.copyCompileCommands.description": "Copy compile_commands.json to this location after a successful configure.",
"cmake-tools.configuration.cmake.configureOnOpen.description": "Automatically configure CMake project directories when they are opened.",
"cmake-tools.configuration.cmake.configureOnEdit.description": "Automatically configure CMake project directories when cmake.sourceDirectory or CMakeLists.txt content are saved.",
"cmake-tools.configuration.cmake.deleteBuildDirOnCleanConfigure.description": "Delete the entire build directory when a clean configure is invoked.",
"cmake-tools.configuration.cmake.setBuildTypeOnMultiConfig.description": "Set CMAKE_BUILD_TYPE also on multi config generators.",
"cmake-tools.configuration.cmake.skipConfigureIfCachePresent.description": "Skip over the configure process if cache is present.",
"cmake-tools.configuration.cmake.cmakeCommunicationMode": "The protocol used to communicate between the extension and CMake.",
Expand Down
5 changes: 5 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export interface ExtensionConfigurationSettings {
loadCompileCommands: boolean;
configureOnOpen: boolean | null;
configureOnEdit: boolean;
deleteBuildDirOnCleanConfigure: boolean;
skipConfigureIfCachePresent: boolean | null;
useCMakeServer: boolean;
cmakeCommunicationMode: CMakeCommunicationMode;
Expand Down Expand Up @@ -435,6 +436,9 @@ export class ConfigurationReader implements vscode.Disposable {
get configureOnEdit() {
return this.configData.configureOnEdit;
}
get deleteBuildDirOnCleanConfigure() {
return this.configData.deleteBuildDirOnCleanConfigure;
}
get skipConfigureIfCachePresent() {
return this.configData.skipConfigureIfCachePresent;
}
Expand Down Expand Up @@ -595,6 +599,7 @@ export class ConfigurationReader implements vscode.Disposable {
loadCompileCommands: new vscode.EventEmitter<boolean>(),
configureOnOpen: new vscode.EventEmitter<boolean | null>(),
configureOnEdit: new vscode.EventEmitter<boolean>(),
deleteBuildDirOnCleanConfigure: new vscode.EventEmitter<boolean>(),
skipConfigureIfCachePresent: new vscode.EventEmitter<boolean | null>(),
useCMakeServer: new vscode.EventEmitter<boolean>(),
cmakeCommunicationMode: new vscode.EventEmitter<CMakeCommunicationMode>(),
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/cmakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export abstract class CMakeDriver implements vscode.Disposable {
protected async _cleanPriorConfiguration() {
const build_dir = this.binaryDir;
const cache = this.cachePath;
const cmake_files = path.join(build_dir, 'CMakeFiles');
const cmake_files = this.config.deleteBuildDirOnCleanConfigure ? build_dir : path.join(build_dir, 'CMakeFiles');
if (await fs.exists(cache)) {
log.info(localize('removing', 'Removing {0}', cache));
try {
Expand Down
1 change: 1 addition & 0 deletions test/unit-tests/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function createConfig(conf: Partial<ExtensionConfigurationSettings>): Configurat
loadCompileCommands: true,
configureOnOpen: null,
configureOnEdit: true,
deleteBuildDirOnCleanConfigure: false,
skipConfigureIfCachePresent: null,
useCMakeServer: true,
cmakeCommunicationMode: 'automatic',
Expand Down
Loading
0