From 8831e93ddde01ec1c26264cb4a49e81e89b2cc31 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 13 May 2016 15:10:20 -0700 Subject: [PATCH] Copy csproj reference assemblies to build output --- .../Executable.cs | 2 +- .../LibraryExporterExtensions.cs | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.DotNet.Compiler.Common/Executable.cs b/src/Microsoft.DotNet.Compiler.Common/Executable.cs index 69414a293..29a602a70 100644 --- a/src/Microsoft.DotNet.Compiler.Common/Executable.cs +++ b/src/Microsoft.DotNet.Compiler.Common/Executable.cs @@ -161,7 +161,7 @@ namespace Microsoft.DotNet.Cli.Compiler.Common var exports = exporter.GetAllExports().ToList(); WriteConfigurationFiles(exports, exports, includeDevConfig: true); - var projectExports = exporter.GetDependencies(LibraryType.Project); + var projectExports = exporter.GetAllProjectTypeDependencies(); CopyAssemblies(projectExports); CopyAssets(projectExports); diff --git a/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs b/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs index 52322101e..7e3440c02 100644 --- a/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs +++ b/src/Microsoft.DotNet.Compiler.Common/LibraryExporterExtensions.cs @@ -1,16 +1,23 @@ -using System.Collections.Generic; +// 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.Collections.Generic; using System.IO; -using System; using System.Linq; -using Microsoft.DotNet.ProjectModel; using Microsoft.DotNet.ProjectModel.Compilation; using Microsoft.DotNet.ProjectModel.Graph; -using Microsoft.Extensions.DependencyModel; namespace Microsoft.DotNet.Cli.Compiler.Common { public static class LibraryExporterExtensions { + public static IEnumerable GetAllProjectTypeDependencies(this LibraryExporter exporter) + { + return + exporter.GetDependencies(LibraryType.Project) + .Concat(exporter.GetDependencies(LibraryType.MSBuildProject)); + } + public static void CopyTo(this IEnumerable assets, string destinationPath) { if (!Directory.Exists(destinationPath))