Skip to content

Commit 8d31050

Browse files
authored
Merge pull request #133 from github0null/dev
v3.6.4 update
2 parents af7ef08 + 22591d2 commit 8d31050

File tree

4 files changed

+54
-35
lines changed

4 files changed

+54
-35
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
***
66

7+
### [v3.6.4]
8+
9+
**Fixed**:
10+
- Can not throw exception when extension can not get an available binaries version.
11+
- Can not switch to rebuild mode after user changed global builder options.
12+
13+
**Changed**:
14+
- Allow mult-thread build for `Keil_C51` project.
15+
16+
***
17+
718
### [v3.6.3]
819

920
**Fixed**:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"homepage": "https://github.com/github0null/eide/blob/master/README.md",
3333
"license": "MIT",
3434
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
35-
"version": "3.6.3",
35+
"version": "3.6.4",
3636
"preview": false,
3737
"engines": {
3838
"vscode": "^1.63.0"

src/CodeBuilder.ts

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -378,29 +378,15 @@ export abstract class CodeBuilder {
378378
const oldParamsPath = `${paramsPath}.old`;
379379
const prevParams: BuilderParams | undefined = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : undefined;
380380
const sourceInfo = this.genSourceInfo(prevParams);
381-
382-
// set build mode
383-
const builderModeList: string[] = [];
384-
385-
if (config.toolchain === 'Keil_C51') {
386-
// disable increment compile for Keil C51
387-
builderModeList.push('Normal');
388-
} else {
389-
builderModeList.push(this.isRebuild() ? 'Normal' : 'Fast');
390-
if (settingManager.isUseMultithreadMode()) { builderModeList.push('MULTHREAD'); }
391-
}
392-
393-
if (this.useShowParamsMode) {
394-
builderModeList.push('Debug');
395-
}
381+
const builderModeList: string[] = []; // build mode
396382

397383
const builderOptions: BuilderParams = {
398384
name: config.name,
399385
target: this.project.getCurrentTarget(),
400386
toolchain: toolchain.name,
401387
toolchainLocation: toolchain.getToolchainDir().path,
402388
toolchainCfgFile: toolchain.modelName,
403-
buildMode: builderModeList.map(str => str.toLowerCase()).join('|'),
389+
buildMode: 'fast|multhread',
404390
showRepathOnLog: settingManager.isPrintRelativePathWhenBuild(),
405391
threadNum: settingManager.getThreadNumber(),
406392
rootDir: this.project.GetRootDir().path,
@@ -445,28 +431,48 @@ export abstract class CodeBuilder {
445431
// generate hash for compiler options
446432
builderOptions.sha = this.genHashFromCompilerOptions(builderOptions);
447433

448-
// check whether need rebuild project
449-
if (this.isRebuild() == false && prevParams) {
450-
try {
451-
// not found hash from old params file
452-
if (prevParams.sha == undefined) {
453-
this.enableRebuild();
454-
}
434+
// set build mode
435+
{
436+
// check whether need rebuild project
437+
if (this.isRebuild() == false && prevParams) {
438+
try {
439+
// not found hash from old params file
440+
if (prevParams.sha == undefined) {
441+
this.enableRebuild();
442+
}
455443

456-
// check hash obj by specifies keys
457-
else {
458-
const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
459-
for (const key of keyList) {
460-
if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
461-
this.enableRebuild();
462-
break;
444+
// check hash obj by specifies keys
445+
else {
446+
const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
447+
for (const key of keyList) {
448+
if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
449+
this.enableRebuild();
450+
break;
451+
}
463452
}
464453
}
454+
} catch (error) {
455+
this.enableRebuild(); // make rebuild
456+
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
465457
}
466-
} catch (error) {
467-
this.enableRebuild(); // make rebuild
468-
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
469458
}
459+
460+
if (config.toolchain === 'Keil_C51') { // disable increment compile for Keil C51
461+
builderModeList.push('normal');
462+
} else {
463+
builderModeList.push(this.isRebuild() ? 'normal' : 'fast');
464+
}
465+
466+
if (settingManager.isUseMultithreadMode()) {
467+
builderModeList.push('multhread');
468+
}
469+
470+
if (this.useShowParamsMode) {
471+
builderModeList.push('debug');
472+
}
473+
474+
// set build mode
475+
builderOptions.buildMode = builderModeList.map(str => str.toLowerCase()).join('|');
470476
}
471477

472478
// write project build params

src/extension.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,9 @@ async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm?
504504
}
505505
} else { // binaries is not installed
506506
if (preinstallVersion == undefined) {
507-
throw new Error(`Can not fetch binaries version from remote github repo, Check your network and retry !`);
507+
const err = new Error(`Can not fetch binaries version from remote github repo (binaries minimum version required: '${minReqVersion}'), Check your network and retry !`);
508+
GlobalEvent.emit('error', err);
509+
return false;
508510
}
509511
}
510512

0 commit comments

Comments
 (0)