forked from osoykan-archive/ProductContext-EventSourcing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cake
54 lines (45 loc) · 1.28 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
var target = Argument("target", "Default");
var projectName = "ProductContext";
var solution = "./" + projectName + ".sln";
var deployable_project = "./src/" + projectName + ".WebApi/" + projectName + ".WebApi.csproj";
var distDirectory = Directory("./artifacts/");
var configuration = Argument<string>("cfg", "Release");
var framework = Argument<string>("framework", "netcoreapp2.0");
Task("Clean")
.Does(() =>
{
Information("Cleaning Binary folders");
CleanDirectories("./**/bin");
CleanDirectories("./**/obj");
CleanDirectories(distDirectory);
});
Task("Restore")
.IsDependentOn("Clean")
.Does(() =>
{
DotNetCoreRestore(solution);
});
Task("Build")
.IsDependentOn("Restore")
.Does(() =>
{
DotNetCoreBuild(solution, new DotNetCoreBuildSettings
{
Configuration = configuration,
});
});
Task("PublishWeb")
.IsDependentOn("Build")
.Does(() =>
{
var settings = new DotNetCorePublishSettings
{
Framework = framework,
Configuration = configuration,
OutputDirectory = distDirectory
};
DotNetCorePublish(deployable_project, settings);
});
Task("Default")
.IsDependentOn("PublishWeb");
RunTarget(target);