Merge pull request #961 from PowerShell/andschwa/output-switch

Add -Output switch to fix debug story
This commit is contained in:
Andy Schwartzmeyer 2016-05-06 12:06:29 -07:00
commit e19a1f0b3d
7 changed files with 44 additions and 21 deletions

1
.gitignore vendored
View file

@ -1,5 +1,6 @@
bin/
obj/
debug/
project.lock.json
*-tests.xml

4
.vscode/launch.json vendored
View file

@ -7,8 +7,8 @@
"request": "launch",
"justMyCode": false,
"stopAtEntry": true,
"program": "${workspaceRoot}/bin/powershell",
"args": [ ],
"program": "${workspaceRoot}/debug/powershell",
"args": [ "-NonInteractive" ],
"preLaunchTask": "build",
"cwd": "${workspaceRoot}"
},

2
.vscode/tasks.json vendored
View file

@ -8,7 +8,7 @@
"tasks": [
{
"taskName": "build",
"args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild" ],
"args": [ "Import-Module ${workspaceRoot}/PowerShellGitHubDev.psm1; Start-PSBuild -Output debug" ],
"isBuildCommand": true,
"problemMatcher": "$msCompile"
}

View file

@ -25,6 +25,7 @@ function Start-PSBuild {
param(
[switch]$NoPath,
[switch]$Restore,
[string]$Output,
[Parameter(ParameterSetName='CoreCLR')]
[switch]$Publish,
@ -105,7 +106,7 @@ function Start-PSBuild {
}
# set output options
$OptionsArguments = @{Publish=$Publish; FullCLR=$FullCLR; Runtime=$Runtime}
$OptionsArguments = @{Publish=$Publish; Output=$Output; FullCLR=$FullCLR; Runtime=$Runtime}
$script:Options = New-PSOptions @OptionsArguments
# setup arguments
@ -115,6 +116,9 @@ function Start-PSBuild {
} else {
$Arguments += "build"
}
if ($Output) {
$Arguments += "--output", (Join-Path $PSScriptRoot $Output)
}
$Arguments += "--configuration", $Options.Configuration
$Arguments += "--framework", $Options.Framework
$Arguments += "--runtime", $Options.Runtime
@ -212,6 +216,7 @@ function New-PSOptions {
[string]$Runtime,
[switch]$Publish,
[string]$Output,
[switch]$FullCLR
)
@ -261,21 +266,25 @@ function New-PSOptions {
"powershell.exe"
}
# Build the Output path in script scope
$Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework)
# Build the Output path
if ($Output) {
$Output = Join-Path $PSScriptRoot $Output
} else {
$Output = [IO.Path]::Combine($Top, "bin", $Configuration, $Framework)
# FullCLR only builds a library, so there is no runtime component
if (-not $FullCLR) {
$Output = [IO.Path]::Combine($Output, $Runtime)
# FullCLR only builds a library, so there is no runtime component
if (-not $FullCLR) {
$Output = [IO.Path]::Combine($Output, $Runtime)
}
# Publish injects the publish directory
if ($Publish) {
$Output = [IO.Path]::Combine($Output, "publish")
}
$Output = [IO.Path]::Combine($Output, $Executable)
}
# Publish injects the publish directory
if ($Publish) {
$Output = [IO.Path]::Combine($Output, "publish")
}
$Output = [IO.Path]::Combine($Output, $Executable)
return @{ Top = $Top;
Configuration = $Configuration;
Framework = $Framework;

View file

@ -2,7 +2,7 @@ Debugging
=========
VS Code
-------
=======
[Experimental .NET Core Debugging in VS Code][core-debug] enables
cross-platform debugging with the [Visual Studio Code][vscode] editor.
@ -38,19 +38,32 @@ process named `powershell`, and will attach to it. If you need more
fine grained control, replace `processName` with `processId` and
provide a PID. (Please be careful not to commit such a change).
Important Note
--------------
Debugging is very sensitive to the versions of our .NET Core packages, VS Code,
and the C# extension.
- Use the VS Code [Insiders][] build
- Use the latest pre-release of the [C# extension][]
- Refer to the pre-release [documentation][]
[core-debug]: https://blogs.msdn.microsoft.com/visualstudioalm/2016/03/10/experimental-net-core-debugging-in-vs-code/
[vscode]: https://code.visualstudio.com/
[OmniSharp]: https://github.com/OmniSharp/omnisharp-vscode
[vscclrdebugger]: http://aka.ms/vscclrdebugger
[insiders]: https://code.visualstudio.com/insiders
[C# extension]: https://github.com/OmniSharp/omnisharp-vscode/releases
[documentation]: https://github.com/OmniSharp/omnisharp-vscode/pull/157
corehost
--------
========
The native executable prouduced by .NET CLI will produce trace output
if launched with `COREHOST_TRACE=1 ./powershell`.
CoreCLR PAL
-----------
===========
The native code in the CLR has debug channels to selectively output
information to the console. These are controlled by the

View file

@ -8,7 +8,7 @@
},
"dependencies": {
"Microsoft.Management.Infrastructure.Native": "1.0.0-rc3"
"Microsoft.Management.Infrastructure.Native": "1.0.0-rc4"
},
"frameworks": {

@ -1 +1 @@
Subproject commit 674541f7444de5be5f8c63e3a2ef2d98739c1943
Subproject commit 7144b55bdafb71dc91af4f5fb13b6e14904b789f