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
fix build in vscode #5453
fix build in vscode #5453
Changes from 3 commits
6b93dee
c4d0993
c1f0bea
b558516
83beea4
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 |
---|---|---|
@@ -1,17 +1,64 @@ | ||
{ | ||
"version": "0.1.0", | ||
"command": "pwsh", | ||
"isShellCommand": true, | ||
"showOutput": "always", | ||
"suppressTaskName": true, | ||
"args": [ "-command" ], | ||
"version": "2.0.0", | ||
|
||
"windows": { | ||
"options": { | ||
"shell": { | ||
"executable": "pwsh.exe", | ||
"args": [ | ||
"-NoProfile", | ||
"-ExecutionPolicy", | ||
"Bypass", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
"linux": { | ||
"options": { | ||
"shell": { | ||
"executable": "/usr/bin/pwsh", | ||
"args": [ | ||
"-NoProfile", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
"osx": { | ||
"options": { | ||
"shell": { | ||
"executable": "/usr/local/bin/pwsh", | ||
"args": [ | ||
"-NoProfile", | ||
"-Command" | ||
] | ||
} | ||
} | ||
}, | ||
|
||
"tasks": [ | ||
{ | ||
"taskName": "build", | ||
"args": [ "Import-Module ${workspaceRoot}/build.psm1; Start-PSBuild -Output ${workspaceRoot}/debug" ], | ||
"isBuildCommand": true, | ||
"label": "Bootstrap", | ||
"type": "shell", | ||
"command": "Import-Module ${workspaceFolder}/build.psm1; Start-PSBootstrap", | ||
"problemMatcher": [] | ||
}, | ||
{ | ||
"label": "Clean Build", | ||
"type": "shell", | ||
"command": "Import-Module ${workspaceFolder}/build.psm1; Start-PSBuild -Clean", | ||
"problemMatcher": "$msCompile" | ||
}, | ||
{ | ||
"label": "Build", | ||
"type": "shell", | ||
"command": "Import-Module ${workspaceFolder}/build.psm1; Start-PSBuild -Output (Join-Path ${workspaceFolder} debug)", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": "$msCompile" | ||
} | ||
] | ||
} | ||
} | ||
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. New line. 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. will add |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,9 +570,22 @@ Fix steps: | |
} else { | ||
$ReleaseVersion = (Get-PSCommitId) -replace '^v' | ||
} | ||
# in VSCode, depending on where you started it from, the git commit id may be empty so provide a default value | ||
if (!$ReleaseVersion) { | ||
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. Can you please add a comment about "In vscode, depending on where you started it from, it may not get the git commit id so it ends up empty. Add a default value to use."? 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. Will do |
||
$ReleaseVersion = "6.0.0" | ||
$fileVersion = "6.0.0" | ||
} else { | ||
$fileVersion = $ReleaseVersion.Split("-")[0] | ||
} | ||
|
||
# in VSCode, the build output folder doesn't include the name of the exe so we have to add it for rcedit | ||
$pwshPath = $Options.Output | ||
if (!$pwshPath.EndsWith("pwsh.exe")) { | ||
$pwshPath = Join-Path $Options.Output "pwsh.exe" | ||
} | ||
|
||
Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" "$($Options.Output)" --set-icon "$PSScriptRoot\assets\Powershell_black.ico" ` | ||
--set-file-version $ReleaseVersion --set-product-version $ReleaseVersion --set-version-string "ProductName" "PowerShell Core 6" ` | ||
Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $pwshPath --set-icon "$PSScriptRoot\assets\Powershell_black.ico" ` | ||
--set-file-version $fileVersion --set-product-version $ReleaseVersion --set-version-string "ProductName" "PowerShell Core 6" ` | ||
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.
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. Will fix |
||
--set-requested-execution-level "asInvoker" --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." } | Write-Verbose | ||
} | ||
|
||
|
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.
Nice! Can you add the same parameter to the
Clean Build
task above? Also,Clean Build
reads a little awkward. What if we called this taskRebuild
? On VS at least, that implies Clean, then Build.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.
BTW I was just going to warn you about this issue when I saw you not only already knew about it but solved it. 👍 Also, I tagged onto this VSCode issue on the $mscompile problem matcher not working - microsoft/vscode#34660
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.
Will add to
Clean Build
which I think is named fineThere 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.
@SteveL-MSFT I got a response from the VSCode team on the $mscompile issue. All we need to do is add the command line arg -
/property:GenerateFullPaths=true
. I tried putting this around line 485:And it works! There may be other places where this arg needs to be provided.
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.
Will add. Thanks!