Skip to content

Commit

Permalink
WIP: Feature: Add dependsDot command
Browse files Browse the repository at this point in the history
  • Loading branch information
deribaucourt committed Jan 8, 2025
1 parent e057aeb commit c1807a6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
26 changes: 26 additions & 0 deletions client/src/ui/BitbakeCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export function registerBitbakeCommands (context: vscode.ExtensionContext, bitba
vscode.commands.registerCommand('bitbake.stop-toaster', async () => { await stopToaster(bitBakeProjectScanner.bitbakeDriver) }),
vscode.commands.registerCommand('bitbake.clear-workspace-state', async () => { await clearAllWorkspaceState(context) }),
vscode.commands.registerCommand('bitbake.examine-dependency-taskexp', async (uri) => { await examineDependenciesTaskexp(bitbakeWorkspace, bitBakeProjectScanner, uri) }),
// Repurpose to be per recipe? (and ask for image if not already supplied)
vscode.commands.registerCommand('bitbake.oe-depends-dot', async (uri) => { await runOeDependsDot(bitbakeWorkspace, bitBakeProjectScanner, uri) }),
// Handles enqueued parsing requests (onSave)
vscode.tasks.onDidEndTask((e) => {
if (e.execution.task.name === 'Bitbake: Parse') {
Expand Down Expand Up @@ -588,6 +590,30 @@ export async function examineDependenciesTaskexp (bitbakeWorkspace: BitbakeWorks
}
}

export async function runOeDependsDot (bitbakeWorkspace: BitbakeWorkspace, bitBakeProjectScanner: BitBakeProjectScanner, uri?: unknown): Promise<void> {
if (isTaskexpStarted) {
void vscode.window.showInformationMessage('taskexp is already started')
return
}
const chosenImage = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
const chosenRecipe = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
if (chosenImage !== undefined && chosenRecipe !== undefined) {
logger.debug(`Command: oe-depends-dot: ${chosenRecipe}`)
isTaskexpStarted = true
const process = await runBitbakeTerminal(bitBakeProjectScanner.bitbakeDriver,
{
specialCommand: `bitbake -g ${chosenRecipe} -u taskexp`
} as BitbakeTaskDefinition,
`Bitbake: taskexp: ${chosenRecipe}`)
process.onExit((e) => {
isTaskexpStarted = false
if (e.exitCode !== 0) {
void vscode.window.showErrorMessage(`Failed to start taskexp with exit code ${e.exitCode}. See terminal output.`)
}
})
}
}

async function openBitbakeDevshell (terminalProvider: BitbakeTerminalProfileProvider, bitbakeWorkspace: BitbakeWorkspace, bitBakeProjectScanner: BitBakeProjectScanner, uri?: unknown): Promise<vscode.Terminal | undefined> {
const chosenRecipe = await selectRecipe(bitbakeWorkspace, bitBakeProjectScanner, uri)
if (chosenRecipe === undefined) return
Expand Down
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@
"title": "BitBake: Examine recipe's dependencies with taskexp",
"description": "Examine the recipe's dependencies with taskexp."
},
{
"command": "bitbake.oe-depends-dot",
"title": "BitBake: Generate a dependency graph with oe-depends-dot",
"description": "Generate a dependency graph with oe-depends-dot"
},
{
"command": "bitbake.devtool-modify",
"title": "BitBake: Devtool: Modify recipe",
Expand Down Expand Up @@ -625,6 +630,10 @@
"command": "bitbake.examine-dependency-taskexp",
"group": "1@bitbake_dev@5"
},
{
"command": "bitbake.oe-depends-dot",
"group": "1@bitbake_dev@6"
},
{
"command": "bitbake.devtool-modify",
"group": "2@bitbake_devtool@0"
Expand Down Expand Up @@ -817,6 +826,11 @@
"group": "1@bitbake_dev@4",
"when": "viewItem == bitbakeRecipeCtx"
},
{
"command": "bitbake.oe-depends-dot",
"group": "1@bitbake_dev@5",
"when": "viewItem == bitbakeRecipeCtx"
},
{
"command": "bitbake.devtool-modify",
"group": "2@bitbake_devtool@0",
Expand Down

0 comments on commit c1807a6

Please sign in to comment.