diff --git a/CHANGELOG.md b/CHANGELOG.md index 21e56dd9..58f0081d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,19 @@ All notable version changes will be recorded in this file. *** +### [v3.20.0] update + +**New**: + - `Export GNU Makefile`: Support export GNU Makefile for help users customize the automatic build process. + +**Change**: + - `unify_builder`: Update unify_builder to v3.8.0 + +**Fix**: + - `OpenOCD`: Can't get interface/target list for xpack openocd v12. + +*** + ### [v3.19.9] revision **New**: diff --git a/README.md b/README.md index 54fd0a55..a4e62be7 100644 --- a/README.md +++ b/README.md @@ -117,4 +117,4 @@ You can build this project by your self. ## Sponsor 👍 -[Github Sponsor](https://github.com/sponsors/github0null) +[Sponsor The Author](https://em-ide.com/sponsor) diff --git a/package.json b/package.json index 2a4a3bd9..99243307 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "homepage": "https://em-ide.com", "license": "MIT", "description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V", - "version": "3.19.9", + "version": "3.20.0", "preview": false, "engines": { "vscode": "^1.67.0" @@ -633,6 +633,10 @@ "command": "eide.operation.open_project", "title": "Open an eide project" }, + { + "command": "_cl.eide.project.exportMakefile", + "title": "%eide.project.export.makefile%" + }, { "command": "_cl.eide.project.show_proj_vars", "title": "%eide.project.show_project_vars%" @@ -1572,12 +1576,17 @@ { "command": "_cl.eide.project.exportAsTemplate", "when": "viewItem == SOLUTION && view == cl.eide.view.projects", - "group": "9_group" + "group": "0_group@1" }, { "command": "_cl.eide.project.exportXml", "when": "viewItem == SOLUTION && view == cl.eide.view.projects", - "group": "9_group" + "group": "0_group@2" + }, + { + "command": "_cl.eide.project.exportMakefile", + "when": "viewItem == SOLUTION && view == cl.eide.view.projects", + "group": "0_group@3" } ], "_cl.eide.menu/ui/project/static-check": [ diff --git a/package.nls.json b/package.nls.json index d3f1b9b6..04a5e3de 100644 --- a/package.nls.json +++ b/package.nls.json @@ -20,8 +20,6 @@ "eide.project.save.all": "Save All Projects", "eide.project.active": "Active Project", "eide.project.close": "Close Project", - "eide.project.export.template": "Eide Project Template", - "eide.project.export.keil": "Keil Project", "eide.project.show.commands": "Show Compiler CommandLine", "eide.project.switch.target": "Switch Target", "eide.project.build": "Build", @@ -39,6 +37,9 @@ "eide.prj.menus.sub.static-check.clear": "Clear Diagnostic Informations", "eide.prj.menus.main.export": "Export As ...", + "eide.project.export.template": "Eide Project Template", + "eide.project.export.keil": "Keil Project", + "eide.project.export.makefile": "GNU Makefile", "eide.workspace.build": "Build All", "eide.workspace.rebuild": "Rebuild All", @@ -103,6 +104,7 @@ "settings.builder.extraCommandLine": "Append additional commandline when invoke unify_builder", "settings.builder.presetEnvVars": "Preset Global Environment Variables when build project", + "settings.enable.ccache": "Determine whether to enable [ccache](https://ccache.dev/) used to speed up compilation of large projects", "settings.option.show.toolbar.in.editer.title": "Displays some toolbars in the editor title", "settings.option.show.statusbar": "Displays toolbar icons in the status bar", "settings.option.print.relative.path": "Print relative path when compile source file", diff --git a/package.nls.zh-CN.json b/package.nls.zh-CN.json index 92536ff2..485ea5b4 100644 --- a/package.nls.zh-CN.json +++ b/package.nls.zh-CN.json @@ -20,8 +20,6 @@ "eide.project.save.all": "保存所有项目", "eide.project.active": "设为活动", "eide.project.close": "关闭项目", - "eide.project.export.template": "EIDE 模板", - "eide.project.export.keil": "Keil 项目", "eide.project.show.commands": "查看生成的编译器命令行", "eide.project.switch.target": "切换目标", "eide.project.build": "构建", @@ -39,6 +37,9 @@ "eide.prj.menus.sub.static-check.clear": "清除诊断结果", "eide.prj.menus.main.export": "导出为 ...", + "eide.project.export.template": "EIDE 模板", + "eide.project.export.keil": "Keil 项目", + "eide.project.export.makefile": "GNU Makefile", "eide.workspace.build": "构建所有项目", "eide.workspace.rebuild": "重新构建所有项目", @@ -103,6 +104,7 @@ "settings.builder.extraCommandLine": "构建时 unify_builder 的附加命令行参数", "settings.builder.presetEnvVars": "构建时预设的全局环境变量", + "settings.enable.ccache": "决定是否启用 [ccache](https://ccache.dev/) 用于加速大型项目的编译速度", "settings.option.show.toolbar.in.editer.title": "在编辑器的标题栏显示工具栏图标", "settings.option.show.statusbar": "在状态栏显示工具栏图标", "settings.option.print.relative.path": "编译时打印源文件的相对路径", diff --git a/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json b/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json index dfb4ea37..69c04555 100644 --- a/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json +++ b/res/tools/darwin/unify_builder/arm64/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/osx-arm64": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -60,7 +60,7 @@ } }, "libraries": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/darwin/unify_builder/arm64/unify_builder.dll b/res/tools/darwin/unify_builder/arm64/unify_builder.dll index 2ad08cc7..a6d871be 100644 Binary files a/res/tools/darwin/unify_builder/arm64/unify_builder.dll and b/res/tools/darwin/unify_builder/arm64/unify_builder.dll differ diff --git a/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json b/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json index 97b71faf..c76623a9 100644 --- a/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json +++ b/res/tools/darwin/unify_builder/x86_64/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/osx-x64": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -60,7 +60,7 @@ } }, "libraries": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/darwin/unify_builder/x86_64/unify_builder.dll b/res/tools/darwin/unify_builder/x86_64/unify_builder.dll index eb9b056f..2c8376c7 100644 Binary files a/res/tools/darwin/unify_builder/x86_64/unify_builder.dll and b/res/tools/darwin/unify_builder/x86_64/unify_builder.dll differ diff --git a/res/tools/linux/unify_builder/unify_builder.deps.json b/res/tools/linux/unify_builder/unify_builder.deps.json index e7e3d9c4..ff22183d 100644 --- a/res/tools/linux/unify_builder/unify_builder.deps.json +++ b/res/tools/linux/unify_builder/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/linux-x64": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -60,7 +60,7 @@ } }, "libraries": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/linux/unify_builder/unify_builder.dll b/res/tools/linux/unify_builder/unify_builder.dll index eb9b056f..2c8376c7 100644 Binary files a/res/tools/linux/unify_builder/unify_builder.dll and b/res/tools/linux/unify_builder/unify_builder.dll differ diff --git a/res/tools/win32/unify_builder/unify_builder.deps.json b/res/tools/win32/unify_builder/unify_builder.deps.json index 963b5c6f..57453d86 100644 --- a/res/tools/win32/unify_builder/unify_builder.deps.json +++ b/res/tools/win32/unify_builder/unify_builder.deps.json @@ -7,7 +7,7 @@ "targets": { ".NETCoreApp,Version=v6.0": {}, ".NETCoreApp,Version=v6.0/win-x64": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "dependencies": { "CommandLineParser": "2.9.1", "ConsoleTableExt": "3.1.9", @@ -60,7 +60,7 @@ } }, "libraries": { - "unify_builder/3.7.5": { + "unify_builder/3.8.0": { "type": "project", "serviceable": false, "sha512": "" diff --git a/res/tools/win32/unify_builder/unify_builder.dll b/res/tools/win32/unify_builder/unify_builder.dll index 608b5438..4d9dabde 100644 Binary files a/res/tools/win32/unify_builder/unify_builder.dll and b/res/tools/win32/unify_builder/unify_builder.dll differ diff --git a/res/tools/win32/unify_builder/unify_builder.exe b/res/tools/win32/unify_builder/unify_builder.exe index 1ed20cb0..6af29e40 100644 Binary files a/res/tools/win32/unify_builder/unify_builder.exe and b/res/tools/win32/unify_builder/unify_builder.exe differ diff --git a/src/CodeBuilder.ts b/src/CodeBuilder.ts index eddec9c0..00efa469 100644 --- a/src/CodeBuilder.ts +++ b/src/CodeBuilder.ts @@ -57,13 +57,15 @@ import * as ArmCpuUtils from './ArmCpuUtils'; export interface BuildOptions { - dry_run?: boolean; // true: 仅输出编译命令及版本信息 - not_rebuild?: boolean; // true: 增量编译,false: 重新编译所有 flashAfterBuild?: boolean; - onlyGenParams?: boolean; + onlyDumpCompilerInfo?: boolean; // true: 仅输出编译命令及版本信息 + + onlyDumpBuilderParams?: boolean; + + otherArgs?: string[]; } export interface BuilderParams { @@ -90,6 +92,7 @@ export interface BuilderParams { options: BuilderOptions; sha?: { [options_name: string]: string }; env?: { [name: string]: any }; + sysPaths?: string[]; } export interface CompilerCommandsDatabaseItem { @@ -104,7 +107,8 @@ export abstract class CodeBuilder { protected project: AbstractProject; protected useFastCompile?: boolean; - protected useShowParamsMode?: boolean; + protected onlyDumpCompilerInfo?: boolean; + protected otherArgs?: string[]; protected _event: events.EventEmitter; protected logWatcher: FileWatcher | undefined; @@ -240,9 +244,10 @@ export abstract class CodeBuilder { build(options?: BuildOptions): void { let commandLine = this.genBuildCommand(options); + if (options?.onlyDumpBuilderParams) return; // if only generate params, exit if (!commandLine) return; - const title = (options?.dry_run ? 'compiler params' : 'build') + `:${this.project.getCurrentTarget()}`; + const title = (options?.onlyDumpCompilerInfo ? 'compiler params' : 'build') + `:${this.project.getCurrentTarget()}`; // watch log, to emit done event try { @@ -310,9 +315,10 @@ export abstract class CodeBuilder { genBuildCommand(options?: BuildOptions, disPowershell?: boolean): string | undefined { - // reinit build mode + // setup build mode this.useFastCompile = options?.not_rebuild; - this.useShowParamsMode = options?.dry_run; + this.onlyDumpCompilerInfo = options?.onlyDumpCompilerInfo; + this.otherArgs = options?.otherArgs; /* if not found toolchain, exit ! */ if (!this.project.checkAndNotifyInstallToolchain()) { return; } @@ -325,9 +331,6 @@ export abstract class CodeBuilder { const commandLine = generateDotnetProgramCmd( ResManager.instance().getUnifyBuilderExe(), this.getCommands()); - // if only generate params, exit - if (options?.onlyGenParams) return; - return commandLine; } @@ -404,7 +407,8 @@ export abstract class CodeBuilder { sourceParams: sourceInfo.params, sourceParamsMtime: sourceInfo.paramsModTime, options: JSON.parse(JSON.stringify(compileOptions)), - env: this.project.getProjectVariables() + env: this.project.getProjectVariables(), + sysPaths: [] }; // set ram size from env @@ -541,26 +545,36 @@ export abstract class CodeBuilder { builderOptions.buildMode = builderModeList.map(str => str.toLowerCase()).join('|'); } - // write project build params - fs.writeFileSync(paramsPath, JSON.stringify(builderOptions, undefined, 4)); - - let cmds = [ - '-p', paramsPath, - ]; + let cmds = ['-p', paramsPath]; if (this.isRebuild()) { cmds.push('--rebuild'); + } else { + if (settingManager.isEnableCcache(builderOptions.sourceList.length)) { + cmds.push('--use-ccache'); + const dir = File.from(ResManager.instance().getBuiltInToolsDir().path, 'ccache'); + if (dir.IsDir()) { + builderOptions.sysPaths?.push(dir.path); + } + } } - if (this.useShowParamsMode) { + if (this.onlyDumpCompilerInfo) { cmds.push('--only-dump-args'); } + if (this.otherArgs && this.otherArgs.length > 0) { + this.otherArgs.forEach(arg => cmds.push(arg)); + } + const extraCmd = settingManager.getBuilderAdditionalCommandLine()?.trim(); if (extraCmd) { cmds = cmds.concat(extraCmd.split(/\s+/)); } + // write project build params + fs.writeFileSync(paramsPath, JSON.stringify(builderOptions, undefined, 4)); + return cmds; } diff --git a/src/EIDEProject.ts b/src/EIDEProject.ts index ddad1dfc..c5187afa 100644 --- a/src/EIDEProject.ts +++ b/src/EIDEProject.ts @@ -955,6 +955,9 @@ export abstract class AbstractProject implements CustomConfigurationProvider, Pr return this.getProjectFile(); } + /** + * get project root dir, which contains *.code-workspace file + */ public getProjectRoot(): File { return this.getRootDir(); } diff --git a/src/EIDEProjectExplorer.ts b/src/EIDEProjectExplorer.ts index 92052d05..7148180b 100644 --- a/src/EIDEProjectExplorer.ts +++ b/src/EIDEProjectExplorer.ts @@ -4772,6 +4772,66 @@ export class ProjectExplorer implements CustomConfigurationProvider { }); } + async ExportMakefile(prjItem?: ProjTreeItem) { + + const prj = this.getProjectByTreeItem(prjItem); + + if (prj === undefined) { + GlobalEvent.emit('msg', newMessage('Error', 'No active project !')); + return; + } + if (this._buildLock) { + GlobalEvent.emit('msg', newMessage('Error', 'builder busy !, please wait !')); + return; + } + + // gen command line + prj.Save(true); + const builder = CodeBuilder.NewBuilder(prj); + const cmdLine = builder.genBuildCommand({ otherArgs: ['--out-makefile', '--dry-run'] }); + if (cmdLine === undefined) { + GlobalEvent.emit('msg', newMessage('Error', `Fail to generate build command`)); + return; + } + + // do export + + vscode.window.withProgress({ + title: `Export Makefile`, + location: vscode.ProgressLocation.Notification + }, (progress, cancel) => { + return new Promise((resolve) => { + const proc = new ExeCmd(); + let errLines: string[] = [`Execute: ${cmdLine}`]; + proc.on('launch', () => { + progress.report({ message: 'Running ...' }); + }); + proc.on('line', str => { + errLines.push(str); + progress.report({ message: str }); + }); + proc.on('close', exitInfo => { + if (exitInfo.code == 0) { + progress.report({ message: 'All Done.' }); + setTimeout(() => resolve(true), 1000); + } else { + resolve(false); + GlobalEvent.emit('msg', newMessage('Error', `Fail to export Makefile, code=${exitInfo.code}`)); + if (errLines.length > 0) { + GlobalEvent.log_warn(errLines.slice(-100).join(os.EOL)); + } + } + }); + cancel?.onCancellationRequested(_ => { + if (!kill(proc.pid())) { + GlobalEvent.emit('msg', newMessage('Error', `Can not kill process: ${proc.pid()} !`)); + } + }); + proc.Run(cmdLine, undefined, { cwd: prj.getProjectRoot().path }); + }); + }); + } + private exportLocked: boolean = false; async ExportProjectTemplate(prjItem?: ProjTreeItem, isWorkspace?: boolean) { @@ -6948,16 +7008,22 @@ export class ProjectExplorer implements CustomConfigurationProvider { const tarFlasher = idxObj[sel.idx]; reporter.report({ message: 'download shell scripts' }); - let scriptDir = new File(project.getRootDir().path); - if (tarFlasher.scriptInstallDir) scriptDir = File.fromArray([scriptDir.path, tarFlasher.scriptInstallDir]); - scriptDir.CreateDir(true); + + // download and install flasher script const scriptsList = await readGithubRepoFolder(`https://api.github.com/repos/${REPO_PATH}/contents/scripts/${tarFlasher.id}`); - if (scriptsList instanceof Error) throw scriptsList; - for (const scriptInfo of scriptsList) { - if (scriptInfo.download_url) { - const buff = await downloadFile(redirectHost(scriptInfo.download_url)); - if (!(buff instanceof Buffer)) throw buff || new Error(`Cannot download '${scriptInfo.name}'`); - fs.writeFileSync(`${scriptDir.path}/${scriptInfo.name}`, buff); + if (scriptsList instanceof Error) { + if (scriptsList.message?.trim() != 'Not Found') + throw scriptsList; + } else { + let scriptDir = new File(project.getRootDir().path); + if (tarFlasher.scriptInstallDir) scriptDir = File.fromArray([scriptDir.path, tarFlasher.scriptInstallDir]); + scriptDir.CreateDir(true); + for (const scriptInfo of scriptsList) { + if (scriptInfo.download_url) { + const buff = await downloadFile(redirectHost(scriptInfo.download_url)); + if (!(buff instanceof Buffer)) throw buff || new Error(`Cannot download '${scriptInfo.name}'`); + fs.writeFileSync(`${scriptDir.path}/${scriptInfo.name}`, buff); + } } } diff --git a/src/SettingManager.ts b/src/SettingManager.ts index 11956d7d..bf6da3fe 100644 --- a/src/SettingManager.ts +++ b/src/SettingManager.ts @@ -30,12 +30,12 @@ import * as NodePath from 'path'; import { File } from '../lib/node-utility/File'; import { GlobalEvent } from './GlobalEvents'; -import { ExceptionToMessage } from './Message'; +import { ExceptionToMessage, newMessage } from './Message'; import * as Utility from './utility'; -import { find, exeSuffix, userhome } from './Platform'; +import { find, exeSuffix, userhome, osType } from './Platform'; import { WorkspaceManager } from './WorkspaceManager'; import { ToolchainName } from './ToolchainManager'; -import { view_str$prompt$needReloadToUpdateEnv } from './StringTable'; +import { view_str$prompt$needReloadToUpdateEnv, WARNING } from './StringTable'; export enum CheckStatus { All_Verified, @@ -122,6 +122,21 @@ export class SettingManager { Utility.notifyReloadWindow(view_str$prompt$needReloadToUpdateEnv); } + //! 暂时弃用 ccache + // // for non-win32 platform, we provide a check when user want to use 'ccache' + // if (osType() != 'win32') { + // if (e.affectsConfiguration('EIDE.Option.ccache')) { + // const sel = this.getConfiguration().get('Option.ccache'); + // if (sel !== 'never') { + // const path = find(`ccache${exeSuffix()}`); + // if (!path) { + // vscode.window.showWarningMessage( + // `${WARNING}: not found 'ccache', please install it by system packages manager.`); + // } + // } + // } + // } + } catch (error) { GlobalEvent.log_warn(error); } @@ -294,6 +309,32 @@ export class SettingManager { return this.getConfiguration().get('Cpptools.ForceInclude') || []; } + //! 暂时弃用 ccache + // "EIDE.Option.ccache": { + // "type": "string", + // "scope": "resource", + // "markdownDescription": "%settings.enable.ccache%", + // "default": "never", + // "enum": [ + // "auto", + // "always", + // "never" + // ], + // "enumDescriptions": [ + // "Auto", + // "Always Use", + // "Never Use" + // ] + // }, + isEnableCcache(sourceAmount: number): boolean { + // const sel = this.getConfiguration().get('Option.ccache'); + // if (sel === 'always') + // return true; + // if (sel === 'auto' && sourceAmount > 500) + // return true; + return false; + } + isEnableMsys(): boolean { if (os.platform() != 'win32') return false; //! not support non-win32 platform diff --git a/src/extension.ts b/src/extension.ts index 44aea36d..f6146761 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -149,7 +149,7 @@ export async function activate(context: vscode.ExtensionContext) { subscriptions.push(vscode.commands.registerCommand('eide.reinstall.binaries', () => checkAndInstallBinaries(true))); subscriptions.push(vscode.commands.registerCommand('eide.project.flash.erase.all', (item) => projectExplorer.UploadToDevice(item, true))); subscriptions.push(vscode.commands.registerCommand('eide.project.buildAndFlash', (item) => projectExplorer.BuildSolution(item, { not_rebuild: true, flashAfterBuild: true }))); - subscriptions.push(vscode.commands.registerCommand('eide.project.genBuilderParams', (item) => projectExplorer.BuildSolution(item, { not_rebuild: true, onlyGenParams: true }))); + subscriptions.push(vscode.commands.registerCommand('eide.project.genBuilderParams', (item) => projectExplorer.BuildSolution(item, { not_rebuild: true, onlyDumpBuilderParams: true }))); subscriptions.push(vscode.commands.registerCommand('eide.open.makelibs.cfg', (item) => projectExplorer.openLibsGeneratorConfig(item))); // operations bar @@ -157,13 +157,15 @@ export async function activate(context: vscode.ExtensionContext) { subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.clearHistoryRecord', () => projectExplorer.clearAllHistoryRecords())); // project - subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.showBuildParams', (item) => projectExplorer.BuildSolution(item, { dry_run: true }))); + subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.showBuildParams', (item) => projectExplorer.BuildSolution(item, { onlyDumpCompilerInfo: true }))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.setActive', (item) => projectExplorer.setActiveProject(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.close', (item) => projectExplorer.Close(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.saveAll', () => projectExplorer.SaveAll())); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.refresh', () => projectExplorer.Refresh())); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.switchMode', (item) => projectExplorer.switchTarget(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.exportAsTemplate', (item) => projectExplorer.ExportProjectTemplate(item))); + subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.exportXml', (item) => projectExplorer.ExportKeilXml(item.val.projectIndex))); + subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.exportMakefile', (item) => projectExplorer.ExportMakefile(item.val.projectIndex))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.show_proj_vars', (item) => projectExplorer.ShowProjectVariables(item))); // project explorer @@ -212,7 +214,6 @@ export async function activate(context: vscode.ExtensionContext) { // package subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.removePackage', (item) => projectExplorer.UninstallKeilPackage(item))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.addPackage', (item) => projectExplorer.InstallKeilPackage(item.val.projectIndex))); - subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.exportXml', (item) => projectExplorer.ExportKeilXml(item.val.projectIndex))); subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.setDevice', (item) => projectExplorer.SetDevice(item.val.projectIndex))); // - cmsis core packages subscriptions.push(vscode.commands.registerCommand('_cl.eide.project.installCMSISHeaders', (item) => projectExplorer.installCmsisSourcePack(item, 'header'))); diff --git a/src/utility.ts b/src/utility.ts index 9a35194b..6a476388 100644 --- a/src/utility.ts +++ b/src/utility.ts @@ -132,7 +132,7 @@ export function openocd_getConfigList(category: 'interface' | 'target', projectR } // find in build-in path - for (const path of ['scripts', 'share/openocd/scripts']) { + for (const path of ['scripts', 'share/openocd/scripts', 'openocd/scripts']) { const cfgFolder = File.from(openocdExe.dir, '..', path, category); if (cfgFolder.IsDir()) { cfgFolder.GetAll([/\.cfg$/i], File.EXCLUDE_ALL_FILTER).forEach((file) => {