vscode-dotnet-runtime/build.ps1

84 строки
2.2 KiB
PowerShell
Исходник Постоянная ссылка Обычный вид История

$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 ####################
pushd vscode-dotnet-runtime-library
2019-07-31 02:32:24 +03:00
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
2019-05-08 06:30:20 +03:00
npm run compile
if (! $?)
{
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 ####################
pushd vscode-dotnet-runtime-extension
2019-07-31 02:32:24 +03:00
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
2019-05-08 06:30:20 +03:00
npm run compile
if (! $?)
{
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 }
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 }
npm ci
2019-05-08 06:30:20 +03:00
npm run compile
if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
2019-05-08 06:30:20 +03:00
exit 1
}
popd
#################### Copy Library Artifacts ####################
& "$(Split-Path $MyInvocation.MyCommand.Path)/mock-webpack.ps1"
Write-Host "Build Succeeded" -ForegroundColor $successColor