Skip to content

Commit ae1ad20

Browse files
committed
fixed #16: ERROR: Only one copy of bitbake should be run against a build directory
1 parent 5e76c02 commit ae1ad20

File tree

5 files changed

+21
-18
lines changed

5 files changed

+21
-18
lines changed

client/out/src/extension.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"type": "object",
5454
"title": "Language Server for Bitbake configuration",
5555
"properties": {
56-
"languageServerBitbake.loggingLevel": {
56+
"vscode_bitbake.loggingLevel": {
5757
"type": "string",
5858
"enum": [
5959
"error",
@@ -63,17 +63,17 @@
6363
"default": "error",
6464
"description": "Adjust the logging level. error: only errors; info: only information that is useful for the user; debug: the same like info, but with additional debug informations"
6565
},
66-
"languageServerBitbake.deepExamine": {
66+
"vscode_bitbake.deepExamine": {
6767
"type": "boolean",
6868
"default": false,
6969
"description": "Activates an deeply examine. If a recipe export an extra package that have not the same name like the recipe file the normal scan will not find this packages. If you like to find the packages you have to activate this option."
7070
},
71-
"languageServerBitbake.workingFolder": {
71+
"vscode_bitbake.workingFolder": {
7272
"type": "string",
7373
"default": "vscode-bitbake-build",
7474
"description": "Use this setting to specify the build folder. Use other folder than for your regular 'build' to avoid collisions."
7575
},
76-
"languageServerBitbake.pathToBashScriptInterpreter": {
76+
"vscode_bitbake.pathToBashScriptInterpreter": {
7777
"type": "string",
7878
"default": "/bin/bash",
7979
"description": "This interpreter is used to run bash scripts"

client/src/extension.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function activate(context: ExtensionContext) {
2828
// TODO: check new documentSelector
2929
documentSelector: [{scheme: 'file', language: 'bitbake'}],
3030
synchronize: {
31-
configurationSection: 'languageServerBitbake',
31+
configurationSection: 'vscode_bitbake',
3232

3333
// Notify the server about file changes to '.clientrc files contain in the workspace
3434
fileEvents: [
@@ -41,7 +41,7 @@ export function activate(context: ExtensionContext) {
4141
}
4242

4343
// Create the language client and start the client.
44-
let disposable = new LanguageClient('languageServerBitbake', 'Language Server Bitbake', serverOptions, clientOptions).start();
44+
let disposable = new LanguageClient('vscode_bitbake', 'Language Server Bitbake', serverOptions, clientOptions).start();
4545

4646
// Push the disposable to the context's subscriptions so that the
4747
// client can be deactivated on extension deactivation

server/src/BitBakeProjectScanner.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export class BitBakeProjectScanner {
3737
private _includes: ElementInfo[] = new Array < ElementInfo > ();
3838
private _recipes: ElementInfo[] = new Array < ElementInfo > ();
3939
private _deepExamine: boolean = false;
40-
private _settingsScriptInterpreter: string;
41-
private _settingsWorkingFolder: string;
40+
private _settingsScriptInterpreter: string = '/bin/bash';
41+
private _settingsWorkingFolder: string = 'vscode-bitbake-build';
4242
private _settingsBitbakeSourceCmd: string = '.';
4343

4444
private _scanStatus: ScannStatus = {
@@ -150,7 +150,9 @@ export class BitBakeProjectScanner {
150150
priority: parseInt(tempElement[2])
151151
};
152152

153-
this._layers.push(layerElement);
153+
if( (layerElement.name !== undefined) && (layerElement.path!==undefined) && layerElement.priority !==undefined ) {
154+
this._layers.push(layerElement);
155+
}
154156
}
155157
} catch (error) {
156158
logger.error(`can not scan available layers error: ${error}`);
@@ -344,8 +346,9 @@ export class BitBakeProjectScanner {
344346

345347
private executeCommandInBitBakeEnvironment(command: string): string {
346348
let scriptContent: string = this.generateBitBakeCommandScriptFileContent(command);
347-
let scriptFileName: string = 'executeBitBakeCmd.sh';
349+
let scriptFileName: string = this._projectPath + '/executeBitBakeCmd.sh';
348350
fs.writeFileSync(scriptFileName, scriptContent );
351+
fs.chmodSync(scriptFileName, '0755');
349352

350353
return this.executeCommand(scriptFileName);
351354
}

server/src/server.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ documents.onDidChangeContent((change) => {
7373

7474
// The settings interface describe the server relevant settings part
7575
interface Settings {
76-
languageServerBitbake: LanguageServerBitbakeSettings;
76+
vscode_bitbake: BitbakeSettings;
7777
}
7878

79-
interface LanguageServerBitbakeSettings {
79+
interface BitbakeSettings {
8080
loggingLevel: string;
8181
deepExamine: boolean;
8282
workingFolder: string;
@@ -91,10 +91,10 @@ function setSymbolScanner( newSymbolScanner: SymbolScanner ) {
9191

9292
connection.onDidChangeConfiguration((change) => {
9393
let settings = < Settings > change.settings;
94-
bitBakeProjectScanner.deepExamine = settings.languageServerBitbake.deepExamine;
95-
logger.level = settings.languageServerBitbake.loggingLevel;
96-
bitBakeProjectScanner.workingPath = settings.languageServerBitbake.workingFolder;
97-
bitBakeProjectScanner.scriptInterpreter = settings.languageServerBitbake.pathToBashScriptInterpreter;
94+
bitBakeProjectScanner.deepExamine = settings.vscode_bitbake.deepExamine;
95+
logger.level = settings.vscode_bitbake.loggingLevel;
96+
bitBakeProjectScanner.workingPath = settings.vscode_bitbake.workingFolder;
97+
bitBakeProjectScanner.scriptInterpreter = settings.vscode_bitbake.pathToBashScriptInterpreter;
9898
});
9999

100100
connection.onDidChangeWatchedFiles((change) => {

0 commit comments

Comments
 (0)