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

Adding the automatic sideloading script #4676

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
36 changes: 36 additions & 0 deletions scripts/execute-vscode-sideload.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
param (
[string]
[Parameter(Mandatory = $false)]
$Platform = "win-x64",
[switch]
$WSL
)


Push-Location ./vscode/microsoft-kiota

# Install all dependencies
npm i

# Package the VS Code extension
npx @vscode/vsce package

# Getting package for its version
$PackageJson = Get-Content "package.json" -Raw | ConvertFrom-Json

# Install the extension
code --install-extension "./kiota-$($PackageJson.version).vsix"

$VsCodeRootPath = "~/.vscode"

if ($WSL) {
$Platform = "linux-x64"
$VsCodeRootPath = "~/.vscode-server"
}

$KiotaBin = "$VsCodeRootPath/extensions/ms-graph.kiota-$($PackageJson.version)/.kiotabin/$($PackageJson.kiotaVersion)/$Platform"

Pop-Location

# Building Kiota
dotnet publish ./src/kiota/kiota.csproj -p:PublishSingleFile=true -p:PublishReadyToRun=true --self-contained -c Release -r $platform -o $KiotaBin
14 changes: 14 additions & 0 deletions vscode/microsoft-kiota/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@ Where kiotaVersionInPackage is the kiotaVersion field and versionInPackage is th

> Note: alternatively to building executable yourself, you can download it from [the pipeline](https://github.com/microsoft/kiota/actions/workflows/dotnet.yml) by filtering the branch (top right corner) with the pull request branch, selecting the latest run, and downloading the right OS version from the artifacts. The only remaining work will be to move the downloaded files to the right path above.

#### Using the ready-made script

If you want to automate these steps, you can use the following script to automate the process:

```powershell
.\scripts\execute-vscode-sideload.ps1 -Platform "win-x64|linux-x64|osx-x64"
```

If you are using WSL, you can use the following:

```powershell
.\scripts\execute-vscode-sideload.ps1 -WSL
```

## FAQ

### VS Code keeps reinstalling from the marketplace
Expand Down
Loading