-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
68 lines (53 loc) · 1.7 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
#!/usr/bin/env powershell -File
$VSCodeRepo = 'https://github.com/microsoft/vscode'
$VSCodeVersion = '1.69.2'
$ErrorActionPreference = "Stop"
function Clear-VeEnvironment {
if (Test-Path ./vscode) {
Remove-Item -Recurse -Force ./vscode
Write-Output Cleaning up vscode repository.
}
if (Test-Path ./build) {
Remove-Item -Recurse -Force ./build
Write-Output Cleaning up build folder.
}
}
function Get-VeVSCodeRepository {
git clone -b $VSCodeVersion --depth=1 $VSCodeRepo ./vscode
Push-Location ./vscode
yarn install
Pop-Location
Push-Location ./extensions
yarn install
Pop-Location
}
function Build-VeEditor {
if (Test-Path ./vscode-web) {
Remove-Item -Recurse -Force ./vscode-web
}
# Build our extensions first to avoid problems.
Push-Location ./extensions
yarn workspaces run package-web
Pop-Location
Push-Location ./vscode
git reset --hard
# remove untracked files
git clean -fd
Get-ChildItem -Path ../patches | ForEach-Object { git apply $_.FullName }
foreach ($dir in (Get-ChildItem -Path ../extensions)) {
if (!$dir.Attributes.HasFlag([System.IO.FileAttributes]::Directory)) {
continue
}
if ($dir.Name -eq 'node_modules') {
continue
}
New-Item -ItemType SymbolicLink -Path ./extensions/$($dir.Name) -Value $($dir.FullName)
# Copy-Item -Recurse -Destination "./extensions/" "$($dir.FullName)"
}
yarn gulp vscode-web-min
Pop-Location
if (Test-Path ./public) {
Remove-Item -Recurse -Force ./public
}
Copy-Item -Path ./shadow/* -Destination ./vscode-web/ -Recurse
}