Skip to content

Commit

Permalink
Merge pull request #368 from github0null/dev
Browse files Browse the repository at this point in the history
v3.19.6 update
  • Loading branch information
github0null authored Aug 23, 2024
2 parents aff572a + 6484d22 commit af2f20c
Show file tree
Hide file tree
Showing 26 changed files with 6,558 additions and 4,318 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bin_bk
dotnet-runtime*.exe

# shell script
./*.sh
/*.sh

# test
test
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ All notable version changes will be recorded in this file.

***

### [v3.19.6] update

**Change**:
- `Builder Options`: Combine all builder options (`*.options.json`) into `eide.json`.
- `Files Options`: Combine all file's options (`*.files.options.yml`) into single file: `files.options.yml`.

**Optimize**:
- `Project TreeView`: Expand Project TreeView's root node when you open a project.
- `Keil Project Import`: Do not disable internal hex file output if keil project not have any actived User Commands.
- `Source Code`: Update dependence packages to resolve package vulnerabilities.
- `Chip Package Manager`: Optimize code.

Update build environment to NodeJS `v16`.

***

### [v3.18.2] revision

**Fix**:
Expand Down
9,176 changes: 5,545 additions & 3,631 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.18.2",
"version": "3.19.6",
"preview": false,
"engines": {
"vscode": "^1.67.0"
Expand Down Expand Up @@ -97,8 +97,8 @@
"ts-loader": "^6.2.1",
"tslint": "^5.20.1",
"typescript": "^3.7.3",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11"
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
},
"dependencies": {
"iconv-lite": "^0.5.0",
Expand All @@ -110,9 +110,9 @@
"node-7z": "^3.0.0",
"table": "^6.8.1",
"vscode-cpptools": "^5.0.0",
"x2js": "3.4.1",
"x2js": "^3.4.1",
"xml-formatter": "^2.6.1",
"xml2js": "^0.4.23",
"xml2js": "^0.6.2",
"yaml": "^1.10.2"
},
"contributes": {
Expand Down
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eide.project.clean": "Clean",
"eide.project.upload": "Program Flash",
"eide.project.flash.erase.all": "Erase Chip",
"eide.project.modify.files.options": "Show Source Files Extra Compiler Options",
"eide.project.modify.files.options": "Show Extra Options Of All Source Files",
"eide.project.import.ext.project.src.struct": "Import SourceFile Tree From Other Project",
"eide.project.generate_builder_params": "Generate builder.params",

Expand Down
2 changes: 1 addition & 1 deletion package.nls.zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"eide.project.clean": "清理",
"eide.project.upload": "烧录",
"eide.project.flash.erase.all": "擦除芯片",
"eide.project.modify.files.options": "查看所有的源文件附加编译参数",
"eide.project.modify.files.options": "查看所有源文件的附加编译参数",
"eide.project.import.ext.project.src.struct": "从其他 IDE 的项目中导入源文件树",
"eide.project.generate_builder_params": "生成 builder.params",

Expand Down
31 changes: 0 additions & 31 deletions res/data/template.files.options.yml

This file was deleted.

23 changes: 11 additions & 12 deletions src/CodeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import * as mathjs from 'mathjs';
import { AbstractProject, VirtualSource } from "./EIDEProject";
import { ResManager } from "./ResManager";
import { File } from "../lib/node-utility/File";
import { ProjectConfigData, ProjectConfiguration } from "./EIDETypeDefine";
import { BuilderOptions, ProjectConfigData, ProjectConfiguration } from "./EIDETypeDefine";
import {
ArmBaseCompileData,
Memory, ARMStorageLayout, ICompileOptions,
Memory, ARMStorageLayout,
FloatingHardwareOption, C51BaseCompileData, RiscvCompileData, AnyGccCompileData, MipsCompileData
} from './EIDEProjectModules';
import { SettingManager } from "./SettingManager";
Expand Down Expand Up @@ -87,7 +87,7 @@ export interface BuilderParams {
incDirs: string[];
libDirs: string[];
defines: string[];
options: ICompileOptions;
options: BuilderOptions;
sha?: { [options_name: string]: string };
env?: { [name: string]: any };
}
Expand Down Expand Up @@ -378,8 +378,7 @@ export abstract class CodeBuilder {

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

Expand Down Expand Up @@ -569,7 +568,7 @@ export abstract class CodeBuilder {

protected abstract getMcuMemorySize(): MemorySize | undefined;

protected abstract preHandleOptions(options: ICompileOptions): void;
protected abstract preHandleOptions(options: BuilderOptions): void;

static NewBuilder(_project: AbstractProject): CodeBuilder {
switch (_project.GetConfiguration().config.type) {
Expand Down Expand Up @@ -911,7 +910,7 @@ export class ARMCodeBuilder extends CodeBuilder {
return undefined;
}

protected preHandleOptions(options: ICompileOptions) {
protected preHandleOptions(options: BuilderOptions) {

const config = this.project.GetConfiguration<ArmBaseCompileData>().config;
const toolchain = this.project.getToolchain();
Expand Down Expand Up @@ -1046,7 +1045,7 @@ class RiscvCodeBuilder extends CodeBuilder {
return undefined;
}

protected preHandleOptions(options: ICompileOptions) {
protected preHandleOptions(options: BuilderOptions) {

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

Expand All @@ -1072,7 +1071,7 @@ class MipsCodeBuilder extends CodeBuilder {
return undefined;
}

protected preHandleOptions(options: ICompileOptions) {
protected preHandleOptions(options: BuilderOptions) {

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

Expand All @@ -1098,7 +1097,7 @@ class AnyGccCodeBuilder extends CodeBuilder {
return undefined;
}

protected preHandleOptions(options: ICompileOptions) {
protected preHandleOptions(options: BuilderOptions) {

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

Expand Down Expand Up @@ -1156,7 +1155,7 @@ class C51CodeBuilder extends CodeBuilder {
return undefined;
}

protected preHandleOptions(options: ICompileOptions) {
protected preHandleOptions(options: BuilderOptions) {

const config = this.project.GetConfiguration<C51BaseCompileData>().config;
const toolchain = this.project.getToolchain();
Expand Down
49 changes: 28 additions & 21 deletions src/DependenceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export class DependenceManager implements ManagerInterface {
}

InstallComponent(packName: string, component: Component) {
GlobalEvent.log_info(`Install CMSIS Component: ${component.groupName} ...`);
this._installComponent(packName, component, [component.groupName]);
GlobalEvent.log_info(`Done.`);
}

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

/* 安装此组件的依赖项 */
if (component.condition) {
const r = packageManager.CheckConditionRequire(component.condition, toolchain);
if (r == false)
throw new Error(`This condition '${component.condition}' is not met for component: '${component.groupName}'`);
if (Array.isArray(r)) {
for (const comp of r) {
const compName = comp.replace('Device.', '');
if (!comp.startsWith('Device.'))
continue; /* 排除非 Device 类型的组件 */
if (this.isInstalled(packName, compName))
continue; /* 排除已安装的 */
if (pendingList.includes(compName))
continue; /* 排除队列中已存在的 */
const t = packageManager.FindComponent(compName);
if (t) {
pendingList.push(compName);
this._installComponent(packName, t, pendingList);
// check and get dependences
let depList: string[] = [];
try {
depList= packageManager.checkComponentRequirement(component.condition, toolchain);
} catch (error) {
GlobalEvent.log_warn(`${(<Error>error).message}`);
throw new Error(`Condition '${component.condition}' is not fit for this component: '${component.groupName}'`);
}
// try install dependences
for (const fullname of depList) {
if (!fullname.startsWith('Device.')) {
GlobalEvent.log_warn(`${' '.repeat(pendingList.length)}-> ignore component: '${fullname}'`);
continue; /* 排除非 Device 类型的组件 */
}
const reqName = fullname.replace('Device.', '');
const compList = packageManager.FindAllComponents(reqName);
if (compList) {
for (const item of compList) {
if (this.isInstalled(packName, item.groupName))
continue; /* 排除已安装的 */
if (pendingList.includes(item.groupName))
continue; /* 排除队列中已存在的 */
pendingList.push(item.groupName);
GlobalEvent.log_info(`${' '.repeat(pendingList.length)}-> install dependence component: ${item.groupName}`);
this._installComponent(packName, item, pendingList);
pendingList.pop();
} else {
throw new Error(`Not found required sub component: '${comp}'`);
}
}
}
Expand Down Expand Up @@ -541,9 +550,7 @@ export class DependenceManager implements ManagerInterface {

const toolchain = this.project.getToolchain();
const prjConfig = this.project.GetConfiguration();

const builderOpts = prjConfig.compileConfigModel
.getOptions(this.project.getEideDir().path, prjConfig.config);
const builderOpts = prjConfig.compileConfigModel.getOptions();

const incList = ArrayDelRepetition(toolchain.getSystemIncludeList(builderOpts)
.concat(toolchain.getDefaultIncludeList()));
Expand Down
Loading

0 comments on commit af2f20c

Please sign in to comment.