forked from jeremytammik/RevitLookup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.Compile.cs
30 lines (27 loc) · 1.03 KB
/
Build.Compile.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
using System.IO.Enumeration;
using Nuke.Common.Tools.DotNet;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
sealed partial class Build
{
Target Compile => _ => _
.DependsOn(Clean)
.Executes(() =>
{
foreach (var configuration in GlobBuildConfigurations())
DotNetBuild(settings => settings
.SetConfiguration(configuration)
.SetVersion(Version)
.SetVerbosity(DotNetVerbosity.minimal));
});
List<string> GlobBuildConfigurations()
{
var configurations = Solution.Configurations
.Select(pair => pair.Key)
.Select(config => config.Remove(config.LastIndexOf('|')))
.Where(config => Configurations.Any(wildcard => FileSystemName.MatchesSimpleExpression(wildcard, config)))
.ToList();
Assert.NotEmpty(configurations,
$"No solution configurations have been found. Pattern: {string.Join(" | ", Configurations)}");
return configurations;
}
}