-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.cake
46 lines (39 loc) · 1.33 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
var target = Argument<string>("target", "Build");
var configuration = Argument<string>("configuration", "Release");
var tshockRepo = "https://github.com/Pryaxis/TShock";
var tshockDownloadUrl = "https://github.com/Pryaxis/TShock/releases/download/v4.3.24/tshock_4.3.24.zip";
Setup(ctx =>
{
Information("Check tshock.");
if (!FileExists("./tshock/TerrariaServer.exe"))
{
Warning($"Download tshock from {tshockRepo}");
var zipFile = DownloadFile(tshockDownloadUrl);
Unzip(zipFile, "./tshock");
}
});
Task("Build")
.Does(() =>
{
DotNetCoreBuild("./AutoReg.sln", new DotNetCoreBuildSettings { Configuration = configuration });
});
Task("Clean")
.Does(() =>
{
DotNetCoreClean("./AutoReg.sln", new DotNetCoreCleanSettings { Configuration = configuration });
});
Task("Run")
.Does(() =>
{
DotNetCorePublish("./AutoReg.sln", new DotNetCorePublishSettings { OutputDirectory = "./tshock/ServerPlugins" });
var dir = Directory("./tshock");
var exe = "./tshock/TerrariaServer.exe";
var args = "-ip 127.0.0.1";
if (IsRunningOnUnix())
{
args = $"{exe} {args}";
exe = "mono";
}
StartProcess(exe, new ProcessSettings { Arguments = args, WorkingDirectory = dir });
});
RunTarget(target)