Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❇️ buildKit api #979

Merged
merged 3 commits into from
Dec 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"onCommand:cmake.launchTargetDirectory",
"onCommand:cmake.buildType",
"onCommand:cmake.buildDirectory",
"onCommand:cmake.buildKit",
"onCommand:cmake.tasksBuildCommand",
"onCommand:cmake.quickStart",
"onCommand:cmake.resetState",
Expand Down Expand Up @@ -1118,4 +1119,4 @@
"handlebars": "^4.5.3",
"https-proxy-agent": "^2.2.4"
}
}
}
5 changes: 5 additions & 0 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,4 +303,9 @@ export interface CMakeToolsAPI extends Disposable {
* Get the build command string for the active target
*/
tasksBuildCommand(): Thenable<string|null>;

/**
* Get the build kit
*/
buildKit(): Thenable<string|null>;
}
11 changes: 11 additions & 0 deletions src/cmake-tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,17 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
}
}

/**
* Implementation of `cmake.buildKit`
*/
async buildKit(): Promise<string|null> {
if (this.activeKit) {
return this.activeKit.name;
} else {
return null;
}
}

async prepareLaunchTargetExecutable(name?: string): Promise<api.ExecutableTarget|null> {
let chosen: api.ExecutableTarget;
if (name) {
Expand Down
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1166,6 +1166,8 @@ class ExtensionManager implements vscode.Disposable {

buildDirectory() { return this.withCMakeTools(null, cmt => cmt.buildDirectory()); }

buildKit() {return this.withCMakeTools(null, cmt => cmt.buildKit()); }

tasksBuildCommand() { return this.withCMakeTools(null, cmt => cmt.tasksBuildCommand()); }

debugTarget(name?: string) { return this.withCMakeTools(null, cmt => cmt.debugTarget(name)); }
Expand Down Expand Up @@ -1249,6 +1251,7 @@ async function setup(context: vscode.ExtensionContext, progress: ProgressHandle)
'launchTargetDirectory',
'buildType',
'buildDirectory',
'buildKit',
'debugTarget',
'launchTarget',
'selectLaunchTarget',
Expand Down