From 172ddc6ad1b8592bd0cc91f0afbe3fc05cca8a36 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 2 Feb 2016 11:52:26 -0800 Subject: [PATCH] Refactor project.json dependencies The packages are now dependencies of the `dnxcore50` framework itself, rather than globally. The `compilationOptions` were pruned, with `CORECLR` moved to frameworks, `_CORECLR` removed for all but `Management.Infrastructure`, and `LINUX` moved to a new `Linux` configuration, used only in `build.sh`. This configuration is purposefully absent from libraries that do not use `LINUX`, so that it is not relied upon without strong consideration. The dependencies were pruned to reduce duplication. --- build.sh | 2 +- .../project.json | 20 ++--- .../project.json | 27 +++--- .../project.json | 22 ++--- .../project.json | 20 +++-- .../project.json | 27 ++++-- .../project.json | 27 ++++-- .../project.json | 7 +- .../project.json | 14 +-- src/System.Management.Automation/project.json | 88 +++++++++++-------- 10 files changed, 147 insertions(+), 107 deletions(-) diff --git a/build.sh b/build.sh index c54fe8b345..bac1744f81 100755 --- a/build.sh +++ b/build.sh @@ -37,7 +37,7 @@ mkdir -p $BIN/Modules # Publish PowerShell ( cd src/Microsoft.PowerShell.Linux.Host - dotnet publish --framework dnxcore50 --output $BIN + dotnet publish --framework dnxcore50 --output $BIN --configuration Linux # Temporary fix for dotnet publish [[ -d $BIN/Debug/dnxcore50 ]] && cp $BIN/Debug/dnxcore50/* $BIN # Copy files that dotnet-publish does not currently deploy diff --git a/src/Microsoft.Management.Infrastructure.Native/project.json b/src/Microsoft.Management.Infrastructure.Native/project.json index c8303758e3..003bb81900 100644 --- a/src/Microsoft.Management.Infrastructure.Native/project.json +++ b/src/Microsoft.Management.Infrastructure.Native/project.json @@ -3,15 +3,15 @@ "description": "Microsoft.Management.Infrastructure.Native Stub", "authors": [ "garretts", "andschwa" ], - "compilationOptions": { "allowUnsafe": true }, - - "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "System.Security.SecureString": { - "type": "build", - "version": "1.0.0-*" + "frameworks": { + "dnxcore50": { + "dependencies": { + "NETStandard.Library": "1.0.0-rc3-23729", + "System.Security.SecureString": { + "type": "build", + "version": "1.0.0-*" + } + } } - }, - - "frameworks": { "dnxcore50": { } } + } } diff --git a/src/Microsoft.Management.Infrastructure/project.json b/src/Microsoft.Management.Infrastructure/project.json index 9487d717d7..fde9370f20 100644 --- a/src/Microsoft.Management.Infrastructure/project.json +++ b/src/Microsoft.Management.Infrastructure/project.json @@ -1,31 +1,30 @@ { "version": "1.0.0-*", - "description": "Microsoft.Management.Infrastructure Stub", + "description": "Microsoft.Management.Infrastructure", "authors": [ "garretts", "andschwa" ], "compilationOptions": { - "define": [ - "CORECLR", - "_CORECLR", - "LINUX" - ] + "allowUnsafe": true }, "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "System.Runtime.Serialization.Xml": "4.1.0-rc3-23729", - "System.Threading.ThreadPool": "4.0.10-rc3-23729", "Microsoft.Management.Infrastructure.Native" : { "type": "build", "version": "1.0.0-*" - }, - "System.Security.SecureString": { - "type": "build", - "version": "1.0.0-*" } }, - "frameworks": { "dnxcore50": { } }, + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "_CORECLR" ] + }, + "dependencies": { + "System.Runtime.Serialization.Xml": "4.1.0-rc3-23729", + "System.Threading.ThreadPool": "4.0.10-rc3-23729" + } + } + }, "compileFiles": [ "../monad/wmi/WMIv2/Client/DotNetAPI/cs/AssemblyInfo.cs", diff --git a/src/Microsoft.PowerShell.Commands.Management/project.json b/src/Microsoft.PowerShell.Commands.Management/project.json index 68b1fb4a28..e237c406cf 100644 --- a/src/Microsoft.PowerShell.Commands.Management/project.json +++ b/src/Microsoft.PowerShell.Commands.Management/project.json @@ -4,25 +4,27 @@ "authors": [ "garretts", "andschwa" ], "compilationOptions": { - "define": [ - "CORECLR", - "_CORECLR", - "LINUX" - ], - "allowUnsafe": true + "allowUnsafe": true }, "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "System.ServiceProcess.ServiceController": "4.1.0-rc3-23729", - "System.Net.NameResolution": "4.0.0-rc3-23729", "Microsoft.PowerShell.Security": { "type": "build", "version": "1.0.0-*" } }, - "frameworks": { "dnxcore50": { } }, + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "CORECLR" ] + }, + "dependencies": { + "System.ServiceProcess.ServiceController": "4.1.0-rc3-23729", + "System.Net.NameResolution": "4.0.0-rc3-23729" + } + } + }, "compile": [ "../windows-build/gen/COMMANDS_MANAGEMENT/*.cs" ], diff --git a/src/Microsoft.PowerShell.Commands.Omi/project.json b/src/Microsoft.PowerShell.Commands.Omi/project.json index 7eb72115bb..b7af3aeb2b 100644 --- a/src/Microsoft.PowerShell.Commands.Omi/project.json +++ b/src/Microsoft.PowerShell.Commands.Omi/project.json @@ -1,16 +1,20 @@ { "version": "1.0.0-*", "description": "Microsoft.PowerShell.Commands.Omi Library", - "authors": [ "George Fleming", "andschwa" ], + "authors": [ "palladia", "andschwa" ], "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "System.Xml.XDocument": "4.0.11-rc3-23729", - "System.Management.Automation": { - "type": "build", - "version": "1.0.0-*" - } + "System.Management.Automation": { + "type": "build", + "version": "1.0.0-*" + } }, - "frameworks": { "dnxcore50": { } } + "frameworks": { + "dnxcore50": { + "dependencies": { + "System.Xml.XDocument": "4.0.11-rc3-23729" + } + } + } } diff --git a/src/Microsoft.PowerShell.Commands.Utility/project.json b/src/Microsoft.PowerShell.Commands.Utility/project.json index 2c67ac94f6..00eb3116ac 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/project.json +++ b/src/Microsoft.PowerShell.Commands.Utility/project.json @@ -4,24 +4,35 @@ "authors": [ "garretts", "andschwa" ], "compilationOptions": { - "define": [ - "CORECLR", - "_CORECLR", - "LINUX" - ], "allowUnsafe": true }, + "configurations": { + "Linux": { + "compilationOptions": { + "define": [ "LINUX" ] + } + } + }, + "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01", "System.Management.Automation": { "type": "build", "version": "1.0.0-*" } }, - "frameworks": { "dnxcore50": { "imports": "portable-net45+win8" } }, + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "CORECLR" ] + }, + "imports": "portable-net45+win8", + "dependencies": { + "Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01" + } + } + }, "compile": [ "../windows-build/gen/COMMANDS_UTILITY/*.cs" ], diff --git a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json index b1551f8f80..8f18908505 100644 --- a/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json +++ b/src/Microsoft.PowerShell.CoreCLR.AssemblyLoadContext/project.json @@ -3,14 +3,25 @@ "description": "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext Class", "authors": [ "andschwa" ], - "compileFiles": [ "../monad/monad/src/CoreCLR/CorePsAssemblyLoadContext.cs" ], - - "compilationOptions": { "define": [ "CORECLR", "LINUX" ] }, - - "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "System.Runtime.Loader": "4.0.0-rc3-23729" + "configurations": { + "Linux": { + "compilationOptions": { + "define": [ "LINUX" ] + } + } }, - "frameworks": { "dnxcore50": { } } + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "CORECLR" ] + }, + "dependencies": { + "NETStandard.Library": "1.0.0-rc3-23729", + "System.Runtime.Loader": "4.0.0-rc3-23729" + } + } + }, + + "compileFiles": [ "../monad/monad/src/CoreCLR/CorePsAssemblyLoadContext.cs" ] } diff --git a/src/Microsoft.PowerShell.Linux.Host/project.json b/src/Microsoft.PowerShell.Linux.Host/project.json index 19102de904..63367fe1bf 100644 --- a/src/Microsoft.PowerShell.Linux.Host/project.json +++ b/src/Microsoft.PowerShell.Linux.Host/project.json @@ -9,7 +9,6 @@ }, "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", "Newtonsoft.Json": "8.0.2", "Microsoft.PowerShell.Commands.Management": { "type": "build", @@ -25,5 +24,9 @@ } }, - "frameworks": { "dnxcore50": { "imports": "portable-net45+win8" } } + "frameworks": { + "dnxcore50": { + "imports": "portable-net45+win8" + } + } } diff --git a/src/Microsoft.PowerShell.Security/project.json b/src/Microsoft.PowerShell.Security/project.json index 1d21897ae9..c490284b4b 100644 --- a/src/Microsoft.PowerShell.Security/project.json +++ b/src/Microsoft.PowerShell.Security/project.json @@ -4,23 +4,23 @@ "authors": [ "garretts", "andschwa" ], "compilationOptions": { - "define": [ - "CORECLR", - "_CORECLR", - "LINUX" - ], "allowUnsafe": true }, "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", "System.Management.Automation": { "type": "build", "version": "1.0.0-*" } }, - "frameworks": { "dnxcore50": { } }, + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "CORECLR" ] + } + } + }, "compile": [ "../windows-build/gen/SECURITY/*.cs" ], diff --git a/src/System.Management.Automation/project.json b/src/System.Management.Automation/project.json index 1a434c417e..6d9eddd879 100644 --- a/src/System.Management.Automation/project.json +++ b/src/System.Management.Automation/project.json @@ -5,54 +5,64 @@ "authors": [ "garretts", "andschwa" ], "compilationOptions": { - "define": [ - "CORECLR", - "_CORECLR", - "LINUX" - ], "allowUnsafe": true }, + "configurations": { + "Linux": { + "compilationOptions": { + "define": [ "LINUX" ] + } + } + }, + "dependencies": { - "NETStandard.Library": "1.0.0-rc3-23729", - "Microsoft.CSharp": "4.0.1-rc3-23729", - "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-23729", - "System.Collections.Specialized": "4.0.1-rc3-23729", - "System.ComponentModel.EventBasedAsync": "4.0.11-rc3-23729", - "System.ComponentModel.TypeConverter": "4.0.1-rc3-23729", - "System.Data.Common": "4.0.1-rc3-23729", - "System.Diagnostics.Contracts": "4.0.1-rc3-23729", - "System.Diagnostics.FileVersionInfo": "4.0.0-rc3-23729", - "System.Diagnostics.Process": "4.1.0-rc3-23729", - "System.Diagnostics.StackTrace": "4.0.1-rc3-23729", - "System.Diagnostics.TraceSource": "4.0.0-rc3-23729", - "System.Dynamic.Runtime": "4.0.11-rc3-23729", - "System.IO.FileSystem.AccessControl": "4.0.0-rc3-23729", - "System.IO.FileSystem.DriveInfo": "4.0.0-rc3-23729", - "System.IO.FileSystem.Watcher": "4.0.0-rc3-23729", - "System.IO.Pipes": "4.0.0-rc3-23729", - "System.Linq.Expressions": "4.0.11-rc3-23729", - "System.Net.Http": "4.0.1-rc3-23729", - "System.Net.NetworkInformation": "4.1.0-rc3-23729", - "System.Reflection.Emit.Lightweight": "4.0.1-rc3-23729", - "System.Security.AccessControl": "4.0.0-rc3-23729", - "System.Security.Cryptography.Algorithms": "4.0.0-rc3-23729", - "System.Security.Cryptography.X509Certificates": "4.0.0-rc3-23729", - "System.Threading.Tasks.Parallel": "4.0.1-rc3-23729", - "System.Xml.XPath.XmlDocument": "4.0.1-rc3-23729", - "System.Xml.XmlDocument": "4.0.1-rc3-23729", - "System.Xml.XmlSerializer": "4.0.11-rc3-23729", - "Microsoft.Management.Infrastructure" : { - "type": "build", - "version": "1.0.0-*" - }, - "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": { + "Microsoft.Management.Infrastructure" : { "type": "build", "version": "1.0.0-*" } }, - "frameworks": { "dnxcore50": { } }, + "frameworks": { + "dnxcore50": { + "compilationOptions": { + "define": [ "CORECLR" ] + }, + "dependencies": { + "Microsoft.CSharp": "4.0.1-rc3-23729", + "Microsoft.Win32.Registry.AccessControl": "4.0.0-rc3-23729", + "System.Collections.Specialized": "4.0.1-rc3-23729", + "System.ComponentModel.EventBasedAsync": "4.0.11-rc3-23729", + "System.ComponentModel.TypeConverter": "4.0.1-rc3-23729", + "System.Data.Common": "4.0.1-rc3-23729", + "System.Diagnostics.Contracts": "4.0.1-rc3-23729", + "System.Diagnostics.FileVersionInfo": "4.0.0-rc3-23729", + "System.Diagnostics.Process": "4.1.0-rc3-23729", + "System.Diagnostics.StackTrace": "4.0.1-rc3-23729", + "System.Diagnostics.TraceSource": "4.0.0-rc3-23729", + "System.Dynamic.Runtime": "4.0.11-rc3-23729", + "System.IO.FileSystem.AccessControl": "4.0.0-rc3-23729", + "System.IO.FileSystem.DriveInfo": "4.0.0-rc3-23729", + "System.IO.FileSystem.Watcher": "4.0.0-rc3-23729", + "System.IO.Pipes": "4.0.0-rc3-23729", + "System.Linq.Expressions": "4.0.11-rc3-23729", + "System.Net.Http": "4.0.1-rc3-23729", + "System.Net.NetworkInformation": "4.1.0-rc3-23729", + "System.Reflection.Emit.Lightweight": "4.0.1-rc3-23729", + "System.Security.AccessControl": "4.0.0-rc3-23729", + "System.Security.Cryptography.Algorithms": "4.0.0-rc3-23729", + "System.Security.Cryptography.X509Certificates": "4.0.0-rc3-23729", + "System.Threading.Tasks.Parallel": "4.0.1-rc3-23729", + "System.Xml.XPath.XmlDocument": "4.0.1-rc3-23729", + "System.Xml.XmlDocument": "4.0.1-rc3-23729", + "System.Xml.XmlSerializer": "4.0.11-rc3-23729", + "Microsoft.PowerShell.CoreCLR.AssemblyLoadContext": { + "type": "build", + "version": "1.0.0-*" + } + } + } + }, "compile" : [ "../windows-build/gen/SYS_AUTO/*.cs",