forked from dotnet/vscode-dotnet-runtime
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
81 lines (69 loc) · 2.1 KB
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$errorColor = "Red"
$successColor = "Green"
#################### Download backup install scripts ####################
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
}
if ($?) {
Write-Host "`nBundled dotnet-install scripts" -ForegroundColor $successColor
} else {
Write-Host "`nFailed to bundle dotnet-install scripts" -ForegroundColor $errorColor
}
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
#################### Compile library ####################
pushd vscode-dotnet-runtime-library
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
npm run compile
if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
exit 1
}
popd
#################### Compile runtime extension ####################
pushd vscode-dotnet-runtime-extension
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
npm run compile
if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
exit 1
}
popd
#################### Compile SDK extension ####################
pushd vscode-dotnet-sdk-extension
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
npm run compile
if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
exit 1
}
popd
#################### Compile sample extension ####################
pushd sample
if (Test-Path node_modules) { rm -r -force node_modules }
npm ci
npm run compile
if (! $?)
{
Write-Host "`nBuild failed!" -ForegroundColor $errorColor
exit 1
}
popd
Write-Host "Build Succeeded" -ForegroundColor $successColor