-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathConfig.cs
74 lines (51 loc) · 2.4 KB
/
Config.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.IO;
namespace Microsoft.DotNet.HotReload.Utils.Generator;
public class Config
{
public static ConfigBuilder Builder () => new ();
public class ConfigBuilder {
internal ConfigBuilder () {}
public bool Live {get; set;} = false;
public List<KeyValuePair<string,string>> Properties {get; set;} = new List<KeyValuePair<string,string>> ();
public string ProjectPath {get; set; } = "";
public string ScriptPath {get; set; } = "";
public string OutputSummaryPath {get; set; } = "";
public Config Bake () {
return new MsbuildConfig(this);
}
public List<string> EditAndContinueCapabilities {get; set; } = new List<string>();
public bool NoWarnUnknownCapabilities {get; set;} = false;
}
protected Config (ConfigBuilder builder) {
Live = builder.Live;
Properties = builder.Properties;
ProjectPath = builder.ProjectPath;
ScriptPath = builder.ScriptPath;
OutputSummaryPath = builder.OutputSummaryPath;
EditAndContinueCapabilities = builder.EditAndContinueCapabilities.ToArray();
NoWarnUnknownCapabilities = builder.NoWarnUnknownCapabilities;
}
public bool Live { get; }
/// Additional properties for msbuild
public IReadOnlyList<KeyValuePair<string,string>> Properties { get; }
/// the csproj for this project
public string ProjectPath { get; }
/// the files to watch for live changes
public string LiveCodingWatchPattern { get => "*.cs"; }
/// the directory to watch for live changes
public string LiveCodingWatchDir { get => Path.GetDirectoryName(ProjectPath) ?? "."; }
/// the path of a JSON script to drive the delta generation
public string ScriptPath { get; }
/// A path for a JSON file to collect the produced artifacts
public string OutputSummaryPath { get; }
/// A set of strings specifying edit and continue capabilities to pass to Roslyn
public string[] EditAndContinueCapabilities { get; }
/// If 'true' don't print a warning if a capability is not known.
public bool NoWarnUnknownCapabilities {get; }
}
internal class MsbuildConfig : Config {
internal MsbuildConfig (ConfigBuilder builder) : base (builder) {}
}