@@ -33,34 +33,19 @@ task RestoreNodeOptional -If { !(Test-Path ./node_modules/eslint) } {
33
33
}
34
34
35
35
task RestoreEditorServices - If (Get-EditorServicesPath ) {
36
- switch ($Configuration ) {
37
- " Debug" {
38
- # When debugging, we always rebuild PSES and ensure its symlinked so
39
- # that developers always have the latest local bits.
40
- if ((Get-Item ./ modules - ErrorAction SilentlyContinue).LinkType -ne " SymbolicLink" ) {
41
- Write-Build DarkMagenta " Creating symbolic link to PSES"
42
- Remove-BuildItem ./ modules
43
- New-Item - ItemType SymbolicLink - Path ./ modules - Target " $ ( Split-Path (Get-EditorServicesPath )) /module"
44
- }
45
-
46
- Write-Build DarkGreen " Building PSES"
47
- Invoke-Build Build (Get-EditorServicesPath ) - Configuration $Configuration
48
- }
49
- " Release" {
50
- # With VSCE --follow-symlinks support, we can now use symlinks in Release mode too.
51
- # Create symlink if it doesn't exist, ensuring it points to the correct location.
52
- if ((Get-Item ./ modules - ErrorAction SilentlyContinue).LinkType -ne " SymbolicLink" ) {
53
- Write-Build DarkMagenta " Creating symbolic link to PSES"
54
- Remove-BuildItem ./ modules
55
- New-Item - ItemType SymbolicLink - Path ./ modules - Target " $ ( Split-Path (Get-EditorServicesPath )) /module"
56
- }
57
-
58
- # Only build if it hasn't been built at all.
59
- if (! (Test-Path " $ ( Split-Path (Get-EditorServicesPath )) /module/PowerShellEditorServices/bin" )) {
60
- Write-Build DarkGreen " Building PSES"
61
- Invoke-Build Build (Get-EditorServicesPath ) - Configuration $Configuration
62
- }
63
- }
36
+ # With VSCE --follow-symlinks support, we can now use symlinks consistently
37
+ # for both Debug and Release configurations.
38
+ if ((Get-Item ./ modules - ErrorAction SilentlyContinue).LinkType -ne " SymbolicLink" ) {
39
+ Write-Build DarkMagenta " Creating symbolic link to PSES"
40
+ Remove-BuildItem ./ modules
41
+ New-Item - ItemType SymbolicLink - Path ./ modules - Target " $ ( Split-Path (Get-EditorServicesPath )) /module"
42
+ }
43
+
44
+ # For Debug configuration, always rebuild to ensure latest local bits.
45
+ # For Release configuration, only build if it hasn't been built at all.
46
+ if ($Configuration -eq " Debug" -or ! (Test-Path " $ ( Split-Path (Get-EditorServicesPath )) /module/PowerShellEditorServices/bin" )) {
47
+ Write-Build DarkGreen " Building PSES"
48
+ Invoke-Build Build (Get-EditorServicesPath ) - Configuration $Configuration
64
49
}
65
50
}
66
51
@@ -127,9 +112,7 @@ task Package {
127
112
New-Item - ItemType Directory - Force out | Out-Null
128
113
129
114
Assert-Build (Test-Path ./ dist/ extension.js) " Extension must be built!"
130
-
131
- # With --follow-symlinks flag, VSCE can now package symbolic links directly,
132
- # so we no longer need to convert symlinks to copies.
115
+ Assert-Build (Test-Path ./ modules/ PowerShellEditorServices/ bin) " PowerShell Editor Services must be built under modules!"
133
116
134
117
if ($version.Minor % 2 -ne 0 ) {
135
118
Write-Build DarkRed " This is a pre-release!"
0 commit comments