Skip to content

Commit

Permalink
Merge pull request #4676 from sebastienlevert/sebastienlevert/sideloa…
Browse files Browse the repository at this point in the history
…ding-script

Adding the automatic sideloading script
  • Loading branch information
baywet authored May 23, 2024
2 parents bc03997 + 1fce6c8 commit a45c61d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
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

0 comments on commit a45c61d

Please sign in to comment.