vknabel / vscode-swift-development-environment

New home of Swift Development Environment for VS Code
https://marketplace.visualstudio.com/items?itemName=vknabel.vscode-swift-development-environment
Apache License 2.0
175 stars 14 forks source link

FAQ about other build paths than .build #80

Closed fappelman closed 3 years ago

fappelman commented 3 years ago

When I start using the package the server fails with the message that a given directory is not found. The error message shows that the path is expected to be in the .build directory.

I don't have the .build directory, instead I have .build-macos and .build-linux. This allows me to compile and run code side by side on macOS and on Linux without them interfering with each other. (I have a docker environment that mounts that same directory)

For now I have fixed this with creating a symlink but I would prefer to configure this in the package. Is it possible to add such configuration option which can default to .build?

haifengkao commented 3 years ago

I think .build is generated by swift package manager. how do you get spm to generate .build-macos and .build-linux? My spm generates macos codes to .build/x86_64-apple-macosx, not .build-macos

fappelman commented 3 years ago

By providing the --build-path parameter to swift build:

swift build --build-path "./.build-macos"
vknabel commented 3 years ago

@fappelman thanks for opening an issue and for clarification. I guess your VS Code config includes "sde.swiftBuildingParams": ["build", "--build-path", "./.build-macos"], right? In that case we could detect the building parameter of the params.

@haifengkao thanks for your great support! Would you like to have a look on this? I'd be happy to help you getting started if you have any questions.

fappelman commented 3 years ago

@vknabel As it turns out your question makes this request obsolete. I did not have those building parameters (for compilation I just used make build). After I added them, the errors are gone. So please consider this the solution :-)

vknabel commented 3 years ago

Hi @fappelman!

Nice to hear! Would be a great question for the FAQ section. Might take a while until I have the to time add it. But I guess it isn't urgent for now.

fappelman commented 3 years ago

Good idea indeed.

vknabel commented 3 years ago

Added to the README