blob: 32fd1c6cf12d2decedea2b91a8e7306572a9bc92 [file]
// Copyright 2024 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as vscode from 'vscode';
/**
* initialize task provider for the extension
*/
export function setUpFuchsiaTaskProvider(context: vscode.ExtensionContext) {
vscode.tasks.registerTaskProvider('fuchsia', {
provideTasks(): vscode.Task[] {
const buildTask = new vscode.Task(
{ type: 'fuchsia' },
vscode.TaskScope.Workspace,
'fx build',
'Fuchsia Extension',
new vscode.ProcessExecution('${command:fuchsia.fx.build}')
);
buildTask.group = vscode.TaskGroup.Build;
return [buildTask];
},
resolveTask(task: vscode.Task): vscode.ProviderResult<vscode.Task> {
return task;
}
});
}