2015-11-16 11:21:57 -08:00
|
|
|
|
// 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.
|
2015-10-13 14:31:29 -07:00
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2015-11-27 16:19:54 -08:00
|
|
|
|
using Microsoft.DotNet.ProjectModel.Graph;
|
2015-10-13 14:31:29 -07:00
|
|
|
|
|
2015-11-27 16:19:54 -08:00
|
|
|
|
namespace Microsoft.DotNet.ProjectModel
|
2015-10-13 14:31:29 -07:00
|
|
|
|
{
|
|
|
|
|
public class ProjectDescription : LibraryDescription
|
|
|
|
|
{
|
|
|
|
|
// Create an unresolved project description
|
|
|
|
|
public ProjectDescription(string name, string path)
|
|
|
|
|
: base(
|
|
|
|
|
new LibraryIdentity(name, LibraryType.Project),
|
2015-10-21 15:21:14 -07:00
|
|
|
|
string.Empty, // Projects don't have hashes
|
2015-10-13 14:31:29 -07:00
|
|
|
|
path,
|
|
|
|
|
Enumerable.Empty<LibraryRange>(),
|
|
|
|
|
framework: null,
|
|
|
|
|
resolved: false,
|
|
|
|
|
compatible: false)
|
2016-08-09 16:17:10 -07:00
|
|
|
|
{
|
|
|
|
|
}
|
2015-10-13 14:31:29 -07:00
|
|
|
|
|
|
|
|
|
public ProjectDescription(
|
|
|
|
|
LibraryRange libraryRange,
|
|
|
|
|
Project project,
|
|
|
|
|
IEnumerable<LibraryRange> dependencies,
|
|
|
|
|
TargetFrameworkInformation targetFrameworkInfo,
|
|
|
|
|
bool resolved) :
|
|
|
|
|
base(
|
|
|
|
|
new LibraryIdentity(project.Name, project.Version, LibraryType.Project),
|
2015-10-21 15:21:14 -07:00
|
|
|
|
string.Empty, // Projects don't have hashes
|
2015-10-13 14:31:29 -07:00
|
|
|
|
project.ProjectFilePath,
|
|
|
|
|
dependencies,
|
|
|
|
|
targetFrameworkInfo.FrameworkName,
|
|
|
|
|
resolved,
|
|
|
|
|
compatible: true)
|
|
|
|
|
{
|
|
|
|
|
Project = project;
|
|
|
|
|
TargetFrameworkInfo = targetFrameworkInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Project Project { get; }
|
|
|
|
|
|
|
|
|
|
public TargetFrameworkInformation TargetFrameworkInfo { get; }
|
2016-01-26 06:39:13 -08:00
|
|
|
|
|
2016-02-03 10:57:25 -08:00
|
|
|
|
public OutputPaths GetOutputPaths(string buildBasePath, string solutionRootPath, string configuration, string runtime)
|
2016-01-26 06:39:13 -08:00
|
|
|
|
{
|
2016-02-03 10:57:25 -08:00
|
|
|
|
return OutputPathsCalculator.GetOutputPaths(Project,
|
|
|
|
|
Framework,
|
|
|
|
|
runtimeIdentifier: runtime,
|
|
|
|
|
configuration: configuration,
|
|
|
|
|
solutionRootPath: solutionRootPath,
|
|
|
|
|
buildBasePath: buildBasePath,
|
|
|
|
|
outputPath: null);
|
2016-01-26 06:39:13 -08:00
|
|
|
|
}
|
2015-10-13 14:31:29 -07:00
|
|
|
|
}
|
|
|
|
|
}
|