Skip to content

Commit af2f20c

Browse files
authored
Merge pull request #368 from github0null/dev
v3.19.6 update
2 parents aff572a + 6484d22 commit af2f20c

26 files changed

+6558
-4318
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ bin_bk
3434
dotnet-runtime*.exe
3535

3636
# shell script
37-
./*.sh
37+
/*.sh
3838

3939
# test
4040
test

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.19.6] update
10+
11+
**Change**:
12+
- `Builder Options`: Combine all builder options (`*.options.json`) into `eide.json`.
13+
- `Files Options`: Combine all file's options (`*.files.options.yml`) into single file: `files.options.yml`.
14+
15+
**Optimize**:
16+
- `Project TreeView`: Expand Project TreeView's root node when you open a project.
17+
- `Keil Project Import`: Do not disable internal hex file output if keil project not have any actived User Commands.
18+
- `Source Code`: Update dependence packages to resolve package vulnerabilities.
19+
- `Chip Package Manager`: Optimize code.
20+
21+
Update build environment to NodeJS `v16`.
22+
23+
***
24+
925
### [v3.18.2] revision
1026

1127
**Fix**:

package-lock.json

+5,545-3,631
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"homepage": "https://em-ide.com",
3939
"license": "MIT",
4040
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/MIPS/RISC-V",
41-
"version": "3.18.2",
41+
"version": "3.19.6",
4242
"preview": false,
4343
"engines": {
4444
"vscode": "^1.67.0"
@@ -97,8 +97,8 @@
9797
"ts-loader": "^6.2.1",
9898
"tslint": "^5.20.1",
9999
"typescript": "^3.7.3",
100-
"webpack": "^4.42.0",
101-
"webpack-cli": "^3.3.11"
100+
"webpack": "^5.93.0",
101+
"webpack-cli": "^5.1.4"
102102
},
103103
"dependencies": {
104104
"iconv-lite": "^0.5.0",
@@ -110,9 +110,9 @@
110110
"node-7z": "^3.0.0",
111111
"table": "^6.8.1",
112112
"vscode-cpptools": "^5.0.0",
113-
"x2js": "3.4.1",
113+
"x2js": "^3.4.1",
114114
"xml-formatter": "^2.6.1",
115-
"xml2js": "^0.4.23",
115+
"xml2js": "^0.6.2",
116116
"yaml": "^1.10.2"
117117
},
118118
"contributes": {

package.nls.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"eide.project.clean": "Clean",
3131
"eide.project.upload": "Program Flash",
3232
"eide.project.flash.erase.all": "Erase Chip",
33-
"eide.project.modify.files.options": "Show Source Files Extra Compiler Options",
33+
"eide.project.modify.files.options": "Show Extra Options Of All Source Files",
3434
"eide.project.import.ext.project.src.struct": "Import SourceFile Tree From Other Project",
3535
"eide.project.generate_builder_params": "Generate builder.params",
3636

package.nls.zh-CN.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"eide.project.clean": "清理",
3131
"eide.project.upload": "烧录",
3232
"eide.project.flash.erase.all": "擦除芯片",
33-
"eide.project.modify.files.options": "查看所有的源文件附加编译参数",
33+
"eide.project.modify.files.options": "查看所有源文件的附加编译参数",
3434
"eide.project.import.ext.project.src.struct": "从其他 IDE 的项目中导入源文件树",
3535
"eide.project.generate_builder_params": "生成 builder.params",
3636

res/data/template.files.options.yml

-31
This file was deleted.

src/CodeBuilder.ts

+11-12
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ import * as mathjs from 'mathjs';
3434
import { AbstractProject, VirtualSource } from "./EIDEProject";
3535
import { ResManager } from "./ResManager";
3636
import { File } from "../lib/node-utility/File";
37-
import { ProjectConfigData, ProjectConfiguration } from "./EIDETypeDefine";
37+
import { BuilderOptions, ProjectConfigData, ProjectConfiguration } from "./EIDETypeDefine";
3838
import {
3939
ArmBaseCompileData,
40-
Memory, ARMStorageLayout, ICompileOptions,
40+
Memory, ARMStorageLayout,
4141
FloatingHardwareOption, C51BaseCompileData, RiscvCompileData, AnyGccCompileData, MipsCompileData
4242
} from './EIDEProjectModules';
4343
import { SettingManager } from "./SettingManager";
@@ -87,7 +87,7 @@ export interface BuilderParams {
8787
incDirs: string[];
8888
libDirs: string[];
8989
defines: string[];
90-
options: ICompileOptions;
90+
options: BuilderOptions;
9191
sha?: { [options_name: string]: string };
9292
env?: { [name: string]: any };
9393
}
@@ -378,8 +378,7 @@ export abstract class CodeBuilder {
378378

379379
const outDir = File.ToUnixPath(this.project.getOutputDir());
380380
const paramsPath = this.project.ToAbsolutePath(outDir + File.sep + this.paramsFileName);
381-
const compileOptions: ICompileOptions = this.project.GetConfiguration()
382-
.compileConfigModel.getOptions(this.project.getEideDir().path, config);
381+
const compileOptions: BuilderOptions = this.project.GetConfiguration().compileConfigModel.getOptions();
383382
const memMaxSize = this.getMcuMemorySize();
384383
const oldParamsPath = `${paramsPath}.old`;
385384
const prevParams: BuilderParams | undefined = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : undefined;
@@ -497,7 +496,7 @@ export abstract class CodeBuilder {
497496
builderOptions.options.afterBuildTasks = [command].concat(builderOptions.options.afterBuildTasks);
498497
} catch (error) {
499498
GlobalEvent.emit('msg', newMessage('Warning', `Generating '${mkfile_path}' failed !`));
500-
GlobalEvent.emit('globalLog', ExceptionToMessage(error, 'Error'));
499+
GlobalEvent.log_error(error);
501500
}
502501
}
503502

@@ -569,7 +568,7 @@ export abstract class CodeBuilder {
569568

570569
protected abstract getMcuMemorySize(): MemorySize | undefined;
571570

572-
protected abstract preHandleOptions(options: ICompileOptions): void;
571+
protected abstract preHandleOptions(options: BuilderOptions): void;
573572

574573
static NewBuilder(_project: AbstractProject): CodeBuilder {
575574
switch (_project.GetConfiguration().config.type) {
@@ -911,7 +910,7 @@ export class ARMCodeBuilder extends CodeBuilder {
911910
return undefined;
912911
}
913912

914-
protected preHandleOptions(options: ICompileOptions) {
913+
protected preHandleOptions(options: BuilderOptions) {
915914

916915
const config = this.project.GetConfiguration<ArmBaseCompileData>().config;
917916
const toolchain = this.project.getToolchain();
@@ -1046,7 +1045,7 @@ class RiscvCodeBuilder extends CodeBuilder {
10461045
return undefined;
10471046
}
10481047

1049-
protected preHandleOptions(options: ICompileOptions) {
1048+
protected preHandleOptions(options: BuilderOptions) {
10501049

10511050
const config = this.project.GetConfiguration<RiscvCompileData>().config;
10521051

@@ -1072,7 +1071,7 @@ class MipsCodeBuilder extends CodeBuilder {
10721071
return undefined;
10731072
}
10741073

1075-
protected preHandleOptions(options: ICompileOptions) {
1074+
protected preHandleOptions(options: BuilderOptions) {
10761075

10771076
const config = this.project.GetConfiguration<MipsCompileData>().config;
10781077

@@ -1098,7 +1097,7 @@ class AnyGccCodeBuilder extends CodeBuilder {
10981097
return undefined;
10991098
}
11001099

1101-
protected preHandleOptions(options: ICompileOptions) {
1100+
protected preHandleOptions(options: BuilderOptions) {
11021101

11031102
const config = this.project.GetConfiguration<AnyGccCompileData>().config;
11041103

@@ -1156,7 +1155,7 @@ class C51CodeBuilder extends CodeBuilder {
11561155
return undefined;
11571156
}
11581157

1159-
protected preHandleOptions(options: ICompileOptions) {
1158+
protected preHandleOptions(options: BuilderOptions) {
11601159

11611160
const config = this.project.GetConfiguration<C51BaseCompileData>().config;
11621161
const toolchain = this.project.getToolchain();

src/DependenceManager.ts

+28-21
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ export class DependenceManager implements ManagerInterface {
6565
}
6666

6767
InstallComponent(packName: string, component: Component) {
68+
GlobalEvent.log_info(`Install CMSIS Component: ${component.groupName} ...`);
6869
this._installComponent(packName, component, [component.groupName]);
70+
GlobalEvent.log_info(`Done.`);
6971
}
7072

7173
private _installComponent(packName: string, component: Component, pendingList: string[]) {
@@ -77,25 +79,32 @@ export class DependenceManager implements ManagerInterface {
7779

7880
/* 安装此组件的依赖项 */
7981
if (component.condition) {
80-
const r = packageManager.CheckConditionRequire(component.condition, toolchain);
81-
if (r == false)
82-
throw new Error(`This condition '${component.condition}' is not met for component: '${component.groupName}'`);
83-
if (Array.isArray(r)) {
84-
for (const comp of r) {
85-
const compName = comp.replace('Device.', '');
86-
if (!comp.startsWith('Device.'))
87-
continue; /* 排除非 Device 类型的组件 */
88-
if (this.isInstalled(packName, compName))
89-
continue; /* 排除已安装的 */
90-
if (pendingList.includes(compName))
91-
continue; /* 排除队列中已存在的 */
92-
const t = packageManager.FindComponent(compName);
93-
if (t) {
94-
pendingList.push(compName);
95-
this._installComponent(packName, t, pendingList);
82+
// check and get dependences
83+
let depList: string[] = [];
84+
try {
85+
depList= packageManager.checkComponentRequirement(component.condition, toolchain);
86+
} catch (error) {
87+
GlobalEvent.log_warn(`${(<Error>error).message}`);
88+
throw new Error(`Condition '${component.condition}' is not fit for this component: '${component.groupName}'`);
89+
}
90+
// try install dependences
91+
for (const fullname of depList) {
92+
if (!fullname.startsWith('Device.')) {
93+
GlobalEvent.log_warn(`${' '.repeat(pendingList.length)}-> ignore component: '${fullname}'`);
94+
continue; /* 排除非 Device 类型的组件 */
95+
}
96+
const reqName = fullname.replace('Device.', '');
97+
const compList = packageManager.FindAllComponents(reqName);
98+
if (compList) {
99+
for (const item of compList) {
100+
if (this.isInstalled(packName, item.groupName))
101+
continue; /* 排除已安装的 */
102+
if (pendingList.includes(item.groupName))
103+
continue; /* 排除队列中已存在的 */
104+
pendingList.push(item.groupName);
105+
GlobalEvent.log_info(`${' '.repeat(pendingList.length)}-> install dependence component: ${item.groupName}`);
106+
this._installComponent(packName, item, pendingList);
96107
pendingList.pop();
97-
} else {
98-
throw new Error(`Not found required sub component: '${comp}'`);
99108
}
100109
}
101110
}
@@ -541,9 +550,7 @@ export class DependenceManager implements ManagerInterface {
541550

542551
const toolchain = this.project.getToolchain();
543552
const prjConfig = this.project.GetConfiguration();
544-
545-
const builderOpts = prjConfig.compileConfigModel
546-
.getOptions(this.project.getEideDir().path, prjConfig.config);
553+
const builderOpts = prjConfig.compileConfigModel.getOptions();
547554

548555
const incList = ArrayDelRepetition(toolchain.getSystemIncludeList(builderOpts)
549556
.concat(toolchain.getDefaultIncludeList()));

0 commit comments

Comments
 (0)