Build with new framework and new CLI

All libraries now use the framework `netstandard1.5`, and import the
`dnxcore50` and `portable` frameworks. The app that is published,
Microsoft.PowerShell.Linux.Host, that is, the top-level dependency that
emits an executable, instead targets `netstandardapp1.5` and has a new
`runtimes` key so that .NET CLI's `restore` and `publish` commands know
which runtime implementations to resolve.

When switching to the new CLI, we needed to fix how we specified our
dependencies. In particular, the .NET CLI team helped me figure out how
to download packages that are reference assembly only on Linux, with
implementations on Windows. The result of this is the new `frameworks`
setup.

Additionally, we were incorrectly specifying our build dependencies;
that is, projects we also build (not packages). The solution was much
cleaner. We removed the `type: build` section and replaced it with the
version `1.0.0-*` that all our projects currently use.

The `project.json` files also had their names, descriptions,
indentation, and versions fixed.

The build scripts were simplified.
This commit is contained in:
Andrew Schwartzmeyer 2016-02-11 08:25:43 -08:00
parent 8dab22a545
commit e6e4dcafbe
15 changed files with 82 additions and 96 deletions

View File

@ -1,7 +1,2 @@
$BIN = "${pwd}/bin"
# Publish PowerShell
cd src/Microsoft.PowerShell.Linux.Host
dotnet publish --framework dnxcore50 --output $BIN
# Copy files that dotnet-publish does not currently deploy
cd ../..
dotnet publish "src/Microsoft.PowerShell.Linux.Host" --framework "netstandardapp1.5" --output "bin"

View File

@ -12,6 +12,4 @@ cp src/libpsl-native.* $BIN
popd
# Publish PowerShell
pushd src/Microsoft.PowerShell.Linux.Host
dotnet publish --framework dnxcore50 --output $BIN --configuration Linux
popd
dotnet publish --output $BIN --configuration Linux src/Microsoft.PowerShell.Linux.Host

View File

