Skip to content

Commit fd46f18

Browse files
authored
Merge pull request #256 from github0null/dev
v3.13.0 update
2 parents 6b9e29a + f0661f4 commit fd46f18

File tree

7 files changed

+272
-183
lines changed

7 files changed

+272
-183
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,30 @@ All notable version changes will be recorded in this file.
66

77
***
88

9+
### [v3.13.0] update
10+
11+
**New**:
12+
- `MIPS Project`: Support new project type `MIPS` and new toolchain `MTI GCC`, thanks [@eatradish](https://github.com/eatradish).
13+
- `Status Bar`: Add status bar for project target switch.
14+
- `STM8 MapView`: Support MapView for COSMIC-STM8 Compiler.
15+
16+
**Fix**:
17+
- `Switch Target`: Not copy source options file if it's not existed when switch target.
18+
- `Cpptools Intellisense`: Notify cpptools update source config after active project changed.
19+
20+
**Change**:
21+
- `IAR Arm Toolchain`: Remove auto-gen '-I' include options for iar arm assembler.
22+
23+
**Optimize**:
24+
- `COSMIC_STM8`: Auto generate `.d` files for COSMIC_STM8.
25+
- `KeilC51 Importer`: Setup 'CClasses, UserClasses' when import a keilc51 project.
26+
- `System Variables`: Add some system variables, like: `${SYS_Platform}, ${SYS_DirSep} ...`
27+
- `Auto Save`: Compare content before save project.
28+
- `Source Folder`: Need to confirm before remove src folder.
29+
- `IAR Toolchain`: Add more cpu list for selection.
30+
31+
***
32+
933
### [v3.12.2023052101] revision
1034

1135
**New**:

package.json

Lines changed: 1 addition & 1 deletion
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.12.2023052101",
41+
"version": "3.13.0",
4242
"preview": false,
4343
"engines": {
4444
"vscode": "^1.67.0"

src/CodeBuilder.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ import { DependenceManager } from "./DependenceManager";
5050
import { WorkspaceManager } from "./WorkspaceManager";
5151
import { ToolchainName } from "./ToolchainManager";
5252
import { md5, sha256, copyObject } from "./utility";
53-
import { MakefileGen } from "./Makefile";
5453
import { exeSuffix, osType } from "./Platform";
5554
import { FileWatcher } from "../lib/node-utility/FileWatcher";
5655
import { STVPFlasherOptions } from './HexUploader';
@@ -535,16 +534,6 @@ export abstract class CodeBuilder {
535534
// write project build params
536535
fs.writeFileSync(paramsPath, JSON.stringify(builderOptions, undefined, 4));
537536

538-
// generate makefile params
539-
if (settingManager.isGenerateMakefileParams()) {
540-
try {
541-
const gen = new MakefileGen();
542-
gen.generateParamsToFile(builderOptions, this.project.ToAbsolutePath(config.outDir));
543-
} catch (error) {
544-
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
545-
}
546-
}
547-
548537
let cmds = [
549538
'-p', paramsPath,
550539
];

src/EIDEProject.ts

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,76 +2668,74 @@ class EIDEProject extends AbstractProject {
26682668

26692669
private srcRefMap: Map<string, File[]> = new Map();
26702670

2671-
public async notifyUpdateSourceRefs(toolchain_: ToolchainName | undefined): Promise<boolean> {
2671+
public async notifyUpdateSourceRefs(toolchain_: ToolchainName | undefined) {
26722672

2673-
return new Promise((resolve) => {
2674-
2675-
/* clear old */
2676-
this.srcRefMap.clear();
2673+
/* clear old */
2674+
this.srcRefMap.clear();
26772675

2678-
/* check source references is enabled ? */
2679-
if (!SettingManager.GetInstance().isDisplaySourceRefs()) {
2680-
resolve(false);
2681-
return; /* no refs list file, exit */
2682-
}
2676+
/* check source references is enabled ? */
2677+
if (!SettingManager.GetInstance().isDisplaySourceRefs()) {
2678+
return;
2679+
}
26832680

2684-
let compiler_cmd_db: CompilerCommandsDatabaseItem[] = [];
2685-
let generate_dep_file: ((cmd_db: CompilerCommandsDatabaseItem[], srcpath: string, deppath: string) => void) | undefined;
2681+
let compiler_cmd_db: CompilerCommandsDatabaseItem[] = [];
2682+
let generate_dep_file: ((cmd_db: CompilerCommandsDatabaseItem[], srcpath: string, deppath: string) => Promise<void>) | undefined;
26862683

2687-
// for COSMIC STM8, we need manual generate .d files
2684+
// for COSMIC STM8, we need manual generate .d files
2685+
try {
26882686
if (this.getToolchain().name == 'COSMIC_STM8') {
26892687
const compilerDBFile = File.fromArray([this.getOutputFolder().path, 'compile_commands.json']);
26902688
if (compilerDBFile.IsFile()) {
2691-
try {
2692-
compiler_cmd_db = jsonc.parse(compilerDBFile.Read());
2693-
generate_dep_file = (cmd_db: CompilerCommandsDatabaseItem[], srcpath: string, deppath: string) => {
2689+
compiler_cmd_db = jsonc.parse(compilerDBFile.Read());
2690+
generate_dep_file = (cmd_db: CompilerCommandsDatabaseItem[], srcpath: string, deppath: string): Promise<void> => {
2691+
return new Promise((resolve) => {
26942692
let idx = cmd_db.findIndex((e) => e.file == srcpath);
2695-
if (idx != -1) {
2696-
try {
2697-
let cmd_item = cmd_db[idx];
2698-
let command = cmd_item.command.replace('-co', '-sm -co');
2699-
const depcont = child_process.execSync(command, { cwd: cmd_item.directory }).toString();
2700-
fs.writeFileSync(deppath, depcont);
2701-
} catch (error) {
2702-
GlobalEvent.emit('globalLog', newMessage('Warning', `Failed to make '${deppath}', msg: ${(<Error>error).message}`));
2693+
if (idx == -1) { resolve(); return; }
2694+
let cmd_item = cmd_db[idx];
2695+
let command = cmd_item.command.replace('-co', '-sm -co');
2696+
child_process.exec(command, { cwd: cmd_item.directory }, (error: child_process.ExecException | null, stdout: string, stderr: string) => {
2697+
if (error) {
2698+
const msg = `Failed to make '${deppath}', msg: ${(<Error>error).message}`;
2699+
GlobalEvent.emit('globalLog', newMessage('Warning', msg));
27032700
try { fs.unlinkSync(deppath) } catch (error) { } // del old .d file
2701+
resolve();
2702+
} else {
2703+
fs.writeFileSync(deppath, stdout);
2704+
resolve();
27042705
}
2705-
}
2706-
};
2707-
} catch (error) {
2708-
GlobalEvent.emit('globalLog', ExceptionToMessage(error, 'Warning'));
2709-
}
2706+
});
2707+
});
2708+
};
27102709
}
27112710
}
2711+
} catch (error) {
2712+
GlobalEvent.emit('globalLog', ExceptionToMessage(error, 'Warning'));
2713+
}
27122714

2713-
const toolName = toolchain_ || this.getToolchain().name;
2715+
const toolName = toolchain_ || this.getToolchain().name;
27142716

2715-
const outFolder = this.getOutputFolder();
2716-
const refListFile = File.fromArray([outFolder.path, 'ref.json']);
2717+
const outFolder = this.getOutputFolder();
2718+
const refListFile = File.fromArray([outFolder.path, 'ref.json']);
27172719

2718-
if (!refListFile.IsFile()) {
2719-
resolve(false);
2720-
return; /* no refs list file, exit */
2721-
}
2720+
if (!refListFile.IsFile()) {
2721+
return; /* no refs list file, exit */
2722+
}
27222723

2723-
try {
2724-
const refMap = JSON.parse(refListFile.Read());
2725-
for (const srcpath in refMap) {
2726-
const refFile = new File((<string>refMap[srcpath]).replace(/\.[^\\\/\.]+$/, '.d'));
2727-
if (generate_dep_file) generate_dep_file(compiler_cmd_db, srcpath, refFile.path);
2728-
if (!refFile.IsFile()) continue;
2729-
const refs = this.parseRefFile(refFile, toolName).filter(p => p != srcpath);
2730-
this.srcRefMap.set(srcpath, refs.map((path) => new File(path)));
2731-
}
2732-
} catch (error) {
2733-
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
2724+
try {
2725+
const refMap = JSON.parse(refListFile.Read());
2726+
for (const srcpath in refMap) {
2727+
const refFile = new File((<string>refMap[srcpath]).replace(/\.[^\\\/\.]+$/, '.d'));
2728+
if (generate_dep_file) await generate_dep_file(compiler_cmd_db, srcpath, refFile.path);
2729+
if (!refFile.IsFile()) continue;
2730+
const refs = this.parseRefFile(refFile, toolName).filter(p => p != srcpath);
2731+
this.srcRefMap.set(srcpath, refs.map((path) => new File(path)));
27342732
}
2733+
} catch (error) {
2734+
GlobalEvent.emit('globalLog', ExceptionToMessage(error, 'Warning'));
2735+
}
27352736

2736-
// notify update src view
2737-
this.emit('dataChanged', 'files');
2738-
2739-
resolve(true);
2740-
});
2737+
// notify update src view
2738+
this.emit('dataChanged', 'files');
27412739
}
27422740

27432741
public getSourceRefs(file: File): File[] {

src/Makefile.ts

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)