Closed xedin closed 2 weeks ago
Tasks: Run Task
will show you a list of recently run tasks, and a list of extensions contributing tasks. swift
should be in that list. Click on it and it will list all the build tasks. Alternatively use Tasks: Run Build Task
(Ctrl/Cmd+Shift+B) to get a list of build tasks regardless of whether they have been run.
I see, When I tried to add swift build task it created a new tasks.json file. I guess the only problem here is related to CMake build that happens automatically and results in failures as soon as workspace is opened.
You shouldn't need to add a tasks.json
unless you are doing something out of the ordinary. The Swift extension will provide tasks to build debug or release versions of every target. You should be able to see this list with Cmd + Shift + B. These are only available though once the initial project load and resolve has finished.
The UI there might be confusing then because if that action is already available why even add tasks.json?
As I said in the previous comment you don't need to as the extension generates the build tasks for you.
I am simply trying to explain what happens, I didn’t direct it to create that file, it just does probably because cmake configuration shadows one from package manager, I don’t know.
Sorry I misunderstood. When you say "I tried to add swift build task", what did you do exactly?
You shouldn't need to add a build task. They are generated for you. And you use Tasks: Run Build Task
to access the list of build tasks. If you click on the cog at the right hand side of the menu it will create a tasks.json but you should not need to do that. You can just select the tasks and it'll run.
FWIW you are able to hit the configure (gear) button for the list of provided task presented when running the Tasks: Run Task
command which will place the current configuration in the tasks.json and you can modify from there. So you are able to add and modify build task configurations. @xedin is that how you were trying to add a build task or were you going through some different steps?
closing as we've had no response
Describe the bug
Attempting to open SwiftPM project in VSCode with both CMake and Swift extensions installed means that the project cannot be built.
To Reproduce Steps to reproduce the behavior:
git@github.com:apple/swift-package-manager.git
Tasks: Run Task
Resolve Dependencies
Build
comes from cmake extension and pressing it results in failuresExpected behavior
Package manager configuration is preferred over CMake and tasks to build the project are generated correctly after first open.
Environment