-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathThirdPartyConfig.cs
44 lines (39 loc) · 1.42 KB
/
ThirdPartyConfig.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
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
namespace GitImporter
{
public class ThirdPartyConfig
{
public class LabelMapping
{
public string Label { get; set; }
public string Commit { get; set; }
}
public class Mapping
{
public string From { get; set; }
public string To { get; set; }
}
public class ThirdPartyModule
{
public string Name { get; set; }
public List<string> AlternateNames { get; set; }
public string ConfigSpecRegex { get; set; }
public List<Mapping> ProjectFileMappings { get; set; }
public List<LabelMapping> Labels { get; set; }
}
public string Root { get; set; }
public string GitUrl { get; set; }
public string ProjectFileRegex { get; set; }
public string ConfigSpecRegex { get; set; }
public string ThirdPartyRegex { get; set; }
public List<ThirdPartyModule> Modules { get; set; }
public static ThirdPartyConfig ReadFromFile(string configFile)
{
var serializer = new XmlSerializer(typeof(ThirdPartyConfig));
using (var stream = new FileStream(configFile, FileMode.Open))
return (ThirdPartyConfig)serializer.Deserialize(stream);
}
}
}