This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.cake
57 lines (45 loc) · 1.56 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
55
56
57
string target = Argument("target", "Default");
Task("Nuget-Restore")
.Does(() =>
{
NuGetInstall("Google.Protobuf.Tools", new NuGetInstallSettings {
ExcludeVersion = true,
OutputDirectory = "./tools",
Version = "3.0.0-beta4",
Prerelease = true
});
});
Task("Protos")
.IsDependentOn("Nuget-Restore")
.Does(() =>
{
var protos = GetFiles("./POGOProtos/src/**/*.proto");
var protoRoot = MakeAbsolute(Directory("./POGOProtos/src"));
foreach (var protoFile in protos)
{
Verbose("Compiling proto {0}", protoRoot.GetRelativePath(protoFile));
StartProcess("./tools/Google.Protobuf.Tools/tools/windows_x64/protoc.exe",
new ProcessSettings()
.WithArguments(args =>
args.Append("--csharp_out")
.AppendQuoted("src\\POGOProtos\\Protos")
.Append("--proto_path")
.AppendQuoted(protoRoot.ToString())
.AppendQuoted(protoFile.ToString())));
}
});
Task("Build")
.IsDependentOn("Protos")
.Does(() =>
{
var projectPath = "./src/POGOProtos";
DotNetCoreRestore(projectPath);
var buildSettings = new DotNetCorePackSettings();
if (AppVeyor.IsRunningOnAppVeyor && AppVeyor.Environment.Repository.Branch.Contains("develop"))
{
var versionNumber = AppVeyor.Environment.Build.Number;
buildSettings.VersionSuffix = string.Format("beta{0:0000}", versionNumber);
}
DotNetCorePack(projectPath, buildSettings);
});
RunTarget(target);