Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
github0null committed May 16, 2022
1 parent 8c8dae9 commit 22591d2
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 35 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@

***

### [v3.6.4]

**Fixed**:
- Can not throw exception when extension can not get an available binaries version.
- Can not switch to rebuild mode after user changed global builder options.

**Changed**:
- Allow mult-thread build for `Keil_C51` project.

***

### [v3.6.3]

**Fixed**:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"homepage": "https://github.com/github0null/eide/blob/master/README.md",
"license": "MIT",
"description": "A mcu development environment for 8051/AVR/STM8/Cortex-M/RISC-V",
"version": "3.6.3",
"version": "3.6.4",
"preview": false,
"engines": {
"vscode": "^1.63.0"
Expand Down
72 changes: 39 additions & 33 deletions src/CodeBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,29 +378,15 @@ export abstract class CodeBuilder {
const oldParamsPath = `${paramsPath}.old`;
const prevParams: BuilderParams | undefined = File.IsFile(oldParamsPath) ? JSON.parse(fs.readFileSync(oldParamsPath, 'utf8')) : undefined;
const sourceInfo = this.genSourceInfo(prevParams);

// set build mode
const builderModeList: string[] = [];

if (config.toolchain === 'Keil_C51') {
// disable increment compile for Keil C51
builderModeList.push('Normal');
} else {
builderModeList.push(this.isRebuild() ? 'Normal' : 'Fast');
if (settingManager.isUseMultithreadMode()) { builderModeList.push('MULTHREAD'); }
}

if (this.useShowParamsMode) {
builderModeList.push('Debug');
}
const builderModeList: string[] = []; // build mode

const builderOptions: BuilderParams = {
name: config.name,
target: this.project.getCurrentTarget(),
toolchain: toolchain.name,
toolchainLocation: toolchain.getToolchainDir().path,
toolchainCfgFile: toolchain.modelName,
buildMode: builderModeList.map(str => str.toLowerCase()).join('|'),
buildMode: 'fast|multhread',
showRepathOnLog: settingManager.isPrintRelativePathWhenBuild(),
threadNum: settingManager.getThreadNumber(),
rootDir: this.project.GetRootDir().path,
Expand Down Expand Up @@ -445,28 +431,48 @@ export abstract class CodeBuilder {
// generate hash for compiler options
builderOptions.sha = this.genHashFromCompilerOptions(builderOptions);

// check whether need rebuild project
if (this.isRebuild() == false && prevParams) {
try {
// not found hash from old params file
if (prevParams.sha == undefined) {
this.enableRebuild();
}
// set build mode
{
// check whether need rebuild project
if (this.isRebuild() == false && prevParams) {
try {
// not found hash from old params file
if (prevParams.sha == undefined) {
this.enableRebuild();
}

// check hash obj by specifies keys
else {
const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
for (const key of keyList) {
if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
this.enableRebuild();
break;
// check hash obj by specifies keys
else {
const keyList = ['global', 'c/cpp-defines', 'c/cpp-compiler', 'asm-compiler'];
for (const key of keyList) {
if (!this.compareHashObj(key, prevParams.sha, builderOptions.sha)) {
this.enableRebuild();
break;
}
}
}
} catch (error) {
this.enableRebuild(); // make rebuild
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
}
} catch (error) {
this.enableRebuild(); // make rebuild
GlobalEvent.emit('msg', ExceptionToMessage(error, 'Hidden'));
}

if (config.toolchain === 'Keil_C51') { // disable increment compile for Keil C51
builderModeList.push('normal');
} else {
builderModeList.push(this.isRebuild() ? 'normal' : 'fast');
}

if (settingManager.isUseMultithreadMode()) {
builderModeList.push('multhread');
}

if (this.useShowParamsMode) {
builderModeList.push('debug');
}

// set build mode
builderOptions.buildMode = builderModeList.map(str => str.toLowerCase()).join('|');
}

// write project build params
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm?
}
} else { // binaries is not installed
if (preinstallVersion == undefined) {
throw new Error(`Can not fetch binaries version from remote github repo, Check your network and retry !`);
const err = new Error(`Can not fetch binaries version from remote github repo (binaries minimum version required: '${minReqVersion}'), Check your network and retry !`);
GlobalEvent.emit('error', err);
return false;
}
}

Expand Down

0 comments on commit 22591d2

Please sign in to comment.