@ -1,16 +1,15 @@
{
"name": "Microsoft.Management.Infrastructure.Native",
"version": "1.0.0-*",
"description": "Microsoft.Management.Infrastructure.Native Stub",
"description": "Stub to satisfy PowerShell compilation",
"authors": [ "garretts", "andschwa" ],
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"dependencies": {
"NETStandard.Library": "1.0.0-rc3-23817",
"System.Security.SecureString": {
"type": "build",
"version": "1.0.0-*"
}
"System.Security.SecureString": "1.0.0-*"
}
},
"dnx451": {

View File

@ -1,6 +1,6 @@
{
"name": "Microsoft.Management.Infrastructure",
"version": "1.0.0-*",
"description": "Microsoft.Management.Infrastructure",
"authors": [ "garretts", "andschwa" ],
"compilationOptions": {
@ -8,14 +8,12 @@
},
"dependencies": {
"Microsoft.Management.Infrastructure.Native" : {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.Management.Infrastructure.Native": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"compilationOptions": {
"define": [ "_CORECLR" ]
},

View File

@ -1,6 +1,6 @@
{
"name": "Microsoft.PowerShell.Commands.Management",
"version": "1.0.0-*",
"description": "Microsoft.PowerShell.Commands.Management Library",
"authors": [ "garretts", "andschwa" ],
"compilationOptions": {
@ -8,14 +8,12 @@
},
"dependencies": {
"Microsoft.PowerShell.Security": {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.PowerShell.Security": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"compilationOptions": {
"define": [ "CORECLR" ]
},
@ -72,7 +70,7 @@
"../monad/monad/src/commands/management/CommitTransactionCommand.cs",
"../monad/monad/src/commands/management/Computer.cs",
"../monad/monad/src/commands/management/ContentCommandBase.cs",
"../monad/monad/src/commands/management/ConvertPathCommand.cs",
"../monad/monad/src/commands/management/CopyPropertyCommand.cs",
"../monad/monad/src/commands/management/Eventlog.cs",

View File

@ -1,6 +1,6 @@
{
"name": "Microsoft.PowerShell.Commands.Utility",
"version": "1.0.0-*",
"description": "Microsoft.PowerShell.Commands.Utility Library",
"authors": [ "garretts", "andschwa" ],
"compilationOptions": {
@ -16,18 +16,15 @@
},
"dependencies": {
"System.Management.Automation": {
"type": "build",
"version": "1.0.0-*"
}
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"compilationOptions": {
"define": [ "CORECLR" ]
},
"imports": "portable-net45+win8",
"imports": [ "dnxcore50", "portable-net45+win8" ],
"dependencies": {
"Microsoft.CodeAnalysis.CSharp": "1.1.1",
"Newtonsoft.Json": "8.0.2"

View File

@ -1,6 +1,7 @@
{
"name": "Microsoft.PowerShell.ConsoleHost",
"version": "1.0.0-*",
"description": "Microsoft.PowerShell.ConsoleHost Library",
"description": "Full Windows PowerShell Host (requires native host)",
"authors": [ "sevoroby", "andschwa" ],
"compilationOptions": {
@ -8,14 +9,8 @@
},
"dependencies": {
"Microsoft.PowerShell.Commands.Management": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.PowerShell.Commands.Utility": {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.PowerShell.Commands.Management": "1.0.0-*",
"Microsoft.PowerShell.Commands.Utility": "1.0.0-*"
},
"frameworks": {

View File

@ -1,6 +1,6 @@
{
"version": "1.0.0.0",
"description": "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext Class",
"name": "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext",
"version": "1.0.0-*",
"authors": [ "andschwa" ],
"configurations": {
@ -12,7 +12,8 @@
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"compilationOptions": {
"define": [ "CORECLR" ]
},

View File

@ -1,7 +1,7 @@
{
"name": "powershell",
"version": "1.0.0-*",
"description": "PowerShell On Linux Console",
"description": "PowerShell Managed Console for .NET Core",
"authors": [ "andschwa" ],
"compilationOptions": {
@ -10,14 +10,8 @@
"dependencies": {
"Newtonsoft.Json": "8.0.2",
"Microsoft.PowerShell.Commands.Management": {
"type": "build",
"version": "1.0.0-*"
},
"Microsoft.PowerShell.Commands.Utility": {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.PowerShell.Commands.Management": "1.0.0-*",
"Microsoft.PowerShell.Commands.Utility": "1.0.0-*"
},
"content": [
@ -41,10 +35,17 @@
"WSMan.format.ps1xml"
],
"frameworks": {
"dnxcore50": {
"imports": "portable-net45+win8"
"netstandardapp1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
},
"runtimes": {
"ubuntu.14.04-x64": { },
"win7-x64": { },
"win10-x64": { },
"osx.10.10-x64": { },
"osx.10.11-x64": { }
}
}

View File

@ -1,6 +1,6 @@
{
"name": "Microsoft.PowerShell.Security",
"version": "1.0.0-*",
"description": "Microsoft.PowerShell.Security Library",
"authors": [ "garretts", "andschwa" ],
"compilationOptions": {
@ -8,14 +8,12 @@
},
"dependencies": {
"System.Management.Automation": {
"type": "build",
"version": "1.0.0-*"
}
"System.Management.Automation": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"compilationOptions": {
"define": [ "CORECLR" ]
}

View File

@ -1,7 +1,6 @@
{
"name": "System.Management.Automation",
"version": "1.0.0-*",
"description": "System.Management.Automation Library",
"authors": [ "garretts", "andschwa" ],
"compilationOptions": {
@ -17,18 +16,18 @@
},
"dependencies": {
"Microsoft.Management.Infrastructure" : {
"type": "build",
"version": "1.0.0-*"
}
"Microsoft.Management.Infrastructure": "1.0.0-*"
},
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50" ],
"compilationOptions": {
"define": [ "CORECLR", "NOETW" ]
},
"dependencies": {
"Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": "1.0.0-*",
"Microsoft.CSharp": "4.0.1-rc3-23817",
"Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-23817",
"System.Collections.Specialized": "4.0.1-rc3-23817",
@ -56,10 +55,6 @@
"System.Xml.XPath.XmlDocument": "4.0.1-rc3-23817",
"System.Xml.XmlDocument": "4.0.1-rc3-23817",
"System.Xml.XmlSerializer": "4.0.11-rc3-23817",
"Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": {
"type": "build",
"version": "1.0.0-*"
}
}
},
"dnx451": {

View File

@ -1,13 +1,19 @@
{
"name": "System.Security.SecureString",
"version": "1.0.0-*",
"description": "SecureString Stub",
"description": "SecureString Stub borrowed from Mono",
"authors": [ "garretts" ],
"compilationOptions": { "allowUnsafe": true },
"dependencies": {
"NETStandard.Library": "1.0.0-rc3-23817"
"compilationOptions": {
"allowUnsafe": true
},
"frameworks": { "dnxcore50": { } }
"frameworks": {
"netstandard1.5": {
"dependencies": {
"NETStandard.Library": "1.0.0-rc3-23817"
},
"imports": [ "dnxcore50" ]
}
}
}

View File

@ -36,5 +36,9 @@
"System.Net.NameResolution": "4.0.0-rc3-23817"
},
"frameworks": { "dnxcore50": { } }
"frameworks": {
"netstandard1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ]
}
}
}

View File

@ -1,6 +1,7 @@
{
"name": "TypeCatalogGen",
"version": "1.0.0-*",
"description": "PowerShell TypeCatalogGen.exe",
"description": "Generates CorePsTypeCatalog.cs given powershell.inc",
"authors": [ "andschwa" ],
"compilationOptions": {
@ -8,21 +9,21 @@
},
"dependencies": {
"System.Reflection.Metadata": "1.1.1-beta-23516",
"System.Collections.Immutable": "1.1.38-beta-23516"
"System.Reflection.Metadata": "1.1.1-beta-23516",
"System.Collections.Immutable": "1.1.38-beta-23516"
},
"compileFiles": [
"../monad/monad/nttargets/assemblies/core/PSAssemblyLoadContext/TypeCatalogGen/TypeCatalogGen.cs"
"../monad/monad/nttargets/assemblies/core/PSAssemblyLoadContext/TypeCatalogGen/TypeCatalogGen.cs"
],
"frameworks": {
"dnx451": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": "",
"System.Reflection.Primitives": ""
}
}
"dnx451": {
"frameworkAssemblies": {
"System.Runtime": "",
"System.IO": "",
"System.Reflection.Primitives": ""
}
}
}
}

View File

@ -5,7 +5,8 @@
"authors": [ "andschwa" ],
"frameworks": {
"dnxcore50": {
"netstandard1.5": {
"imports": [ "dnxcore50", "portable-net45+win8" ],
"dependencies": {
"Microsoft.PowerShell.Linux.Host": {
"type": "build",
@ -13,8 +14,7 @@
},
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-dev-*"
},
"imports": "portable-net45+win8"
}
}
},