forked from MatkovIvan/Cake.Unity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cake
54 lines (46 loc) · 1.18 KB
/
setup.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
var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");
var solution = "./src/Cake.Unity.sln";
var project = "./src/Cake.Unity/Cake.Unity.csproj";
var test = "./src/Cake.Unity.Tests/Cake.Unity.Tests.csproj";
Task("Clean")
.Does(() =>
{
DotNetCoreClean(solution);
DeleteFiles(GetFiles("./artifacts/*.nupkg"));
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore(solution);
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
DotNetCoreBuild(solution, new DotNetCoreBuildSettings { Configuration = configuration });
});
Task("Test")
.IsDependentOn("Build")
.Does(() =>
{
DotNetCoreTest(test, new DotNetCoreTestSettings()
{
Configuration = configuration,
NoBuild = true
});
});
Task("Package")
.IsDependentOn("Test")
.Does(() =>
{
DotNetCorePack(project, new DotNetCorePackSettings
{
Configuration = configuration,
OutputDirectory = "./artifacts/"
});
});
Task("Default")
.IsDependentOn("Build");
RunTarget(target);