2016-08-22 19:21:34 +00: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.
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Microsoft.Build.Construction;
|
2016-10-28 01:46:43 +00:00
|
|
|
|
using Microsoft.DotNet.Internal.ProjectModel;
|
2016-08-22 19:21:34 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.ProjectJsonMigration
|
|
|
|
|
{
|
2016-10-28 01:46:43 +00:00
|
|
|
|
internal class MigrationRuleInputs
|
2016-08-22 19:21:34 +00:00
|
|
|
|
{
|
2016-09-22 00:27:02 +00:00
|
|
|
|
public ProjectRootElement ProjectXproj { get; }
|
|
|
|
|
|
2016-08-22 19:21:34 +00:00
|
|
|
|
public ProjectRootElement OutputMSBuildProject { get; }
|
|
|
|
|
|
|
|
|
|
public ProjectItemGroupElement CommonItemGroup { get; }
|
|
|
|
|
|
|
|
|
|
public ProjectPropertyGroupElement CommonPropertyGroup { get; }
|
|
|
|
|
|
2016-09-27 04:40:11 +00:00
|
|
|
|
public List<ProjectContext> ProjectContexts { get; }
|
2016-08-22 19:21:34 +00:00
|
|
|
|
|
|
|
|
|
public ProjectContext DefaultProjectContext
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2016-12-09 03:53:35 +00:00
|
|
|
|
return ProjectContexts.FirstOrDefault();
|
2016-08-22 19:21:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-04 20:25:48 +00:00
|
|
|
|
public bool IsMultiTFM => ProjectContexts.Count() > 1;
|
|
|
|
|
|
2016-08-22 19:21:34 +00:00
|
|
|
|
public MigrationRuleInputs(
|
|
|
|
|
IEnumerable<ProjectContext> projectContexts,
|
2016-08-23 20:50:05 +00:00
|
|
|
|
ProjectRootElement outputMSBuildProject,
|
2016-08-22 19:21:34 +00:00
|
|
|
|
ProjectItemGroupElement commonItemGroup,
|
2016-09-22 00:27:02 +00:00
|
|
|
|
ProjectPropertyGroupElement commonPropertyGroup,
|
|
|
|
|
ProjectRootElement projectXproj=null)
|
2016-08-22 19:21:34 +00:00
|
|
|
|
{
|
2016-09-22 00:27:02 +00:00
|
|
|
|
ProjectXproj = projectXproj;
|
2016-09-27 04:40:11 +00:00
|
|
|
|
ProjectContexts = projectContexts.ToList();
|
2016-08-23 20:50:05 +00:00
|
|
|
|
OutputMSBuildProject = outputMSBuildProject;
|
2016-08-22 19:21:34 +00:00
|
|
|
|
CommonItemGroup = commonItemGroup;
|
|
|
|
|
CommonPropertyGroup = commonPropertyGroup;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|