Skip to content

Commit 2d4c617

Browse files
committed
edit: commited telegram bot
1 parent 00d9733 commit 2d4c617

File tree

1 file changed

+31
-16
lines changed

1 file changed

+31
-16
lines changed

build.cake

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#addin nuget:?package=Cake.Yaml&version=4.0.0
1414
#addin nuget:?package=YamlDotNet&version=6.1.2
1515

16-
#reference "./bot/BotLib.Abstractions.dll"
16+
//#reference "./bot/BotLib.Abstractions.dll"
1717

1818
#load "./BuilderDependencies/TestResultParser.cake"
1919
#load "./BuilderDependencies/UnityLogParser.cake"
@@ -22,10 +22,10 @@ using static Cake.Unity.Arguments.BuildTarget;
2222
using System.Runtime;
2323
using System.Diagnostics;
2424
using System.Threading;
25-
using BotLib.Abstractions;
26-
using JKang.IpcServiceFramework.Client;
27-
using JKang.IpcServiceFramework;
28-
using Microsoft.Extensions.DependencyInjection;
25+
//using BotLib.Abstractions;
26+
//using JKang.IpcServiceFramework.Client;
27+
//using JKang.IpcServiceFramework;
28+
//using Microsoft.Extensions.DependencyInjection;
2929
using System.IO;
3030
using System.Globalization;
3131

@@ -42,8 +42,8 @@ var commitHistory = "";
4242
var git =".git";
4343
string gardleProjectDirectory;
4444

45-
IIpcClient<ITelegram> client;
46-
ServiceProvider serviceProvider;
45+
//IIpcClient<ITelegram> client;
46+
//ServiceProvider serviceProvider;
4747

4848
var IsAndroidBuild = false;
4949
var IsIosBuild = false;
@@ -132,6 +132,7 @@ Task("Update-Project-Property-Ios")
132132
SetProjectProperty(properties, ignore);
133133
});
134134

135+
/*
135136
Task("Connect-To-Bot")
136137
.Does(() =>
137138
{
@@ -150,7 +151,9 @@ Task("Connect-To-Bot")
150151
{
151152
DisplayError(exception);
152153
});
154+
*/
153155

156+
/*
154157
Task("Send-Welcome-Message")
155158
.Does(() =>
156159
{
@@ -171,6 +174,7 @@ Task("Send-Welcome-Message")
171174
{
172175
DisplayError(exception);
173176
});
177+
*/
174178

175179
Task("Run-Android-Tests")
176180
.Does(() =>
@@ -200,11 +204,15 @@ Task("Run-Android-Tests")
200204

201205
Console.WriteLine(testSummary);
202206

207+
/*
203208
Task<string> helloMessageId =
204209
client.InvokeAsync(x
205210
=> x.SendMessage(
206211
testSummary,
207212
RepoUrl()));
213+
*/
214+
215+
Console.WriteLine($"[CI][Test Summary] Would send message: {testSummary}");
208216

209217
TimeSpan timeSpan = new TimeSpan(0, 1, 0);
210218

@@ -255,12 +263,14 @@ Task("Send-Erorr-Logs")
255263
string caption = ParseUnityLogError(relativePath);
256264
Console.WriteLine(caption);
257265

258-
Task output = client.InvokeAsync(x => x.SendFile(path, "unity.log", caption, RepoUrl()));
266+
//Task output = client.InvokeAsync(x => x.SendFile(path, "unity.log", caption, RepoUrl()));
267+
268+
Console.WriteLine($"[CI][Log] Would send log: '{path}' with caption: {caption}");
259269

260270
TimeSpan timeSpan = new TimeSpan(0, 5, 0);
261271

262-
if (!output.Wait(timeSpan))
263-
throw new TimeoutException($"SendFile Timeout {timeSpan}");
272+
//if (!output.Wait(timeSpan))
273+
// throw new TimeoutException($"SendFile Timeout {timeSpan}");
264274

265275
throw new CakeException("Build end with error!");
266276
});
@@ -278,12 +288,15 @@ Task("Share-Apk")
278288
{
279289
Console.WriteLine($"Start sending from {path}");
280290

281-
Task<string> output = client.InvokeAsync(x => x.SendFile(path, ApkName(System.IO.Path.GetExtension(path)), RepoUrl()));
291+
//Task<string> output = client.InvokeAsync(x => x.SendFile(path, ApkName(System.IO.Path.GetExtension(path)), RepoUrl()));
292+
293+
var fileName = ApkName(System.IO.Path.GetExtension(path));
294+
Console.WriteLine($"[CI][APK] Would send file: '{path}' as '{fileName}' to repo: {RepoUrl()}");
282295

283296
TimeSpan timeSpan = new TimeSpan(0, 10, 0);
284297

285-
if (!output.Wait(timeSpan))
286-
throw new TimeoutException($"SendFile Timeout {timeSpan}");
298+
//if (!output.Wait(timeSpan))
299+
// throw new TimeoutException($"SendFile Timeout {timeSpan}");
287300
}
288301

289302
SaveLastCommitSha();
@@ -403,6 +416,7 @@ Task("Distribute-IPA")
403416
isErrorHappend = true;
404417
});
405418

419+
/*
406420
Task("Send-Success-Message")
407421
.WithCriteria(() => IsIosBuild, "Ios disabled in config")
408422
.WithCriteria(() => !isErrorHappend, "Error")
@@ -425,15 +439,16 @@ Task("Send-Success-Message")
425439
{
426440
DisplayError(exception);
427441
});
442+
*/
428443

429444
Task("Build-Android")
430445
.WithCriteria(() => IsAndroidBuild, "Android disabled in config")
431446
.IsDependentOn("Clean-Artifacts-Android")
432447
.IsDependentOn("Find-Project")
433448
.IsDependentOn("Build-Commit-History")
434449
.IsDependentOn("Update-Project-Property-Android")
435-
.IsDependentOn("Connect-To-Bot")
436-
.IsDependentOn("Send-Welcome-Message")
450+
//.IsDependentOn("Connect-To-Bot")
451+
//.IsDependentOn("Send-Welcome-Message")
437452
.IsDependentOn("Run-Android-Tests")
438453
.IsDependentOn("Build-APK")
439454
.IsDependentOn("Send-Erorr-Logs")
@@ -452,7 +467,7 @@ Task("Build-iOS")
452467
.IsDependentOn("Archivate-XCodeProject")
453468
.IsDependentOn("Export-Archive")
454469
.IsDependentOn("Distribute-IPA")
455-
.IsDependentOn("Send-Success-Message")
470+
//.IsDependentOn("Send-Success-Message")
456471
.Does(() =>
457472
{
458473
});

0 commit comments

Comments
 (0)