-
Notifications
You must be signed in to change notification settings - Fork 183
Expand file tree
/
Copy pathProgram.cs
More file actions
83 lines (74 loc) · 3.13 KB
/
Program.cs
File metadata and controls
83 lines (74 loc) · 3.13 KB
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
75
76
77
78
79
80
81
82
83
namespace FakeItEasy.Build
{
using System.Collections.Generic;
using System.IO;
using SimpleExec;
using static Bullseye.Targets;
using static SimpleExec.Command;
public class Program
{
private static readonly string[] ProjectsToPack =
{
"src/FakeItEasy/FakeItEasy.csproj",
"src/FakeItEasy.Analyzer.CSharp/FakeItEasy.Analyzer.CSharp.csproj",
"src/FakeItEasy.Analyzer.VisualBasic/FakeItEasy.Analyzer.VisualBasic.csproj"
};
private static readonly string[] Pdbs =
{
"src/FakeItEasy/bin/Release/net40/FakeItEasy.pdb",
"src/FakeItEasy/bin/Release/net45/FakeItEasy.pdb",
"src/FakeItEasy/bin/Release/netstandard1.6/FakeItEasy.pdb",
"src/FakeItEasy/bin/Release/netstandard2.0/FakeItEasy.pdb",
"src/FakeItEasy.Analyzer.CSharp/bin/Release/FakeItEasy.Analyzer.Csharp.pdb",
"src/FakeItEasy.Analyzer.VisualBasic/bin/Release/FakeItEasy.Analyzer.VisualBasic.pdb"
};
private static readonly IReadOnlyDictionary<string, string[]> TestSuites = new Dictionary<string, string[]>
{
["unit"] = new[]
{
"tests/FakeItEasy.Tests",
"tests/FakeItEasy.Analyzer.CSharp.Tests",
"tests/FakeItEasy.Analyzer.VisualBasic.Tests",
},
["integ"] = new[]
{
"tests/FakeItEasy.IntegrationTests",
"tests/FakeItEasy.IntegrationTests.VB",
},
["spec"] = new[]
{
"tests/FakeItEasy.Specs"
},
["approve"] = new[]
{
"tests/FakeItEasy.Tests.Approval"
}
};
public static void Main(string[] args)
{
Target("default", DependsOn("unit", "integ", "spec", "approve", "pack"));
Target(
"build",
() => Run("dotnet", "build FakeItEasy.sln -c Release /maxcpucount /nr:false /verbosity:minimal /nologo /bl:artifacts/logs/build.binlog"));
foreach (var testSuite in TestSuites)
{
Target(
testSuite.Key,
DependsOn("build"),
forEach: testSuite.Value,
action: testDirectory => Run("dotnet", "test --configuration Release --no-build -- RunConfiguration.NoAutoReporters=true", testDirectory));
}
Target(
"pack",
DependsOn("build", "pdbgit"),
forEach: ProjectsToPack,
action: project => Run("dotnet", $"pack {project} --configuration Release --no-build --output {Path.GetFullPath("artifacts/output")}"));
Target(
"pdbgit",
DependsOn("build"),
forEach: Pdbs,
action: pdb => Run(ToolPaths.PdbGit, $"-u https://github.com/FakeItEasy/FakeItEasy -s {pdb}"));
RunTargetsAndExit(args, messageOnly: ex => ex is NonZeroExitCodeException);
}
}
}