Skip to content

Commit

Permalink
rm managed components on full clean cmd (espressif#793)
Browse files Browse the repository at this point in the history
* rm managed components on full clean cmd

* add param.deleteComponentsOnFullClean to schema file
  • Loading branch information
brianignacio5 authored Sep 5, 2022
1 parent 55cb908 commit c40d5df
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 12 deletions.
23 changes: 12 additions & 11 deletions docs/SETTINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,18 @@ These settings are used to configure the [Code coverage](./COVERAGE.md) colors.

## Extension Behaviour Settings

| Setting ID | Description | Scope |
| -------------------------------------- | ------------------------------------------------------------------------ | ------------------------- |
| `idf.enableUpdateSrcsToCMakeListsFile` | Enable update source files in CMakeLists.txt (default `true`) | User, Remote or Workspace |
| `idf.flashType` | Preferred flash method. DFU, UART or JTAG | |
| `idf.launchMonitorOnDebugSession` | Launch ESP-IDF Monitor along with ESP-IDF Debug session | |
| `idf.notificationSilentMode` | Silent all notifications messages and show tasks output (default `true`) | User, Remote or Workspace |
| `idf.showOnboardingOnInit` | Show ESP-IDF Configuration window on extension activation | User, Remote or Workspace |
| `idf.saveScope` | Where to save extension settings | User, Remote or Workspace |
| `idf.saveBeforeBuild` | Save all the edited files before building (default `true`) | |
| `idf.useIDFKconfigStyle` | Enable style validation for Kconfig files | |
| `idf.telemetry` | Enable Telemetry | User, Remote or Workspace |
| Setting ID | Description | Scope |
| -------------------------------------- | --------------------------------------------------------------------------- | ------------------------- |
| `idf.enableUpdateSrcsToCMakeListsFile` | Enable update source files in CMakeLists.txt (default `true`) | User, Remote or Workspace |
| `idf.flashType` | Preferred flash method. DFU, UART or JTAG | |
| `idf.launchMonitorOnDebugSession` | Launch ESP-IDF Monitor along with ESP-IDF Debug session | |
| `idf.notificationSilentMode` | Silent all notifications messages and show tasks output (default `true`) | User, Remote or Workspace |
| `idf.showOnboardingOnInit` | Show ESP-IDF Configuration window on extension activation | User, Remote or Workspace |
| `idf.saveScope` | Where to save extension settings | User, Remote or Workspace |
| `idf.saveBeforeBuild` | Save all the edited files before building (default `true`) | |
| `idf.useIDFKconfigStyle` | Enable style validation for Kconfig files | |
| `idf.telemetry` | Enable Telemetry | User, Remote or Workspace |
| `idf.deleteComponentsOnFullClean` | Delete `managed_components` on full clean project command (default `false`) | User, Remote or Workspace |

## Custom tasks for build and flash tasks

Expand Down
1 change: 1 addition & 0 deletions i18n/en/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"param.customTask": "Custom task",
"param.buildDirectoryName": "Name of CMake build directory",
"param.svdFile": "SVD file to resolve ESP-IDF Peripheral view in Debug view",
"param.deleteComponentsOnFullClean": "Delete managed_components on full clean project command",
"view.components.name": "Project Components",
"configuration.title": "ESP-IDF",
"espIdf.apptrace.archive.refresh.title": "Refresh Trace Archive List",
Expand Down
1 change: 1 addition & 0 deletions i18n/es/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"param.customTask": "Tarea personalizada",
"param.buildDirectoryName": "Nombre del directorio de construcción de CMake",
"param.svdFile": "Archivo SVD para la vista de perifericos en ventana de depuracion",
"param.deleteComponentsOnFullClean": "Borrar managed_components en el comando limpiar proyecto",
"view.components.name": "Componentes de proyecto",
"configuration.title": "ESP-IDF",
"espIdf.apptrace.archive.refresh.title": "Refresh Trace Archive List",
Expand Down
1 change: 1 addition & 0 deletions i18n/ru/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"param.customTask": "Специальная задача",
"param.buildDirectoryName": "Имя каталога сборки CMake",
"param.svdFile": "Файл SVD для разрешения периферийного представления ESP-IDF в представлении отладки",
"param.deleteComponentsOnFullClean": "Удалить manage_components при полной очистке проекта.",
"view.components.name": "Компоненты проекта",
"configuration.title": "ESP-IDF",
"espIdf.apptrace.archive.refresh.title": "Обновить список архива трассировки",
Expand Down
1 change: 1 addition & 0 deletions i18n/zh-CN/package.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"param.customTask": "自定义任务",
"param.buildDirectoryName": "CMake生成目录的名称",
"param.svdFile": "用于在调试视图中解析ESP-IDF外围视图的奇异值分解文件",
"param.deleteComponentsOnFullClean": "完全清除项目命令时删除managed_components",
"view.components.name": "项目组件",
"configuration.title": "ESP-IDF",
"espIdf.apptrace.archive.refresh.title": "刷新跟踪归档列表",
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,12 @@
"default": "${workspaceFolder}/esp32.svd",
"scope": "resource",
"description": "%param.svdFile%"
},
"idf.deleteComponentsOnFullClean": {
"type": "boolean",
"default": false,
"scope": "resource",
"description": "%param.deleteComponentsOnFullClean%"
}
}
}
Expand Down
1 change: 1 addition & 0 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
"param.preFlashTask": "Pre flash custom task",
"param.postFlashTask": "Post flash custom task",
"param.svdFile": "SVD file to resolve ESP-IDF Peripheral view in Debug view",
"param.deleteComponentsOnFullClean": "Delete managed_components on full clean project command",
"param.buildDirectoryName": "Name of CMake build directory",
"view.components.name": "Project Components",
"configuration.title": "ESP-IDF",
Expand Down
3 changes: 2 additions & 1 deletion schema.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
"param.postBuildTask",
"param.preFlashTask",
"param.postFlashTask",
"param.svdFile"
"param.svdFile",
"param.deleteComponentsOnFullClean"
]
}
14 changes: 14 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,20 @@ export async function activate(context: vscode.ExtensionContext) {

try {
await del(buildDir, { force: true });
const delComponentsOnFullClean = (await idfConf.readParameter(
"idf.deleteComponentsOnFullClean",
workspaceRoot
)) as boolean;
if (delComponentsOnFullClean) {
const managedComponents = path.join(
workspaceRoot.fsPath,
"managed_components"
);
const componentDirExists = await pathExists(managedComponents);
if (componentDirExists) {
await del(managedComponents, { force: true });
}
}
} catch (error) {
Logger.errorNotify(error.message, error);
}
Expand Down

0 comments on commit c40d5df

Please sign in to comment.