Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"justMyCode": false,
"stopAtEntry": true,
"program": "${workspaceRoot}/debug/pwsh",
"preLaunchTask": "build",
"preLaunchTask": "Build",
"externalConsole": true,
"cwd": "${workspaceRoot}"
},
Expand Down
65 changes: 56 additions & 9 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,63 @@
{
"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 -Output (Join-Path ${workspaceFolder} debug)",
"problemMatcher": "$msCompile"
},
{
"label": "Build",
"type": "shell",
"command": "Import-Module ${workspaceFolder}/build.psm1; Start-PSBuild -Output (Join-Path ${workspaceFolder} debug)",
Copy link
Collaborator

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 task Rebuild? On VS at least, that implies Clean, then Build.

Copy link
Collaborator

@rkeithhill rkeithhill Nov 15, 2017

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

Copy link
Member Author

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 fine

Copy link
Collaborator

@rkeithhill rkeithhill Nov 15, 2017

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:

    $Arguments += "/property:GenerateFullPaths=true"

And it works! There may be other places where this arg needs to be provided.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will add. Thanks!

"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$msCompile"
}
]
Expand Down
19 changes: 16 additions & 3 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ Fix steps:
}

# setup arguments
$Arguments = @("publish")
$Arguments = @("publish","/property:GenerateFullPaths=true")
if ($Output) {
$Arguments += "--output", $Output
}
Expand Down Expand Up @@ -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) {
$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" `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$fileVersion is not set when $ReleaseTagToUse exists.

Copy link
Member Author

Choose a reason for hiding this comment

The 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
}

Expand Down