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

Task Provider for Cmake build tasks #1880

Merged
merged 24 commits into from
Jun 25, 2021
Merged

Task Provider for Cmake build tasks #1880

merged 24 commits into from
Jun 25, 2021

Conversation

elahehrashedi
Copy link
Contributor

@elahehrashedi elahehrashedi commented May 17, 2021

feature-request fix: #1656
the defined task:

{
	"label": "CMake: cmake example",
	"type": "cmake",
	"command": "build",
	"group": "build",
	"problemMatcher": "$msCompile",
	"detail": "user defined"
}

Invoke : "Task: Run build Task" and choose the CMake: cmake example task:

a build finished with error (target is chosen from the user defined target)
image

a build finished successfully (here the project was not configured yet and the target is set to all by default)
image

and this is a successful build after changing target:
image

@elahehrashedi elahehrashedi changed the title (Don't check in) Task Provider for Cmake build tasks (Draft) Task Provider for Cmake build tasks May 27, 2021
@elahehrashedi elahehrashedi changed the title (Draft) Task Provider for Cmake build tasks (#2 in order) Task Provider for Cmake build tasks May 29, 2021
@bobbrow bobbrow added this to the 1.8.0 milestone Jun 16, 2021
@elahehrashedi elahehrashedi changed the title (#2 in order) Task Provider for Cmake build tasks Task Provider for Cmake build tasks Jun 18, 2021
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/cmake-tools.ts Outdated Show resolved Hide resolved
src/cmake-tools.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
src/cMakeTaskProvider.ts Outdated Show resolved Hide resolved
}
}
if (this.options?.cwd) {
this.options.cwd = util.resolveVariables(this.options.cwd);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util.resolveVariables

I see you copied this over from cpptools. cmake-tools has it's own resolver. Look at expand.expandStringHelper. To supply the opts, do a FindAllReferences and see what the other functions are doing. There may be a way to make this better in the future (e.g. pass in a driver or extension object and we'll fill it out for you), but that would be for a separate PR.

Copy link
Contributor Author

@elahehrashedi elahehrashedi Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in future we can use expandStringHelper(str, this.cmakeDriver.expansionOptions) to resolve variables other than cwd.

currently vscode resolves cwd in resolveTask.

@elahehrashedi elahehrashedi merged commit b71fb38 into develop Jun 25, 2021
@elahehrashedi elahehrashedi deleted the ella/taskProvider branch June 25, 2021 23:03
@hwmaier
Copy link

hwmaier commented Sep 13, 2021

I just saw this new feature being available in 1.8.0, great addition. It would be nice also to be able to set the "target" in the task definition.

@bobbrow
Copy link
Member

bobbrow commented Sep 13, 2021

We talked about this and kept it "out of scope" for this PR, but I don't think an issue was opened to track it. Thank you for the suggestion. We'll open an issue now.

@bobbrow
Copy link
Member

bobbrow commented Sep 13, 2021

#2122

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor Task Provider
3 participants