forked from gircore/gir.core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Loader.cs
33 lines (25 loc) · 1008 Bytes
/
Loader.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
using System.Collections.Generic;
using System.Linq;
using GirLoader.Helper;
namespace GirLoader;
public delegate Input.Repository? ResolveInclude(Output.Include include);
public class Loader
{
private readonly ResolveInclude _includeResolver;
public Loader(ResolveInclude includeResolver)
{
_includeResolver = includeResolver;
}
public static void EnableDebugOutput()
=> Log.EnableDebugOutput();
public static void EnableVerboseOutput()
=> Log.EnableVerboseOutput();
public IEnumerable<Output.Repository> Load(IEnumerable<Input.Repository> inputRepositories)
{
Log.Information($"Initialising with {inputRepositories.Count()} toplevel repositories");
var outputRepositories = inputRepositories.CreateOutputRepositories(_includeResolver);
var orderedOutputRepositories = outputRepositories.OrderByDependencies();
orderedOutputRepositories.ResolveReferences();
return orderedOutputRepositories;
}
}