-
Notifications
You must be signed in to change notification settings - Fork 514
Build: Use --follow-symlinks in VSCE #5212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,22 +47,18 @@ task RestoreEditorServices -If (Get-EditorServicesPath) { | |
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration | ||
} | ||
"Release" { | ||
# When releasing, we ensure the bits are not symlinked but copied, | ||
# and only if they don't already exist. | ||
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") { | ||
Write-Build DarkRed "Deleting PSES symbolic link" | ||
# With VSCE --follow-symlinks support, we can now use symlinks in Release mode too. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This no longer needs to be split between debug and release configurations since the logic will be shared. @copilot |
||
# Create symlink if it doesn't exist, ensuring it points to the correct location. | ||
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -ne "SymbolicLink") { | ||
Write-Build DarkMagenta "Creating symbolic link to PSES" | ||
Remove-BuildItem ./modules | ||
New-Item -ItemType SymbolicLink -Path ./modules -Target "$(Split-Path (Get-EditorServicesPath))/module" | ||
} | ||
|
||
if (!(Test-Path ./modules)) { | ||
# We only build if it hasn't been built at all. | ||
if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) { | ||
Write-Build DarkGreen "Building PSES" | ||
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration | ||
} | ||
|
||
Write-Build DarkGreen "Copying PSES" | ||
Copy-Item -Recurse -Force "$(Split-Path (Get-EditorServicesPath))/module" ./modules | ||
# Only build if it hasn't been built at all. | ||
if (!(Test-Path "$(Split-Path (Get-EditorServicesPath))/module/PowerShellEditorServices/bin")) { | ||
Write-Build DarkGreen "Building PSES" | ||
Invoke-Build Build (Get-EditorServicesPath) -Configuration $Configuration | ||
} | ||
} | ||
} | ||
|
@@ -132,14 +128,8 @@ task Package { | |
|
||
Assert-Build (Test-Path ./dist/extension.js) "Extension must be built!" | ||
|
||
# Packaging requires a copy of the modules folder, not a symbolic link. But | ||
# we might have built in Debug configuration, not Release, and still want to | ||
# package it. So delete the symlink and copy what we just built. | ||
if ((Get-Item ./modules -ErrorAction SilentlyContinue).LinkType -eq "SymbolicLink") { | ||
Write-Build DarkRed "PSES is a symbolic link, replacing with copy!" | ||
Remove-BuildItem ./modules | ||
Copy-Item -Recurse -Force "$(Split-Path (Get-EditorServicesPath))/module" ./modules | ||
} | ||
# With --follow-symlinks flag, VSCE can now package symbolic links directly, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of an orphaned comment that will be confusing in the future because of the lack of context, add an assertion like the one above that checks, PowerShell editor services has been built under modules. @copilot |
||
# so we no longer need to convert symlinks to copies. | ||
|
||
if ($version.Minor % 2 -ne 0) { | ||
Write-Build DarkRed "This is a pre-release!" | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Publish doesn't need this, only package. @copilot