diff --git a/scripts/dotnet-cli-build/CompileTargets.cs b/scripts/dotnet-cli-build/CompileTargets.cs index 17056f0f8..60136fe78 100644 --- a/scripts/dotnet-cli-build/CompileTargets.cs +++ b/scripts/dotnet-cli-build/CompileTargets.cs @@ -18,7 +18,6 @@ namespace Microsoft.DotNet.Cli.Build public class CompileTargets { public static readonly string CoreCLRVersion = "1.0.2-rc2-24008"; - public static readonly string AppDepSdkVersion = "1.0.6-prerelease-00003"; public static readonly bool IsWinx86 = CurrentPlatform.IsWindows && CurrentArchitecture.Isx86; public static readonly string[] BinariesForCoreHost = new[] @@ -49,9 +48,9 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } - // Moving PrepareTargets.RestorePackages after PackagePkgProjects because managed code depends on the + // Moving PrepareTargets.RestorePackages after PackagePkgProjects because managed code depends on the // Microsoft.NETCore.App package that is created during PackagePkgProjects. - [Target(nameof(PrepareTargets.Init), nameof(PackagePkgProjects), nameof(PrepareTargets.RestorePackages), nameof(CompileStage1), nameof(CompileStage2))] + [Target(nameof(PrepareTargets.Init), nameof(CompileCoreHost), nameof(PackagePkgProjects), nameof(PrepareTargets.RestorePackages), nameof(CompileStage1), nameof(CompileStage2))] public static BuildTargetResult Compile(BuildTargetContext c) { return c.Success(); @@ -145,7 +144,7 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } - [Target(nameof(CompileCoreHost))] + [Target] public static BuildTargetResult PackagePkgProjects(BuildTargetContext c) { var buildVersion = c.BuildContext.Get("BuildVersion"); @@ -231,7 +230,6 @@ namespace Microsoft.DotNet.Cli.Build public static BuildTargetResult CompileStage1(BuildTargetContext c) { CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "src")); - CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test")); if (Directory.Exists(Dirs.Stage1)) { @@ -259,7 +257,6 @@ namespace Microsoft.DotNet.Cli.Build var configuration = c.BuildContext.Get("Configuration"); CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "src")); - CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test")); if (Directory.Exists(Dirs.Stage2)) { @@ -533,13 +530,6 @@ namespace Microsoft.DotNet.Cli.Build File.Delete(compilersDeps); File.Delete(compilersRuntimeConfig); - // Copy AppDeps - var result = CopyAppDeps(c, outputDir); - if (!result.Success) - { - return result; - } - // Generate .version file var version = buildVersion.NuGetVersion; var content = $@"{c.BuildContext["CommitHash"]}{Environment.NewLine}{version}{Environment.NewLine}"; @@ -548,53 +538,6 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } - private static BuildTargetResult CopyAppDeps(BuildTargetContext c, string outputDir) - { - var appDepOutputDir = Path.Combine(outputDir, "appdepsdk"); - Rmdir(appDepOutputDir); - Mkdirp(appDepOutputDir); - - // Find toolchain package - string packageId; - - if (CurrentPlatform.IsWindows) - { - if (CurrentArchitecture.Isx86) - { - // https://github.com/dotnet/cli/issues/1550 - c.Warn("Native compilation is not yet working on Windows x86"); - return c.Success(); - } - - packageId = "toolchain.win7-x64.Microsoft.DotNet.AppDep"; - } - else if (CurrentPlatform.IsUbuntu) - { - packageId = "toolchain.ubuntu.14.04-x64.Microsoft.DotNet.AppDep"; - } - else if (CurrentPlatform.IsCentOS || CurrentPlatform.IsRHEL || CurrentPlatform.IsDebian) - { - c.Warn($"Native compilation is not yet working on {CurrentPlatform.Current}"); - return c.Success(); - } - else if (CurrentPlatform.IsOSX) - { - packageId = "toolchain.osx.10.10-x64.Microsoft.DotNet.AppDep"; - } - else - { - return c.Failed("Unsupported OS Platform"); - } - - var appDepPath = Path.Combine( - Dirs.NuGetPackages, - packageId, - AppDepSdkVersion); - CopyRecursive(appDepPath, appDepOutputDir, overwrite: true); - - return c.Success(); - } - public static BuildTargetResult CrossgenSharedFx(BuildTargetContext c, string pathToAssemblies) { // Check if we need to skip crossgen @@ -620,7 +563,7 @@ namespace Microsoft.DotNet.Cli.Build // in CompileTargets and the one in the shared library project.json match and are updated in lock step, but long term // we need to be able to look at the project.lock.json file and figure out what version of Microsoft.NETCore.Runtime.CoreCLR // was used, and then select that version. - ExecSilent(Crossgen.GetCrossgenPathForVersion(CompileTargets.CoreCLRVersion), + ExecSilent(Crossgen.GetCrossgenPathForVersion(CoreCLRVersion), "-readytorun", "-in", file, "-out", tempPathName, "-platform_assemblies_paths", pathToAssemblies); File.Delete(file); diff --git a/scripts/dotnet-cli-build/PrepareTargets.cs b/scripts/dotnet-cli-build/PrepareTargets.cs index 56c06a8e6..ce65668ad 100644 --- a/scripts/dotnet-cli-build/PrepareTargets.cs +++ b/scripts/dotnet-cli-build/PrepareTargets.cs @@ -228,7 +228,7 @@ namespace Microsoft.DotNet.Cli.Build { var dotnet = DotNetCli.Stage0; - dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.Corehost) + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--fallbacksource", Dirs.Corehost) .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "src")) .Execute() .EnsureSuccessful(); diff --git a/scripts/update-dependencies/project.json b/scripts/update-dependencies/project.json index caf880730..4d0144085 100644 --- a/scripts/update-dependencies/project.json +++ b/scripts/update-dependencies/project.json @@ -9,7 +9,7 @@ "Microsoft.CSharp": "4.0.1-rc2-24008", "System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008", "Microsoft.DotNet.Cli.Build.Framework": "1.0.0-*", - "NuGet.Versioning": "3.5.0-beta-1130", + "NuGet.Versioning": "3.5.0-beta-1160", "Newtonsoft.Json": "7.0.1", "Octokit": "0.18.0", "Microsoft.Net.Http": "2.2.29" diff --git a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs index 49514db98..374d48b51 100644 --- a/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs +++ b/src/Microsoft.DotNet.Cli.Utils/CommandResolution/ProjectToolsCommandResolver.cs @@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli.Utils { public class ProjectToolsCommandResolver : ICommandResolver { - private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetStandardApp15; + private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; private static readonly CommandResolutionStrategy s_commandResolutionStrategy = CommandResolutionStrategy.ProjectToolsPackage; diff --git a/src/Microsoft.DotNet.Cli.Utils/project.json b/src/Microsoft.DotNet.Cli.Utils/project.json index 795108289..28c970794 100644 --- a/src/Microsoft.DotNet.Cli.Utils/project.json +++ b/src/Microsoft.DotNet.Cli.Utils/project.json @@ -7,10 +7,10 @@ "dependencies": { "Microsoft.DotNet.ProjectModel": "1.0.0-*", "Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-20459", - "NuGet.Versioning": "3.5.0-beta-1130", - "NuGet.Packaging": "3.5.0-beta-1130", - "NuGet.Frameworks": "3.5.0-beta-1130", - "NuGet.ProjectModel": "3.5.0-beta-1130" + "NuGet.Versioning": "3.5.0-beta-1160", + "NuGet.Packaging": "3.5.0-beta-1160", + "NuGet.Frameworks": "3.5.0-beta-1160", + "NuGet.ProjectModel": "3.5.0-beta-1160" }, "frameworks": { "net451": { @@ -22,8 +22,7 @@ }, "netstandard1.5": { "imports": [ - "portable-net45+wp80+win8+wpa81+dnxcore50", - "dnxcore50" + "portable-net45+wp80+win8+wpa81+dnxcore50" ], "dependencies": { "System.Diagnostics.Process": "4.1.0-rc2-24008" diff --git a/src/Microsoft.DotNet.Compiler.Common/project.json b/src/Microsoft.DotNet.Compiler.Common/project.json index 403a4ba60..5d64a9153 100644 --- a/src/Microsoft.DotNet.Compiler.Common/project.json +++ b/src/Microsoft.DotNet.Compiler.Common/project.json @@ -13,8 +13,7 @@ "frameworks": { "netstandard1.5": { "imports": [ - "portable-net45+wp80+win8+wpa81+dnxcore50", - "dnxcore50" + "portable-net45+wp80+win8+wpa81+dnxcore50" ] } }, diff --git a/src/Microsoft.DotNet.Files/project.json b/src/Microsoft.DotNet.Files/project.json index 33a563790..103d989d1 100644 --- a/src/Microsoft.DotNet.Files/project.json +++ b/src/Microsoft.DotNet.Files/project.json @@ -12,8 +12,7 @@ "frameworks": { "netstandard1.5": { "imports": [ - "portable-net45+wp80+win8+wpa81+dnxcore50", - "dnxcore50" + "portable-net45+wp80+win8+wpa81+dnxcore50" ] } }, diff --git a/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json b/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json index 74b6335ee..fd711f0eb 100644 --- a/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json +++ b/src/Microsoft.DotNet.ProjectModel.Workspaces/project.json @@ -12,8 +12,7 @@ "netstandard1.5": { "imports": [ "portable-net45+wp80+win8+wpa81+dnxcore50", - "portable-net45+win8", - "dnxcore50" + "portable-net45+win8" ] } } diff --git a/src/Microsoft.DotNet.ProjectModel/project.json b/src/Microsoft.DotNet.ProjectModel/project.json index 321004869..787d638ae 100644 --- a/src/Microsoft.DotNet.ProjectModel/project.json +++ b/src/Microsoft.DotNet.ProjectModel/project.json @@ -16,8 +16,8 @@ "version": "1.0.0-rc2-20221" }, "Newtonsoft.Json": "7.0.1", - "NuGet.Packaging": "3.5.0-beta-1130", - "NuGet.RuntimeModel": "3.5.0-beta-1130", + "NuGet.Packaging": "3.5.0-beta-1160", + "NuGet.RuntimeModel": "3.5.0-beta-1160", "System.Reflection.Metadata": "1.3.0-rc2-24008" }, "frameworks": { diff --git a/src/Microsoft.DotNet.TestFramework/project.json b/src/Microsoft.DotNet.TestFramework/project.json index 928b8102a..d6cb24b7f 100644 --- a/src/Microsoft.DotNet.TestFramework/project.json +++ b/src/Microsoft.DotNet.TestFramework/project.json @@ -12,8 +12,7 @@ "frameworks": { "netstandard1.5": { "imports": [ - "portable-net45+wp80+win8+wpa81+dnxcore50", - "dnxcore50" + "portable-net45+wp80+win8+wpa81+dnxcore50" ] } } diff --git a/src/corehost/cli/fxr/fx_muxer.cpp b/src/corehost/cli/fxr/fx_muxer.cpp index a9ebde2ed..f206922c9 100644 --- a/src/corehost/cli/fxr/fx_muxer.cpp +++ b/src/corehost/cli/fxr/fx_muxer.cpp @@ -292,7 +292,7 @@ int fx_muxer_t::parse_args_and_execute( } app_candidate = argv[cur_i]; - bool is_app_runnable = ends_with(app_candidate, _X(".dll"), false) || ends_with(app_candidate, _X(".exe"), false); + bool is_app_runnable = (ends_with(app_candidate, _X(".dll"), false) || ends_with(app_candidate, _X(".exe"), false)) && pal::realpath(&app_candidate); trace::verbose(_X("App %s runnable=[%d]"), app_candidate.c_str(), is_app_runnable); // If exec mode is on, then check we have a dll at this point if (exec_mode) @@ -300,6 +300,7 @@ int fx_muxer_t::parse_args_and_execute( if (!is_app_runnable) { trace::error(_X("dotnet exec needs a dll to execute. Try dotnet [--help]")); + *is_an_app = false; return InvalidArgFailure; } } diff --git a/src/dotnet/commands/dotnet-build/CompileContext.cs b/src/dotnet/commands/dotnet-build/CompileContext.cs index 2a9ff80bc..7469d5e9e 100644 --- a/src/dotnet/commands/dotnet-build/CompileContext.cs +++ b/src/dotnet/commands/dotnet-build/CompileContext.cs @@ -12,6 +12,7 @@ using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel.Utilities; using Microsoft.DotNet.Tools.Compiler; using Microsoft.Extensions.PlatformAbstractions; +using Microsoft.DotNet.ProjectModel.Compilation; namespace Microsoft.DotNet.Tools.Build { @@ -79,7 +80,7 @@ namespace Microsoft.DotNet.Tools.Build return true; } - foreach (var dependency in Sort(_rootProjectDependencies.ProjectDependenciesWithSources)) + foreach (var dependency in Sort(_rootProjectDependencies)) { var dependencyProjectContext = ProjectContext.Create(dependency.Path, dependency.Framework, new[] { _rootProject.RuntimeIdentifier }); @@ -514,31 +515,40 @@ namespace Microsoft.DotNet.Tools.Build executable.MakeCompilationOutputRunnable(); } - private static ISet Sort(Dictionary projects) + private static IEnumerable Sort(ProjectDependenciesFacade dependencies) { - var outputs = new HashSet(); + var outputs = new List(); - foreach (var pair in projects) + foreach (var pair in dependencies.Dependencies) { - Sort(pair.Value, projects, outputs); + Sort(pair.Value, dependencies, outputs); } - return outputs; + return outputs.Distinct(new ProjectComparer()); } - private static void Sort(ProjectDescription project, Dictionary projects, ISet outputs) + private static void Sort(LibraryExport node, ProjectDependenciesFacade dependencies, IList outputs) { // Sorts projects in dependency order so that we only build them once per chain - foreach (var dependency in project.Dependencies) + ProjectDescription projectDependency; + foreach (var dependency in node.Library.Dependencies) { - ProjectDescription projectDependency; - if (projects.TryGetValue(dependency.Name, out projectDependency)) - { - Sort(projectDependency, projects, outputs); - } + // Sort the children + Sort(dependencies.Dependencies[dependency.Name], dependencies, outputs); } - outputs.Add(project); + // Add this node to the list if it is a project + if (dependencies.ProjectDependenciesWithSources.TryGetValue(node.Library.Identity.Name, out projectDependency)) + { + // Add to the list of projects to build + outputs.Add(projectDependency); + } + } + + private class ProjectComparer : IEqualityComparer + { + public bool Equals(ProjectDescription x, ProjectDescription y) => string.Equals(x.Identity.Name, y.Identity.Name, StringComparison.Ordinal); + public int GetHashCode(ProjectDescription obj) => obj.Identity.Name.GetHashCode(); } public struct CompilerIO diff --git a/src/dotnet/commands/dotnet-build/ProjectDependenciesFacade.cs b/src/dotnet/commands/dotnet-build/ProjectDependenciesFacade.cs index cc5086404..5d8f9372d 100644 --- a/src/dotnet/commands/dotnet-build/ProjectDependenciesFacade.cs +++ b/src/dotnet/commands/dotnet-build/ProjectDependenciesFacade.cs @@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.Build { // projectName -> ProjectDescription public Dictionary ProjectDependenciesWithSources { get; } - public List Dependencies { get; } + public Dictionary Dependencies { get; } public ProjectDependenciesFacade(ProjectContext rootProject, string configValue) { @@ -25,7 +25,7 @@ namespace Microsoft.DotNet.Tools.Build // Build project references foreach (var dependency in Dependencies) { - var projectDependency = dependency.Library as ProjectDescription; + var projectDependency = dependency.Value.Library as ProjectDescription; if (projectDependency != null && projectDependency.Resolved && projectDependency.Project.Files.SourceFiles.Any()) { @@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Build } // todo make extension of ProjectContext? - private static List GetProjectDependencies(ProjectContext projectContext, string configuration) + private static Dictionary GetProjectDependencies(ProjectContext projectContext, string configuration) { // Create the library exporter var exporter = projectContext.CreateExporter(configuration); @@ -43,7 +43,7 @@ namespace Microsoft.DotNet.Tools.Build // Gather exports for the project var dependencies = exporter.GetDependencies().ToList(); - return dependencies; + return dependencies.ToDictionary(d => d.Library.Identity.Name); } } diff --git a/src/dotnet/commands/dotnet-publish/PublishCommand.cs b/src/dotnet/commands/dotnet-publish/PublishCommand.cs index 90ae4e8fb..f035550f2 100644 --- a/src/dotnet/commands/dotnet-publish/PublishCommand.cs +++ b/src/dotnet/commands/dotnet-publish/PublishCommand.cs @@ -1,21 +1,20 @@ // 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.Utils; -using Microsoft.DotNet.ProjectModel; -using Microsoft.DotNet.ProjectModel.Compilation; -using NuGet.Frameworks; using System; using System.Collections.Generic; using System.IO; using System.Linq; using Microsoft.DotNet.Cli.Compiler.Common; -using Microsoft.Extensions.PlatformAbstractions; +using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Files; -using Microsoft.DotNet.Tools.Common; -using Microsoft.DotNet.ProjectModel.Utilities; +using Microsoft.DotNet.ProjectModel; +using Microsoft.DotNet.ProjectModel.Compilation; using Microsoft.DotNet.ProjectModel.Graph; -using NuGet.Versioning; +using Microsoft.DotNet.ProjectModel.Utilities; +using Microsoft.DotNet.Tools.Common; +using Microsoft.Extensions.PlatformAbstractions; +using NuGet.Frameworks; namespace Microsoft.DotNet.Tools.Publish { @@ -134,6 +133,10 @@ namespace Microsoft.DotNet.Tools.Publish .ToDictionary(e => e.Library.Identity.Name); var collectExclusionList = context.IsPortable ? GetExclusionList(context, packageExports) : new HashSet(); + // Get the output paths used by the call to `dotnet build` above (since we didn't pass `--output`, they will be different from + // our current output paths) + var buildOutputPaths = context.GetOutputPaths(configuration, buildBasePath); + var exports = exporter.GetAllExports(); foreach (var export in exports.Where(e => !collectExclusionList.Contains(e.Library.Identity.Name))) { @@ -141,6 +144,19 @@ namespace Microsoft.DotNet.Tools.Publish PublishAssetGroups(export.RuntimeAssemblyGroups, outputPath, nativeSubdirectories: false, includeRuntimeGroups: context.IsPortable); PublishAssetGroups(export.NativeLibraryGroups, outputPath, nativeSubdirectories, includeRuntimeGroups: context.IsPortable); + + var runtimeAssetsToCopy = export.RuntimeAssets.Where(a => ShouldCopyExportRuntimeAsset(context, buildOutputPaths, export, a)); + runtimeAssetsToCopy.StructuredCopyTo(outputPath, outputPaths.IntermediateOutputDirectoryPath); + } + + if (context.ProjectFile.HasRuntimeOutput(configuration) && !context.TargetFramework.IsDesktop()) + { + PublishFiles( + new[] { + buildOutputPaths.RuntimeFiles.DepsJson, + buildOutputPaths.RuntimeFiles.RuntimeConfigJson + }, + outputPath); } if (options.PreserveCompilationContext.GetValueOrDefault()) @@ -151,9 +167,6 @@ namespace Microsoft.DotNet.Tools.Publish } } - var buildOutputPaths = context.GetOutputPaths(configuration, buildBasePath, null); - PublishBuildOutputFiles(buildOutputPaths, context, outputPath, Configuration); - var contentFiles = new ContentFiles(context); contentFiles.StructuredCopyTo(outputPath); @@ -171,59 +184,26 @@ namespace Microsoft.DotNet.Tools.Publish return true; } - private void PublishBuildOutputFiles(OutputPaths buildOutputPaths, ProjectContext context, string outputPath, string configuration) + /// + /// Filters which export's RuntimeAssets should get copied to the output path. + /// + /// + /// True if the asset should be copied to the output path; otherwise, false. + /// + private static bool ShouldCopyExportRuntimeAsset(ProjectContext context, OutputPaths buildOutputPaths, LibraryExport export, LibraryAsset asset) { - List filesToPublish = new List(); + // The current project has the host .exe in its runtime assets, but it shouldn't be copied + // to the output path during publish. The host will come from the export that has the real host in it. - string[] buildOutputFiles = null; - - if (context.ProjectFile.HasRuntimeOutput(configuration)) + if (context.RootProject.Identity == export.Library.Identity) { - Reporter.Verbose.WriteLine($"publish: using runtime build output files"); - - buildOutputFiles = new string[] + if (asset.ResolvedPath == buildOutputPaths.RuntimeFiles.Executable) { - buildOutputPaths.RuntimeFiles.DepsJson, - buildOutputPaths.RuntimeFiles.RuntimeConfigJson, - buildOutputPaths.RuntimeFiles.Config, - buildOutputPaths.RuntimeFiles.Assembly, - buildOutputPaths.RuntimeFiles.PdbPath, - Path.ChangeExtension(buildOutputPaths.RuntimeFiles.Assembly, "xml") - }; - - filesToPublish.AddRange(buildOutputPaths.RuntimeFiles.Resources()); - } - else - { - Reporter.Verbose.WriteLine($"publish: using compilation build output files"); - - buildOutputFiles = new string[] - { - buildOutputPaths.CompilationFiles.Assembly, - buildOutputPaths.CompilationFiles.PdbPath, - Path.ChangeExtension(buildOutputPaths.CompilationFiles.Assembly, "xml") - }; - - filesToPublish.AddRange(buildOutputPaths.CompilationFiles.Resources()); - } - - foreach (var buildOutputFile in buildOutputFiles) - { - if (File.Exists(buildOutputFile)) - { - filesToPublish.Add(buildOutputFile); - } - else - { - Reporter.Verbose.WriteLine($"publish: build output file not found {buildOutputFile} "); + return false; } } - - Reporter.Verbose.WriteLine($"publish: Copying build output files:\n {string.Join("\n", filesToPublish)}"); - PublishFiles( - filesToPublish, - outputPath); + return true; } private bool InvokeBuildOnProject(ProjectContext context, string buildBasePath, string configuration) diff --git a/src/dotnet/project.json b/src/dotnet/project.json index e8baa2eec..e6bd4fb92 100644 --- a/src/dotnet/project.json +++ b/src/dotnet/project.json @@ -17,10 +17,10 @@ ], "dependencies": { "NuGet.Commands": { - "version": "3.5.0-beta-1130", + "version": "3.5.0-beta-1160", "exclude": "compile" }, - "NuGet.CommandLine.XPlat": "3.5.0-beta-1130", + "NuGet.CommandLine.XPlat": "3.5.0-beta-1160", "Newtonsoft.Json": "7.0.1", "System.Text.Encoding.CodePages": "4.0.1-rc2-24008", "System.Diagnostics.FileVersionInfo": "4.0.0-rc2-24008", @@ -55,13 +55,13 @@ } }, "frameworks": { - "netstandard1.5": { - "imports": [ - "dnxcore50", - "netstandardapp1.5", - "portable-net45+win8", - "portable-net45+wp80+win8+wpa81+dnxcore50" - ] + "netcoreapp1.0": { + "imports": [ + "dnxcore50", + "netstandardapp1.5", + "portable-net45+win8", + "portable-net45+wp80+win8+wpa81+dnxcore50" + ] } } } diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index fee3a0417..a8889d522 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests { public class GivenAProjectToolsCommandResolver { - private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetStandardApp15; + private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; private static readonly string s_liveProjectDirectory = Path.Combine(AppContext.BaseDirectory, "TestAssets/TestProjects/AppWithToolDependency"); diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/project.json b/test/Microsoft.DotNet.Cli.Utils.Tests/project.json index 2f693bd56..37cb5ae94 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/project.json +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/project.json @@ -10,10 +10,10 @@ }, "System.Diagnostics.TraceSource": "4.0.0-rc2-24008", "System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008", - "NuGet.Versioning": "3.5.0-beta-1130", - "NuGet.Packaging": "3.5.0-beta-1130", - "NuGet.Frameworks": "3.5.0-beta-1130", - "NuGet.ProjectModel": "3.5.0-beta-1130", + "NuGet.Versioning": "3.5.0-beta-1160", + "NuGet.Packaging": "3.5.0-beta-1160", + "NuGet.Frameworks": "3.5.0-beta-1160", + "NuGet.ProjectModel": "3.5.0-beta-1160", "Microsoft.DotNet.ProjectModel": { "target": "project" }, diff --git a/test/dotnet-publish.Tests/PublishAppWithDependencies.cs b/test/dotnet-publish.Tests/PublishAppWithDependencies.cs new file mode 100644 index 000000000..df2907f82 --- /dev/null +++ b/test/dotnet-publish.Tests/PublishAppWithDependencies.cs @@ -0,0 +1,46 @@ +// 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 System.IO; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace Microsoft.DotNet.Tools.Publish.Tests +{ + public class PublishAppWithDependencies : TestBase + { + [Fact] + public void PublishTestAppWithContentPackage() + { + var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithContentPackage") + .WithLockFiles(); + + var publishCommand = new PublishCommand(testInstance.TestRoot); + var publishResult = publishCommand.Execute(); + + publishResult.Should().Pass(); + + var publishDir = publishCommand.GetOutputDirectory(portable: false); + + publishDir.Should().HaveFiles(new[] + { + $"AppWithContentPackage{publishCommand.GetExecutableExtension()}", + "AppWithContentPackage.dll", + "AppWithContentPackage.deps.json" + }); + + // these files come from the contentFiles of the SharedContentA dependency + publishDir + .Sub("scripts") + .Should() + .Exist() + .And + .HaveFile("run.cmd"); + + publishDir + .Should() + .HaveFile("config.xml"); + } + } +} diff --git a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs index e431ca7ee..be0286aaf 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs @@ -21,7 +21,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests { var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets")); var testInstance = - testAssetManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests").WithLockFiles(); + testAssetManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests"); _projectFilePath = Path.Combine(testInstance.TestRoot, "project.json"); var contexts = ProjectContext.CreateContextForEachFramework( @@ -29,6 +29,11 @@ namespace Microsoft.Dotnet.Tools.Test.Tests null, PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers()); + // Restore the project again in the destination to resolve projects + // Since the lock file has project relative paths in it, those will be broken + // unless we re-restore + new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass(); + _defaultOutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0"); } diff --git a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs index a3e4fd1af..65ed16756 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs @@ -20,7 +20,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests public GivenThatWeWantToUseDotnetTestE2EInDesignTime() { var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets")); - var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests").WithLockFiles(); + var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests"); _projectFilePath = Path.Combine(testInstance.TestRoot, "project.json"); var contexts = ProjectContext.CreateContextForEachFramework( @@ -28,6 +28,11 @@ namespace Microsoft.Dotnet.Tools.Test.Tests null, PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers()); + // Restore the project again in the destination to resolve projects + // Since the lock file has project relative paths in it, those will be broken + // unless we re-restore + new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass(); + _outputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0"); var buildCommand = new BuildCommand(_projectFilePath); var result = buildCommand.Execute(); diff --git a/tools/RuntimeGraphGenerator/project.json b/tools/RuntimeGraphGenerator/project.json index 12f43b9c6..efe35c501 100644 --- a/tools/RuntimeGraphGenerator/project.json +++ b/tools/RuntimeGraphGenerator/project.json @@ -4,8 +4,8 @@ "emitEntryPoint": true }, "dependencies": { - "NuGet.RuntimeModel": "3.5.0-beta-1130", - "NuGet.Versioning": "3.5.0-beta-1130", + "NuGet.RuntimeModel": "3.5.0-beta-1160", + "NuGet.Versioning": "3.5.0-beta-1160", "System.CommandLine": "0.1.0-e160119-1", "System.Runtime.Serialization.Json": "4.0.2-rc2-24008", "Microsoft.DotNet.ProjectModel": "1.0.0-*", diff --git a/tools/appdep/project.json b/tools/appdep/project.json deleted file mode 100644 index d0388306d..000000000 --- a/tools/appdep/project.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "1.0.0-*", - "compilationOptions": { - "emitEntryPoint": true - }, - "dependencies": { - "NETStandard.Library": "1.5.0-rc2-24008", - "Microsoft.DotNet.AppDep": "1.0.6-prerelease-00003" - }, - "frameworks": { - "netstandardapp1.5": { - "imports": "dnxcore50" - } - } -}