Welcome to mirror list, hosted at ThFree Co, Russian Federation.

SolutionInfo.cs « ProjectModel « tasks « build - github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: dce2f0bdd3ba7f79120362458a307bd3a46e6254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.IO;

namespace RepoTasks.ProjectModel
{
    internal class SolutionInfo
    {
        public SolutionInfo(string fullPath, string configName, IReadOnlyList<ProjectInfo> projects, bool shouldBuild, bool shipped)
        {
            if (string.IsNullOrEmpty(fullPath))
            {
                throw new ArgumentException(nameof(fullPath));
            }

            if (string.IsNullOrEmpty(configName))
            {
                throw new ArgumentException(nameof(configName));
            }

            Directory = Path.GetDirectoryName(fullPath);
            FullPath = fullPath;
            ConfigName = configName;
            Projects = projects ?? throw new ArgumentNullException(nameof(projects));
            ShouldBuild = shouldBuild;
            Shipped = shipped;

            foreach (var proj in Projects)
            {
                proj.SolutionInfo = this;
            }
        }

        public string Directory { get; }
        public string FullPath { get; }
        public string ConfigName { get; }
        public IReadOnlyList<ProjectInfo> Projects { get; }
        public bool ShouldBuild { get; }
        public bool Shipped { get; }
    }
}