-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBuildTools.cs
More file actions
46 lines (36 loc) · 1.3 KB
/
Copy pathBuildTools.cs
File metadata and controls
46 lines (36 loc) · 1.3 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
using System;
using System.Runtime.CompilerServices;
using MSharp.Build.Tools;
namespace MSharp.Build
{
class BuildTools : Builder
{
protected override void AddTasks()
{
Console.WriteLine("Help: http://learn.msharp.co.uk/#/Install/README");
Add(() => InstallReplaceInFiles());
Add(() => InstallAcceleratePackageRestore());
Add(() => InstallNodeJs());
Add(() => InstallYarn());
Add(() => InstallTypescript());
Add(() => InstallWebPack());
Add(() => InstallBower());
}
void InstallReplaceInFiles() => Install<ReplaceInFile>();
void InstallAcceleratePackageRestore() => Install<AcceleratePackageRestore>();
void InstallNodeJs() => Install<NodeJs>();
void InstallYarn() => Install<Yarn>();
void InstallTypescript() => Install<Typescript>();
void InstallWebPack() => Install<WebPack>();
void InstallBower() => Install<Bower>();
void Install<T>([CallerMemberName] string step = "") where T : BuildTool, new()
{
var builder = new T();
try
{
builder.Install();
}
finally { Log(string.Join(Environment.NewLine, builder.Logs), step); }
}
}
}