Switch to netcoreapp1.0

Instead of using `dotnet publish`, we can use `dotnet build` and the new
`netcoreapp1.0` framework with a new dependency on
`Microsoft.NETCore.App` to generate output that does not include the
runtime, but can be run anywhere (given the installation of the
runtime).

While we cannot yet adopt a dependency on the shared host until .NET
Core RTM, we are forced to switch to this system anyway because the
latest RC3 packages and CLI do not support `netstandardapp1.5`. See
dotnet/cli#2482.

Thus we're in an in-between state where we have to use `netcoreapp1.0`,
but cannot use `"Microsoft.NETCore.App": { "type": "platform" }` to
utilize the shared host, as we need to continue to ship our host.
Without specifying "platform", we retain the status quo with respect to
build steps and outputs.

Additionally, there is no longer a good reason to use the RC3 packages,
and it has been advised we switch to RC2 since the
`Microsoft.NETCore.App` is only available for RC2. We must update
packages because our current version can no longer be debugged.
This commit is contained in:
Andrew Schwartzmeyer 2016-04-18 20:22:20 -07:00
parent b874c1801d
commit ea5d5c3d05
17 changed files with 63 additions and 59 deletions

View file

@ -190,7 +190,7 @@ function New-PSOptions {
[ValidateSet("Linux", "Debug", "Release")]
[string]$Configuration,
[ValidateSet("netstandardapp1.5", "net451")]
[ValidateSet("netcoreapp1.0", "net451")]
[string]$Framework,
# These are duplicated from Start-PSBuild
@ -229,7 +229,7 @@ function New-PSOptions {
$Framework = if ($FullCLR) {
"net451"
} else {
"netstandardapp1.5"
"netcoreapp1.0"
}
log "Using framework '$Framework'"
}
@ -321,9 +321,11 @@ function Start-PSxUnit {
$Arguments = "--configuration", "Linux"
try {
Push-Location $PSScriptRoot/test/csharp
Start-NativeExecution { dotnet build $Arguments }
Copy-Item -ErrorAction SilentlyContinue -Recurse -Path $Content/* -Include Modules,libpsl-native* -Destination "./bin/Linux/netstandardapp1.5/ubuntu.14.04-x64"
Copy-Item -ErrorAction SilentlyContinue -Recurse -Path $Content/* -Include Modules,libpsl-native* -Destination "./bin/Linux/netcoreapp1.0/ubuntu.14.04-x64"
Start-NativeExecution { dotnet test $Arguments }
if ($LASTEXITCODE -ne 0) {
throw "$LASTEXITCODE xUnit tests failed"
}

View file

@ -33,7 +33,7 @@ test_script:
$ErrorActionPreference = 'Stop'
#
# CoreCLR
$env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netstandardapp1.5\win81-x64\publish"
$env:CoreOutput = "$pwd\src\Microsoft.PowerShell.CoreConsoleHost\bin\Debug\netcoreapp1.0\win81-x64\publish"
Write-Host -Foreground Green 'Run CoreCLR tests'
$testResultsFile = "$pwd\TestsResults.xml"
& ("$env:CoreOutput\powershell.exe") -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile"

View file

@ -114,7 +114,7 @@ Start-PSBuild
Congratulations! If everything went right, PowerShell is now built.
The `Start-PSBuild` script will output the location of the executable:
`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netstandardapp1.5/ubuntu.14.04-x64/powershell`.
`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netcoreapp1.0/ubuntu.14.04-x64/powershell`.
You can run our cross-platform Pester tests with `Start-PSPester`, and
our xUnit tests with `Start-PSxUnit`.
@ -160,7 +160,7 @@ dotnet build --configuration Linux
The executable will be in
`./bin/[configuration]/[framework]/[rid]/[binary name]`, where our
configuration is `Linux`, framework is `netstandardapp1.5`, runtime
configuration is `Linux`, framework is `netcoreapp1.0`, runtime
identifier is `ubuntu.14.04-x64`, and binary name is `powershell`. The
function `Get-PSOutput` will return the path to the executable; thus
you can execute the development copy via `& (Get-PSOutput)`.

View file

@ -49,7 +49,7 @@ module.
The output directory will be slightly different because your runtime
identifier is different. PowerShell will be at
`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netstandardapp1.5/osx.10.11-x64/powershell`,
`./src/Microsoft.PowerShell.CoreConsoleHost/bin/Linux/netcoreapp1.0/osx.10.11-x64/powershell`,
or `osx.10.10` depending on your operating system version. Note that
configration is still `Linux` because it would be silly to make yet
another separate configuration when it's used soley to work-around a

View file

@ -71,12 +71,12 @@ Start-PSBuild
```
Congratulations! If everything went right, PowerShell is now built and
executable as `./src/Microsoft.PowerShell.CoreConsoleHost/bin/Debug/netstandardapp1.5/win10-x64/powershell`.
executable as `./src/Microsoft.PowerShell.CoreConsoleHost/bin/Debug/netcoreapp1.0/win10-x64/powershell`.
This location is of the form
`./[project]/bin/[configuration]/[framework]/[rid]/[binary name]`, and
our project is `Microsoft.PowerShell.CoreConsoleHost`, configuration is `Debug`
by default, framework is `netstandardapp1.5`, runtime identifier is
by default, framework is `netcoreapp1.0`, runtime identifier is
**probably** `win10-x64` (but will depend on your operating system;
don't worry, `dotnet --info` will tell you what it was), and binary
name is `powershell`. The function `Get-PSOutput` will return the path

View file

@ -51,11 +51,11 @@ module.
Because the `ConsoleHost` project (*not* the `Host` project) is a
library and not an application (in the sense that .NET CLI does not
emit a native executable using .NET Core's `corehost`), it targets the
framework `netstandard1.5`, *not* `netstandardapp1.5`, and the build
framework `netstandard1.5`, *not* `netcoreapp1.0`, and the build
output will *not* have a runtime identifier in the path.
Thus the output location of `powershell.exe` will be
`./src/Microsoft.PowerShell.ConsoleHost/bin/Debug/netstandardapp1.5/powershell.exe`
`./src/Microsoft.PowerShell.ConsoleHost/bin/Debug/netcoreapp1.0/powershell.exe`
While building is easy, running FullCLR version is not as simple as
CoreCLR version.

View file

@ -11,7 +11,6 @@
"warningsAsErrors": true
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24011-00",
"System.Security.SecureString": "1.0.0-*"
}
},

View file

@ -19,8 +19,8 @@
"define": [ "_CORECLR" ]
},
"dependencies": {
"System.Runtime.Serialization.Xml": "4.1.1-rc3-24011-00",
"System.Threading.ThreadPool": "4.0.10-rc3-24011-00"
"System.Runtime.Serialization.Xml": "4.1.1-rc2-24022",
"System.Threading.ThreadPool": "4.0.10-rc2-24022"
}
},
"net451": {

View file

@ -19,8 +19,8 @@
"define": [ "CORECLR" ]
},
"dependencies": {
"System.ServiceProcess.ServiceController": "4.1.0-rc3-24011-00",
"System.Net.NameResolution": "4.0.0-rc3-24011-00"
"System.ServiceProcess.ServiceController": "4.1.0-rc2-24022",
"System.Net.NameResolution": "4.0.0-rc2-24022"
}
},
"net451": {

View file

@ -22,8 +22,8 @@
"define": [ "CORECLR" ]
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24011-00",
"System.Runtime.Loader": "4.0.0-rc3-24011-00"
"NETStandard.Library": "1.5.0-rc2-24022",
"System.Runtime.Loader": "4.0.0-rc2-24022"
}
}
}

View file

@ -23,9 +23,9 @@
"define": [ "CORECLR" ]
},
"dependencies": {
"System.Security.Principal": "4.0.1-rc3-24011-00",
"System.Security.Principal.Windows": "4.0.0-rc3-24011-00",
"System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00",
"System.Security.Principal": "4.0.1-rc2-24022",
"System.Security.Principal.Windows": "4.0.0-rc2-24022",
"System.Diagnostics.TraceSource": "4.0.0-rc2-24022",
"System.Security.SecureString": "1.0.0-*"
}
}

View file

@ -11,8 +11,8 @@
"dependencies": {
"Newtonsoft.Json": "8.0.2",
"System.Xml.XDocument": "4.0.11-rc3-24011-00",
"System.IO.MemoryMappedFiles": "4.0.0-rc3-24011-00",
"System.Xml.XDocument": "4.0.11-rc2-24022",
"System.IO.MemoryMappedFiles": "4.0.0-rc2-24022",
"Microsoft.PowerShell.Commands.Management": "1.0.0-*",
"Microsoft.PowerShell.Commands.Utility": "1.0.0-*"
},
@ -26,8 +26,11 @@
],
"frameworks": {
"netstandardapp1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
"netcoreapp1.0": {
"imports": [ "dnxcore50", "portable-net45+win8" ],
"dependencies": {
"Microsoft.NETCore.App": "1.0.0-rc2-3002485"
}
}
},

View file

@ -30,36 +30,36 @@
"Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": "1.0.0-*",
"Microsoft.PowerShell.CoreCLR.Eventing": "1.0.0-*",
"Microsoft.CSharp": "4.0.1-rc3-24011-00",
"Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-24011-00",
"System.Collections.Specialized": "4.0.1-rc3-24011-00",
"System.Collections.NonGeneric": "4.0.1-rc3-24011-00",
"System.ComponentModel.EventBasedAsync": "4.0.11-rc3-24011-00",
"System.ComponentModel.TypeConverter": "4.0.1-rc3-24011-00",
"System.Data.Common": "4.0.1-rc3-24011-00",
"System.Diagnostics.Contracts": "4.0.1-rc3-24011-00",
"System.Diagnostics.FileVersionInfo": "4.0.0-rc3-24011-00",
"System.Diagnostics.Process": "4.1.0-rc3-24011-00",
"System.Diagnostics.StackTrace": "4.0.1-rc3-24011-00",
"System.Diagnostics.TraceSource": "4.0.0-rc3-24011-00",
"System.Dynamic.Runtime": "4.0.11-rc3-24011-00",
"System.IO.FileSystem.AccessControl": "4.0.0-rc3-24011-00",
"System.IO.FileSystem.DriveInfo": "4.0.0-rc3-24011-00",
"System.IO.FileSystem.Watcher": "4.0.0-rc3-24011-00",
"System.IO.Pipes": "4.0.0-rc3-24011-00",
"System.Linq.Expressions": "4.0.11-rc3-24011-00",
"System.Net.Http": "4.0.1-rc3-24011-00",
"System.Net.NetworkInformation": "4.1.0-rc3-24011-00",
"System.Reflection.Emit": "4.0.1-rc3-24011-00",
"System.Reflection.Emit.Lightweight": "4.0.1-rc3-24011-00",
"System.Security.AccessControl": "4.0.0-rc3-24011-00",
"System.Security.Cryptography.Algorithms": "4.1.0-rc3-24011-00",
"System.Security.Cryptography.X509Certificates": "4.1.0-rc3-24011-00",
"System.Threading.Thread": "4.0.0-rc3-24011-00",
"System.Threading.Tasks.Parallel": "4.0.1-rc3-24011-00",
"System.Xml.XPath.XmlDocument": "4.0.1-rc3-24011-00",
"System.Xml.XmlDocument": "4.0.1-rc3-24011-00",
"System.Xml.XmlSerializer": "4.0.11-rc3-24011-00"
"Microsoft.CSharp": "4.0.1-rc2-24022",
"Microsoft.Win32.Registry.AccessControl": "4.0.0-rc2-24022",
"System.Collections.Specialized": "4.0.1-rc2-24022",
"System.Collections.NonGeneric": "4.0.1-rc2-24022",
"System.ComponentModel.EventBasedAsync": "4.0.11-rc2-24022",
"System.ComponentModel.TypeConverter": "4.0.1-rc2-24022",
"System.Data.Common": "4.0.1-rc2-24022",
"System.Diagnostics.Contracts": "4.0.1-rc2-24022",
"System.Diagnostics.FileVersionInfo": "4.0.0-rc2-24022",
"System.Diagnostics.Process": "4.1.0-rc2-24022",
"System.Diagnostics.StackTrace": "4.0.1-rc2-24022",
"System.Diagnostics.TraceSource": "4.0.0-rc2-24022",
"System.Dynamic.Runtime": "4.0.11-rc2-24022",
"System.IO.FileSystem.AccessControl": "4.0.0-rc2-24022",
"System.IO.FileSystem.DriveInfo": "4.0.0-rc2-24022",
"System.IO.FileSystem.Watcher": "4.0.0-rc2-24022",
"System.IO.Pipes": "4.0.0-rc2-24022",
"System.Linq.Expressions": "4.0.11-rc2-24022",
"System.Net.Http": "4.0.1-rc2-24022",
"System.Net.NetworkInformation": "4.1.0-rc2-24022",
"System.Reflection.Emit": "4.0.1-rc2-24022",
"System.Reflection.Emit.Lightweight": "4.0.1-rc2-24022",
"System.Security.AccessControl": "4.0.0-rc2-24022",
"System.Security.Cryptography.Algorithms": "4.1.0-rc2-24022",
"System.Security.Cryptography.X509Certificates": "4.1.0-rc2-24022",
"System.Threading.Thread": "4.0.0-rc2-24022",
"System.Threading.Tasks.Parallel": "4.0.1-rc2-24022",
"System.Xml.XPath.XmlDocument": "4.0.1-rc2-24022",
"System.Xml.XmlDocument": "4.0.1-rc2-24022",
"System.Xml.XmlSerializer": "4.0.11-rc2-24022"
}
},
"net451": {

View file

@ -12,7 +12,7 @@
"frameworks": {
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24011-00"
"NETStandard.Library": "1.5.0-rc2-24022"
},
"imports": [ "dnxcore50" ]
}

View file

@ -17,7 +17,7 @@ namespace ConsoleApplication
var outputPath = "../TypeCatalogGen/powershell.inc";
// Get a context for our top level project
var context = ProjectContext.Create("../Microsoft.PowerShell.CoreConsoleHost", NuGetFramework.Parse("netstandardapp1.5"));
var context = ProjectContext.Create("../Microsoft.PowerShell.CoreConsoleHost", NuGetFramework.Parse("netcoreapp1.0"));
System.IO.File.WriteAllLines(outputPath,
// Get the target for the current runtime

View file

@ -10,7 +10,7 @@
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},

View file

@ -9,7 +9,7 @@
},
"frameworks": {
"netstandardapp1.5": {
"netcoreapp1.0": {
"imports": [ "dnxcore50", "portable-net45+win8" ],
"dependencies": {
"xunit": "2.1.0",