tintoy / msbuild-project-tools-vscode

VS Code extension for MSBuild intellisense (including PackageReference completion).
MIT License
82 stars 16 forks source link

Publish language server when building vsix #131

Closed DoctorKrolic closed 8 months ago

DoctorKrolic commented 8 months ago

Fixes: https://github.com/tintoy/msbuild-project-tools-vscode/issues/126

Now whenever vsce package is run language server is gonna be built in release mode. This script also parses semantic version information from the git. Let's say previous commit was tagged v0.5.0-pre1. When building with --dev flag produced version prefix is 0.5.0, suffix is pre1-dev, resulting version 0.5.0-pre1-dev and file version 0.5.0.1 (1 represents number of commits from the previous tag). If building without --dev flag the version is just 0.5.0-pre1 without an additional dev suffix. This eliminates the need of having 2 build scripts which require passing version information manually, so I removed them. Now when you doing a release your algorithm is:

  1. Add a git tag to the latest commit
  2. Run vsce package

And that is it. The resulting vsix will contain langusge server built in release mode with correct version metadata in place

tintoy commented 8 months ago

(thanks!)

DoctorKrolic commented 8 months ago

It is hard to use external version sources other than git tags since I cannot think of an easy way to pass command line arguments to the publish script during prepublish stage. This PR reduces human error impact by forcing a release build when building vsix, but it doesn't fully eliminate it since the person still needs to update version in package.json and create a git tag. The other possible way of handling this is by separating extension client form the language server entirely and download langusge server bits on demand during the first time usage (official C# extension does that for instance), but I don't think it provides that much value for us

tintoy commented 8 months ago

I think GitVersion is available as a .net cli tool (i.e. dotnet tool install GitVersion or similar)…

tintoy commented 8 months ago

https://github.com/tintoy/dotnet-kube-client/blob/develop/.travis.yml

https://github.com/tintoy/dotnet-kube-client/blob/develop/GitVersion.yml

https://github.com/tintoy/dotnet-kube-client/blob/117c4f8f69e124dfe62c077a0d30de67e6cbc943/build-ci.sh#L25