diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index 023585664..c45734c14 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -3,8 +3,16 @@ + + runtimes/any/native + $(RepoRoot)/resources/MSBuildImports + + + + + - - - + + + + @@ -85,7 +93,7 @@ + DestinationFiles="@(SharedFramework->'$(StageDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" /> + ProjectPath="$(SrcDirectory)/redist" /> @@ -121,36 +129,26 @@ File="%(SdkOutputChModTargets.FullPath)" Mode="%(SdkOutputChModTargets.Mode)" /> - + - + - + - - - + + DepsFile="$(SdkOutputDirectory)/%(BundledTools.Identity).deps.json" + NewName="%(BundledTools.Identity).deps.json" /> - - - - - + + + + + + @@ -208,12 +210,13 @@ + DestinationFiles="@(MSBuildTargetsToCopy->'$(SdkOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" /> + + + + - - - diff --git a/src/dotnet/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NETCore.ImportBefore.props b/resources/MSBuildImports/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NETCore.ImportBefore.props similarity index 100% rename from src/dotnet/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NETCore.ImportBefore.props rename to resources/MSBuildImports/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NETCore.ImportBefore.props diff --git a/src/dotnet/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NuGet.ImportBefore.props b/resources/MSBuildImports/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NuGet.ImportBefore.props similarity index 100% rename from src/dotnet/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NuGet.ImportBefore.props rename to resources/MSBuildImports/15.0/Imports/Microsoft.Common.props/ImportBefore/Microsoft.NuGet.ImportBefore.props diff --git a/src/dotnet/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NETCore.ImportAfter.targets b/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NETCore.ImportAfter.targets similarity index 100% rename from src/dotnet/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NETCore.ImportAfter.targets rename to resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NETCore.ImportAfter.targets diff --git a/src/dotnet/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets b/resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets similarity index 100% rename from src/dotnet/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets rename to resources/MSBuildImports/15.0/Microsoft.Common.targets/ImportAfter/Microsoft.NuGet.ImportAfter.targets diff --git a/src/dotnet/Microsoft.DotNet.Core.Sdk.props b/resources/MSBuildImports/Microsoft.DotNet.Core.Sdk.props similarity index 100% rename from src/dotnet/Microsoft.DotNet.Core.Sdk.props rename to resources/MSBuildImports/Microsoft.DotNet.Core.Sdk.props diff --git a/src/dotnet/Microsoft.DotNet.Core.Sdk.targets b/resources/MSBuildImports/Microsoft.DotNet.Core.Sdk.targets similarity index 100% rename from src/dotnet/Microsoft.DotNet.Core.Sdk.targets rename to resources/MSBuildImports/Microsoft.DotNet.Core.Sdk.targets diff --git a/src/Microsoft.DotNet.Core.Build.Tasks/project.json b/src/Microsoft.DotNet.Core.Build.Tasks/project.json index 58b48191e..3a8744936 100644 --- a/src/Microsoft.DotNet.Core.Build.Tasks/project.json +++ b/src/Microsoft.DotNet.Core.Build.Tasks/project.json @@ -8,7 +8,7 @@ "Microsoft.Extensions.DependencyModel": { "target": "project" }, - "NuGet.ProjectModel": "3.5.0-rc1-1653" + "NuGet.ProjectModel": "3.5.0-rc1-1697" }, "frameworks": { "net451": { diff --git a/src/compilers/Program.cs b/src/compilers/Program.cs deleted file mode 100644 index 4aa370b90..000000000 --- a/src/compilers/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace ConsoleApplication -{ - public class Program - { - public static void Main(string[] args) - { - } - } -} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-build3/ForwardingApp.cs b/src/dotnet/ForwardingApp.cs similarity index 100% rename from src/dotnet/commands/dotnet-build3/ForwardingApp.cs rename to src/dotnet/ForwardingApp.cs diff --git a/src/dotnet/commands/dotnet-build3/MSBuildForwardingApp.cs b/src/dotnet/commands/dotnet-build3/MSBuildForwardingApp.cs index d8037cd0c..d06bbbd81 100644 --- a/src/dotnet/commands/dotnet-build3/MSBuildForwardingApp.cs +++ b/src/dotnet/commands/dotnet-build3/MSBuildForwardingApp.cs @@ -21,8 +21,6 @@ namespace Microsoft.DotNet.Cli _forwardingApp = new ForwardingApp( GetMSBuildExePath(), argsToForward, - depsFile: GetDepsFile(), - runtimeConfig: GetRuntimeConfig(), environmentVariables: GetEnvironmentVariables()); } @@ -54,21 +52,10 @@ namespace Microsoft.DotNet.Cli return new Muxer().MuxerPath; } - private static string GetRuntimeConfig() - { - return Path.Combine(AppContext.BaseDirectory, "dotnet.runtimeconfig.json"); - } - - private static string GetDepsFile() - { - return Path.Combine(AppContext.BaseDirectory, "dotnet.deps.json"); - } - private static string GetMSBuildExePath() { return Path.Combine( AppContext.BaseDirectory, - "runtimes", "any", "native", s_msbuildExeName); } diff --git a/src/dotnet/commands/dotnet-restore/NuGet3.cs b/src/dotnet/commands/dotnet-restore/NuGet3.cs index 8033f96f6..7fd2a4e84 100644 --- a/src/dotnet/commands/dotnet-restore/NuGet3.cs +++ b/src/dotnet/commands/dotnet-restore/NuGet3.cs @@ -4,7 +4,6 @@ using System.IO; using System.Linq; using System.Reflection; using Microsoft.DotNet.Cli.Utils; -using NugetProgram = NuGet.CommandLine.XPlat.Program; namespace Microsoft.DotNet.Tools.Restore { @@ -20,18 +19,11 @@ namespace Microsoft.DotNet.Tools.Restore } prefixArgs.Add("restore"); - var result = Run(Enumerable.Concat( + var result = new NuGetForwardingApp(Enumerable.Concat( prefixArgs, - args).ToArray()); + args).ToArray()).Execute(); return result; } - - private static int Run(string[] nugetArgs) - { - var nugetAsm = typeof(NugetProgram).GetTypeInfo().Assembly; - var mainMethod = nugetAsm.EntryPoint; - return (int)mainMethod.Invoke(null, new object[] { nugetArgs }); - } } } diff --git a/src/dotnet/commands/dotnet-restore/NuGetForwardingApp.cs b/src/dotnet/commands/dotnet-restore/NuGetForwardingApp.cs new file mode 100644 index 000000000..a43e591e1 --- /dev/null +++ b/src/dotnet/commands/dotnet-restore/NuGetForwardingApp.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.InternalAbstractions; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; + +namespace Microsoft.DotNet.Tools.Restore +{ + public class NuGetForwardingApp + { + private const string s_nugetExeName = "NuGet.CommandLine.XPlat.dll"; + private readonly ForwardingApp _forwardingApp; + + public NuGetForwardingApp(string[] argsToForward) + { + _forwardingApp = new ForwardingApp( + GetNuGetExePath(), + argsToForward); + } + + public int Execute() + { + return _forwardingApp.Execute(); + } + + private static string GetNuGetExePath() + { + return Path.Combine( + AppContext.BaseDirectory, + s_nugetExeName); + } + } +} diff --git a/src/dotnet/commands/dotnet-restore/Program.cs b/src/dotnet/commands/dotnet-restore/Program.cs index 7d45322c1..c2ecf5205 100644 --- a/src/dotnet/commands/dotnet-restore/Program.cs +++ b/src/dotnet/commands/dotnet-restore/Program.cs @@ -17,35 +17,7 @@ namespace Microsoft.DotNet.Tools.Restore { DebugHelper.HandleDebugSwitch(ref args); - var app = new CommandLineApplication(false) - { - Name = "dotnet restore", - FullName = ".NET project dependency restorer", - Description = "Restores dependencies listed in project.json" - }; - - - app.OnExecute(() => - { - try - { - return NuGet3.Restore(args); - } - catch (InvalidOperationException e) - { - Console.WriteLine(e.Message); - - return -1; - } - catch (Exception e) - { - Console.WriteLine(e.Message); - - return -2; - } - }); - - return app.Execute(args); + return NuGet3.Restore(args); } } } diff --git a/src/dotnet/project.json b/src/dotnet/project.json index 5257e2d0d..abb9cc548 100644 --- a/src/dotnet/project.json +++ b/src/dotnet/project.json @@ -25,19 +25,7 @@ ] } }, - "publishOptions": { - "include": [ - "15.0/**", - "*.props", - "*.targets" - ] - }, "dependencies": { - "NuGet.Commands": { - "version": "3.5.0-rc1-1697", - "exclude": "compile" - }, - "NuGet.CommandLine.XPlat": "3.5.0-rc1-1697", "Newtonsoft.Json": "9.0.1", "System.Text.Encoding.CodePages": "4.0.1", "System.Diagnostics.FileVersionInfo": "4.0.0", @@ -71,17 +59,9 @@ "exclude": "compile" }, - "MSBuild": "0.1.0-preview-00029-160805", - "Microsoft.Build.Framework": "0.1.0-preview-00029-160805", - "Microsoft.Build.Tasks.Core": "0.1.0-preview-00029-160805", - "Microsoft.Build.Utilities.Core": "0.1.0-preview-00029-160805", - "Microsoft.Build.Targets": "0.1.0-preview-00029-160805", - "Microsoft.Build": "0.1.0-preview-00029-160805", - "Microsoft.Net.Compilers.netcore": "1.3.0", - "Microsoft.Net.Compilers.Targets.NetCore": "0.1.5-dev", - "Microsoft.Cci": "4.0.0-rc3-24128-00", - "Microsoft.Composition": "1.0.30", - "Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000002", + + "Microsoft.Build": "0.1.0-preview-00029-160805", + "Microsoft.Build.Framework": "0.1.0-preview-00029-160805", "Microsoft.DotNet.Core.Build.Tasks": { "target": "project" diff --git a/src/redist/project.json b/src/redist/project.json new file mode 100644 index 000000000..42f112267 --- /dev/null +++ b/src/redist/project.json @@ -0,0 +1,33 @@ +{ + "version": "1.0.0-featmsbuild-*", + "buildOptions": { + "emitEntryPoint": true + }, + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + }, + "tool_csc": "1.0.0-featmsbuild-*", + "dotnet": "1.0.0-featmsbuild-*", + "tool_nuget": "1.0.0-featmsbuild-*", + "tool_msbuild": "1.0.0-featmsbuild-*", + + "MSBuild": "0.1.0-preview-00029-160805", + "Microsoft.Build.Framework": "0.1.0-preview-00029-160805", + "Microsoft.Build.Tasks.Core": "0.1.0-preview-00029-160805", + "Microsoft.Build.Utilities.Core": "0.1.0-preview-00029-160805", + "Microsoft.Build.Targets": "0.1.0-preview-00029-160805", + "Microsoft.Build": "0.1.0-preview-00029-160805" + }, + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dnxcore50", + "netstandardapp1.5", + "portable-net45+win8", + "portable-net45+wp80+win8+wpa81+dnxcore50" + ] + } + } +} diff --git a/src/compilers/project.json b/src/tool_csc/project.json similarity index 92% rename from src/compilers/project.json rename to src/tool_csc/project.json index b2b6ed1b8..8240b45ff 100644 --- a/src/compilers/project.json +++ b/src/tool_csc/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "1.0.0-featmsbuild-*", "buildOptions": { "emitEntryPoint": true }, diff --git a/src/tool_msbuild/project.json b/src/tool_msbuild/project.json new file mode 100644 index 000000000..aaccda9a0 --- /dev/null +++ b/src/tool_msbuild/project.json @@ -0,0 +1,31 @@ +{ + "version": "1.0.0-featmsbuild-*", + "buildOptions": { + "emitEntryPoint": true + }, + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + }, + "MSBuild": "0.1.0-preview-00029-160805", + "Microsoft.Build.Framework": "0.1.0-preview-00029-160805", + "Microsoft.Build.Tasks.Core": "0.1.0-preview-00029-160805", + "Microsoft.Build.Utilities.Core": "0.1.0-preview-00029-160805", + "Microsoft.Build.Targets": "0.1.0-preview-00029-160805", + "Microsoft.Build": "0.1.0-preview-00029-160805", + "Microsoft.Net.Compilers.netcore": "1.3.0", + "Microsoft.Net.Compilers.Targets.NetCore": "0.1.5-dev", + "Microsoft.Cci": "4.0.0-rc3-24128-00", + "Microsoft.Composition": "1.0.30", + "Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000002" + }, + "frameworks": { + "netcoreapp1.0": { + "imports": [ + "dnxcore50", + "portable-net45+win8" + ] + } + } +} diff --git a/src/tool_nuget/project.json b/src/tool_nuget/project.json new file mode 100644 index 000000000..7af3cf800 --- /dev/null +++ b/src/tool_nuget/project.json @@ -0,0 +1,17 @@ +{ + "version": "1.0.0-featmsbuild-*", + "buildOptions": { + "emitEntryPoint": true + }, + "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.0.0" + }, + "NuGet.CommandLine.XPlat": "3.5.0-rc1-1697" + }, + "frameworks": { + "netcoreapp1.0": { + } + } +}