#fix digital-ide.tool.clean
This commit is contained in:
parent
dbbae190d1
commit
2ad67933b1
@ -46,7 +46,6 @@ function registerTreeView(context: vscode.ExtensionContext) {
|
|||||||
vscode.commands.registerCommand('digital-ide.treeView.arch.collapse', treeView.collapseTreeView);
|
vscode.commands.registerCommand('digital-ide.treeView.arch.collapse', treeView.collapseTreeView);
|
||||||
vscode.commands.registerCommand('digital-ide.treeView.arch.refresh', treeView.refreshArchTree);
|
vscode.commands.registerCommand('digital-ide.treeView.arch.refresh', treeView.refreshArchTree);
|
||||||
vscode.commands.registerCommand('digital-ide.treeView.arch.openFile', treeView.openFileByUri);
|
vscode.commands.registerCommand('digital-ide.treeView.arch.openFile', treeView.openFileByUri);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
|
import { MainOutput, opeParam } from '../../global';
|
||||||
|
import { hdlDir, hdlFile, hdlPath } from '../../hdlFs';
|
||||||
import { getIconConfig } from '../../hdlFs/icons';
|
import { getIconConfig } from '../../hdlFs/icons';
|
||||||
|
import { hdlIgnore } from '../../manager/ignore';
|
||||||
|
|
||||||
interface CommandDataItem {
|
interface CommandDataItem {
|
||||||
name: string,
|
name: string,
|
||||||
@ -186,6 +189,30 @@ class ToolTreeProvider extends BaseCommandTreeProvider {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
super(config, 'TOOL');
|
super(config, 'TOOL');
|
||||||
|
|
||||||
|
vscode.commands.registerCommand('digital-ide.tool.clean', this.clean);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async clean() {
|
||||||
|
const prjPath = opeParam.prjInfo.arch.prjPath;
|
||||||
|
const xilFolder = hdlPath.join(opeParam.workspacePath, '.Xil');
|
||||||
|
|
||||||
|
hdlDir.rmdir(prjPath);
|
||||||
|
hdlDir.rmdir(xilFolder);
|
||||||
|
|
||||||
|
const ignores = hdlIgnore.getIgnoreFiles();
|
||||||
|
|
||||||
|
const strFiles = hdlFile.pickFileRecursive(opeParam.workspacePath, ignores, p => p.endsWith('.str'));
|
||||||
|
for (const path of strFiles) {
|
||||||
|
hdlFile.removeFile(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
const logFiles = hdlFile.pickFileRecursive(opeParam.workspacePath, ignores, p => p.endsWith('.log'));
|
||||||
|
for (const path of logFiles) {
|
||||||
|
hdlFile.readFile(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
MainOutput.report('finish digital-ide.tool.clean');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ import { hdlParam } from '../hdlParser';
|
|||||||
import { PlManage } from './PL';
|
import { PlManage } from './PL';
|
||||||
import { PsManage } from './PS';
|
import { PsManage } from './PS';
|
||||||
import { hdlIgnore } from './ignore';
|
import { hdlIgnore } from './ignore';
|
||||||
|
import { ppyAction } from '../monitor/event';
|
||||||
|
import { hdlMonitor } from '../monitor';
|
||||||
|
|
||||||
class PrjManage {
|
class PrjManage {
|
||||||
pl?: PlManage;
|
pl?: PlManage;
|
||||||
@ -23,8 +25,11 @@ class PrjManage {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const template = hdlFile.readJSON(opeParam.propertyInitPath) as RawPrjInfo;
|
const template = hdlFile.readJSON(opeParam.propertyInitPath) as RawPrjInfo;
|
||||||
|
|
||||||
hdlFile.writeJSON(opeParam.propertyJsonPath, template);
|
hdlFile.writeJSON(opeParam.propertyJsonPath, template);
|
||||||
|
|
||||||
|
// TODO : this is a bug, that monitor cannot sense the add event of ppy
|
||||||
|
// so we need to do <add event> manually here
|
||||||
|
await ppyAction.add(opeParam.propertyJsonPath, hdlMonitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// overwrite content in current property.json to property-init.json
|
// overwrite content in current property.json to property-init.json
|
||||||
|
@ -200,11 +200,27 @@ class PpyAction extends BaseAction {
|
|||||||
const rawPrjInfo = opeParam.getRawUserPrjInfo();
|
const rawPrjInfo = opeParam.getRawUserPrjInfo();
|
||||||
// when delete, make ws path to be main parse path
|
// when delete, make ws path to be main parse path
|
||||||
if (e === Event.Unlink) {
|
if (e === Event.Unlink) {
|
||||||
|
console.log('unlink ppy, PrjInfoDefaults.arch:', PrjInfoDefaults.arch);
|
||||||
|
|
||||||
rawPrjInfo.arch = PrjInfoDefaults.arch;
|
rawPrjInfo.arch = PrjInfoDefaults.arch;
|
||||||
}
|
}
|
||||||
|
|
||||||
opeParam.mergePrjInfo(rawPrjInfo);
|
opeParam.mergePrjInfo(rawPrjInfo);
|
||||||
|
|
||||||
|
// // when delete, make ws path to be main parse path
|
||||||
|
// if (e === Event.Unlink) {
|
||||||
|
// const prjInfoArch = opeParam.prjInfo.arch;
|
||||||
|
// const workspacePath = opeParam.workspacePath;
|
||||||
|
|
||||||
|
// // TODO : more elegant ?
|
||||||
|
// prjInfoArch.hardware.src = workspacePath;
|
||||||
|
// prjInfoArch.hardware.sim = workspacePath;
|
||||||
|
// prjInfoArch.hardware.data = workspacePath;
|
||||||
|
// prjInfoArch.prjPath = workspacePath;
|
||||||
|
// prjInfoArch.software.data = workspacePath;
|
||||||
|
// prjInfoArch.software.src = workspacePath;
|
||||||
|
// }
|
||||||
|
|
||||||
const currentPathSet = this.getImportantPathSet();
|
const currentPathSet = this.getImportantPathSet();
|
||||||
const currentLibState = opeParam.prjInfo.library.state;
|
const currentLibState = opeParam.prjInfo.library.state;
|
||||||
|
|
||||||
|
@ -81,6 +81,14 @@ class HdlMonitor{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public remakePpyMonitor() {
|
||||||
|
if (this.ppyMonitor) {
|
||||||
|
this.ppyMonitor.close();
|
||||||
|
this.ppyMonitor = this.getPpyMonitor();
|
||||||
|
this.registerPpyMonitorListener();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public registerHdlMonitorListener() {
|
public registerHdlMonitorListener() {
|
||||||
Event.hdlAction.listenAdd(this);
|
Event.hdlAction.listenAdd(this);
|
||||||
Event.hdlAction.listenChange(this);
|
Event.hdlAction.listenChange(this);
|
||||||
|
11
src/test/manager/.vscode/property.json
vendored
Normal file
11
src/test/manager/.vscode/property.json
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"toolChain": "xilinx",
|
||||||
|
"prjName": {
|
||||||
|
"PL": "template"
|
||||||
|
},
|
||||||
|
"soc": {
|
||||||
|
"core": "none"
|
||||||
|
},
|
||||||
|
"enableShowLog": false,
|
||||||
|
"device": "none"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user