2019-11-06 03:12:01 +03:00
|
|
|
$errorColor = "Red"
|
|
|
|
$successColor = "Green"
|
|
|
|
|
2021-02-09 20:37:28 +03:00
|
|
|
|
|
|
|
#################### Download backup install scripts ####################
|
2020-05-13 22:58:12 +03:00
|
|
|
function DownloadInstallScripts() {
|
|
|
|
Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile "./vscode-dotnet-runtime-library/install scripts/dotnet-install.ps1"
|
|
|
|
Invoke-WebRequest https://dot.net/v1/dotnet-install.sh -OutFile "./vscode-dotnet-runtime-library/install scripts/dotnet-install.sh"
|
|
|
|
}
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
DownloadInstallScripts
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
|
|
|
$exceptionMessage = $_.Exception.Message
|
|
|
|
Write-Host "Failed to install scripts, retrying: $exceptionMessage"
|
|
|
|
DownloadInstallScripts
|
|
|
|
}
|
2020-05-12 01:24:18 +03:00
|
|
|
if ($?) {
|
|
|
|
Write-Host "`nBundled dotnet-install scripts" -ForegroundColor $successColor
|
|
|
|
} else {
|
|
|
|
Write-Host "`nFailed to bundle dotnet-install scripts" -ForegroundColor $errorColor
|
|
|
|
}
|
2020-05-13 22:58:12 +03:00
|
|
|
icacls "./vscode-dotnet-runtime-library/install scripts/dotnet-install.ps1" /grant:r "users:(RX)" /C
|
|
|
|
icacls "./vscode-dotnet-runtime-library/install scripts/dotnet-install.sh" /grant:r "users:(RX)" /C
|
2020-05-12 01:24:18 +03:00
|
|
|
|
2021-02-09 20:37:28 +03:00
|
|
|
#################### Compile library ####################
|
2020-01-25 01:12:14 +03:00
|
|
|
pushd vscode-dotnet-runtime-library
|
2019-07-31 02:32:24 +03:00
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
2022-07-16 01:02:26 +03:00
|
|
|
npm ci
|
2019-05-08 06:30:20 +03:00
|
|
|
npm run compile
|
|
|
|
|
|
|
|
if (! $?)
|
|
|
|
{
|
2019-11-06 03:12:01 +03:00
|
|
|
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
|
2019-05-08 06:30:20 +03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
popd
|
|
|
|
|
2021-02-09 20:37:28 +03:00
|
|
|
#################### Compile runtime extension ####################
|
2020-01-25 01:12:14 +03:00
|
|
|
pushd vscode-dotnet-runtime-extension
|
2019-07-31 02:32:24 +03:00
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
2022-07-16 01:02:26 +03:00
|
|
|
npm ci
|
2019-05-08 06:30:20 +03:00
|
|
|
npm run compile
|
|
|
|
|
|
|
|
if (! $?)
|
|
|
|
{
|
2019-11-06 03:12:01 +03:00
|
|
|
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
|
2019-05-08 06:30:20 +03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
popd
|
|
|
|
|
2021-02-09 20:37:28 +03:00
|
|
|
#################### Compile SDK extension ####################
|
|
|
|
pushd vscode-dotnet-sdk-extension
|
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
2022-07-16 01:02:26 +03:00
|
|
|
npm ci
|
2021-02-09 20:37:28 +03:00
|
|
|
npm run compile
|
|
|
|
|
|
|
|
if (! $?)
|
|
|
|
{
|
|
|
|
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
popd
|
|
|
|
|
|
|
|
#################### Compile sample extension ####################
|
2019-05-08 06:30:20 +03:00
|
|
|
pushd sample
|
2019-07-31 02:32:24 +03:00
|
|
|
if (Test-Path node_modules) { rm -r -force node_modules }
|
2022-07-16 01:02:26 +03:00
|
|
|
npm ci
|
2019-05-08 06:30:20 +03:00
|
|
|
npm run compile
|
|
|
|
|
|
|
|
if (! $?)
|
|
|
|
{
|
2019-11-06 03:12:01 +03:00
|
|
|
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
|
2019-05-08 06:30:20 +03:00
|
|
|
exit 1
|
|
|
|
}
|
2019-11-06 03:12:01 +03:00
|
|
|
popd
|
|
|
|
|
2023-08-07 23:54:36 +03:00
|
|
|
#################### Copy Library Artifacts ####################
|
2023-08-11 02:47:45 +03:00
|
|
|
& "$(Split-Path $MyInvocation.MyCommand.Path)/mock-webpack.ps1"
|
2023-08-07 23:54:36 +03:00
|
|
|
|
2019-11-06 03:12:01 +03:00
|
|
|
Write-Host "Build Succeeded" -ForegroundColor $successColor
|