forked from bubkoo/html-to-image
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
55 lines (49 loc) · 1.66 KB
/
build.cake
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
#tool "nuget:?package=Microsoft.TestPlatform&version=15.7.0"
#addin nuget:?package=Cake.Npm&version=0.17.0
#addin nuget:?package=Cake.Json&version=4.0.0
#addin nuget:?package=Newtonsoft.Json&version=9.0.1
using System;
using System.IO;
////////////////////////////////////////////////////////////////
// Use always this structure. If you don't need to run some //
// task, comment the code inside it. //
////////////////////////////////////////////////////////////////
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release"); //Here you can configure if you want do debug or release
var install=Task("Install")
.Does(() =>
{
Information("Starting Install");
NpmCi();
Information("Ending Install");
});
var build=Task("Build")
.Does(() =>
{
Information("Starting Build");
var conf = ParseJsonFromFile("package.json");
if(conf["scripts"]["build"]!=null)
NpmRunScript("build");
Information("Ending Build");
});
var tests = Task("Tests")
.Does(()=>
{
Information("Starting Tests");
var conf = ParseJsonFromFile("package.json");
if(conf["scripts"]["test"]!=null)
NpmRunScript("test");
Information("Ending Tests");
});
var package = Task("Package")
.Does(()=>
{
Information("Starting Pack");
CreateDirectory("./artifacts");
Environment.CurrentDirectory =@".\artifacts";
NpmPack(settings => settings.FromSource("./.."));
Information("Ending Pack");
});
Task("Default")
.IsDependentOn("Package");
RunTarget(target);