~n0mn0m/Statiq.Blog

ref: e954b158815086aa609e9c8c9bdc677aa131c36e Statiq.Blog/build.cake -rw-r--r-- 1.7 KiB
e954b158n0mn0m Correct post template and clean up commands 6 months ago
                                                                                
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
var target = Argument("target", "Build");
var configuration = Argument("configuration", "Release");

Task("Clean")
    .Does(() => DeleteDirectory($"./src/bin/**", new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./src/logs", new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./src/wwwroot", new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./temp", new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./output", new DeleteDirectorySettings {Recursive = true, Force = true}));

Task("Build")
    .Does(() => DotNetCoreRun("./src/src.csproj"));

Task("Preview")
    .Does(() => DeleteDirectory("./temp",  new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./output",  new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DotNetCoreRun("./src/src.csproj", new ProcessArgumentBuilder()
        .Append("preview")
        .Append("--nocache")
        .Append("--root=/Users/n0mn0m/RiderProjects/Unexpectedeof.Blog/")));
        
Task("Run")
    .Does(() => DeleteDirectory("./temp",  new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DeleteDirectory("./output",  new DeleteDirectorySettings {Recursive = true, Force = true}))
    .Does(() => DotNetCoreRun("./src/src.csproj", new ProcessArgumentBuilder()
        .Append("--root=/Users/n0mn0m/RiderProjects/Unexpectedeof.Blog/")
        .Append("--log-file=run_")
        .Append("--nocache")));

Task("Default")
    .IsDependentOn("Build");

RunTarget(target);