Skip to content

Commit 39a2c58

Browse files
committed
[ECO-4567] Reverted all formatting based changes for all files
1 parent 4fdf426 commit 39a2c58

File tree

20 files changed

+143
-258
lines changed

20 files changed

+143
-258
lines changed

.editorconfig

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,13 @@ root = true
88
indent_style = space
99
indent_size = 4
1010
trim_trailing_whitespace = true
11-
insert_final_newline = true
11+
insert_final_newline = false
1212

1313
# SA1200: Using directives should be placed correctly
1414
dotnet_diagnostic.SA1200.severity = none
1515

16-
[*.cake]
17-
indent_style = space
18-
indent_size = 4
19-
trim_trailing_whitespace = true
20-
insert_final_newline = true
21-
2216
[*.{xaml,xml,config,manifest}]
2317
indent_style = space
2418
indent_size = 2
2519
trim_trailing_whitespace = true
26-
insert_final_newline = false
20+
insert_final_newline = false

cake-build/tasks/build.cake

Lines changed: 28 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Task("_Clean")
66
.Does(() =>
77
{
88
Information("Cleaning build directories...");
9-
9+
1010
// Clean the main solution which includes all core projects (NetFramework, NetStandard, iOS, Android, Tests, etc.)
1111
CleanSolution();
12-
12+
1313
// Clean custom output directories that are not part of standard project outputs
14-
CleanDirectory(paths.TestResults);
14+
CleanDirectory(paths.TestResults);
1515
});
1616

1717
Task("_Restore_Main")
@@ -25,9 +25,9 @@ Task("_Version")
2525
.Does(() =>
2626
{
2727
Information($"Setting version to {version}");
28-
28+
2929
var assemblyInfoPath = paths.Src.CombineWithFilePath("CommonAssemblyInfo.cs");
30-
30+
3131
CreateAssemblyInfo(assemblyInfoPath, new AssemblyInfoSettings
3232
{
3333
Company = "Ably",
@@ -43,37 +43,37 @@ Task("_NetFramework_Build")
4343
.Does(() =>
4444
{
4545
Information("Building .NET Framework solution...");
46-
46+
4747
var settings = buildConfig.ApplyStandardSettings(
4848
new MSBuildSettings(),
4949
configuration
5050
);
51-
51+
5252
settings = settings.WithTarget("Build");
53-
53+
5454
MSBuild(paths.NetFrameworkSolution, settings);
5555
});
5656

5757
Task("_NetStandard_Build")
5858
.Does(() =>
5959
{
6060
Information("Building .NET Standard solution...");
61-
61+
6262
var settings = new DotNetBuildSettings
6363
{
6464
Configuration = configuration,
6565
NoRestore = true
6666
};
6767
var msbuildSettings = new DotNetMSBuildSettings();
68-
69-
68+
69+
7070
if (!string.IsNullOrEmpty(defineConstants))
7171
{
7272
msbuildSettings = msbuildSettings.WithProperty("DefineConstants", defineConstants);
7373
}
74-
74+
7575
settings.MSBuildSettings = msbuildSettings;
76-
76+
7777
DotNetBuild(paths.NetStandardSolution.FullPath, settings);
7878
});
7979

@@ -87,20 +87,20 @@ Task("_Xamarin_Build")
8787
.Does(() =>
8888
{
8989
Information("Building Xamarin solution...");
90-
90+
9191
if (!FileExists(paths.XamarinSolution))
9292
{
9393
Warning("Xamarin solution not found, skipping build");
9494
return;
9595
}
96-
96+
9797
var settings = buildConfig.ApplyStandardSettings(
9898
new MSBuildSettings(),
9999
configuration
100100
);
101-
101+
102102
settings = settings.WithTarget("Build");
103-
103+
104104
MSBuild(paths.XamarinSolution, settings);
105105
});
106106

@@ -109,32 +109,32 @@ Task("_Build_Ably_Unity_Dll")
109109
.Does(() =>
110110
{
111111
Information("Merging Unity dependencies into IO.Ably.dll...");
112-
112+
113113
var netStandard20BinPath = paths.Src
114114
.Combine("IO.Ably.NETStandard20")
115115
.Combine("bin/Release/netstandard2.0");
116-
116+
117117
if (!DirectoryExists(netStandard20BinPath))
118118
{
119119
throw new Exception($"NETStandard2.0 bin directory not found: {netStandard20BinPath}. Please build the project first.");
120120
}
121-
121+
122122
var primaryDll = netStandard20BinPath.CombineWithFilePath("IO.Ably.dll");
123-
123+
124124
if (!FileExists(primaryDll))
125125
{
126126
throw new Exception($"Primary DLL not found: {primaryDll}. Please build the IO.Ably.NETStandard20 project first.");
127127
}
128-
128+
129129
var newtonsoftDll = paths.Root
130130
.Combine("lib/unity/AOT")
131131
.CombineWithFilePath("Newtonsoft.Json.dll");
132-
132+
133133
if (!FileExists(newtonsoftDll))
134134
{
135135
throw new Exception($"Newtonsoft.Json.dll not found at: {newtonsoftDll}");
136136
}
137-
137+
138138
var dllsToMerge = new[]
139139
{
140140
netStandard20BinPath.CombineWithFilePath("IO.Ably.DeltaCodec.dll"),
@@ -143,47 +143,23 @@ Task("_Build_Ably_Unity_Dll")
143143
netStandard20BinPath.CombineWithFilePath("System.Threading.Tasks.Extensions.dll"),
144144
newtonsoftDll
145145
};
146-
146+
147147
var unityOutputPath = paths.Root.Combine("unity/Assets/Ably/Plugins");
148148
var outputDll = unityOutputPath.CombineWithFilePath("IO.Ably.dll");
149-
149+
150150
// Delete existing output DLL if it exists
151151
if (FileExists(outputDll))
152152
{
153153
DeleteFile(outputDll);
154154
Information($"Deleted existing DLL: {outputDll}");
155155
}
156-
156+
157157
// Merge all dependencies into primary DLL in one go
158158
ilRepackHelper.MergeDLLs(primaryDll, dllsToMerge, outputDll);
159-
159+
160160
Information($"✓ Unity DLL created at: {outputDll}");
161161
});
162162

163-
Task("_Format_Code")
164-
.Description("Format C#, XML and other files")
165-
.Does(() =>
166-
{
167-
Information("Formatting code with dotnet-format...");
168-
169-
// Using 'whitespace' mode for fast formatting without building the project
170-
// This applies .editorconfig rules for whitespace, indentation, etc. without semantic analysis
171-
// Much faster than default mode which requires compilation
172-
var exitCode = StartProcess("dotnet", new ProcessSettings
173-
{
174-
Arguments = $"format {paths.MainSolution.FullPath} whitespace --no-restore"
175-
});
176-
177-
if (exitCode == 0)
178-
{
179-
Information("✓ Code formatted successfully");
180-
}
181-
else
182-
{
183-
throw new Exception($"dotnet format failed with exit code {exitCode}");
184-
}
185-
});
186-
187163
///////////////////////////////////////////////////////////////////////////////
188164
// PUBLIC TARGETS
189165
///////////////////////////////////////////////////////////////////////////////
@@ -214,8 +190,3 @@ Task("Build.Xamarin")
214190
Task("Update.AblyUnity")
215191
.Description("Update Ably DLLs inside unity project")
216192
.IsDependentOn("_Build_Ably_Unity_Dll");
217-
218-
// Public task: Format code using dotnet-format
219-
Task("Format.Code")
220-
.Description("Format code using dotnet-format")
221-
.IsDependentOn("_Format_Code");

cake-build/tasks/test.cake

Lines changed: 14 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Task("_NetFramework_Unit_Tests_WithRetry")
2626

2727
var resultsPath = paths.TestResults.CombineWithFilePath("xunit-netframework-unit.xml");
2828

29-
var initialFailedTests = new List<string>();
3029
try
3130
{
3231
var settings = testExecutionHelper.CreateXUnitSettings("xunit-netframework-unit", isIntegration: false);
@@ -35,32 +34,14 @@ Task("_NetFramework_Unit_Tests_WithRetry")
3534
catch
3635
{
3736
Warning("Some tests failed. Retrying failed tests...");
38-
initialFailedTests = testRetryHelper.FindFailedXUnitTests(resultsPath);
3937
}
4038

41-
if (initialFailedTests.Any())
42-
{
43-
testExecutionHelper.RetryFailedXUnitTests(
44-
testAssemblies,
45-
resultsPath,
46-
testRetryHelper,
47-
(test) => testExecutionHelper.CreateXUnitSettings("retry", isIntegration: false, isRetry: true)
48-
);
49-
50-
// Check retry result files to see if tests still failed
51-
var stillFailedTests = new List<string>();
52-
for (int i = 1; i <= initialFailedTests.Count; i++)
53-
{
54-
var retryResultsPath = paths.TestResults.CombineWithFilePath($"xunit-netframework-unit-{i}.xml");
55-
var retryFailed = testRetryHelper.FindFailedXUnitTests(retryResultsPath);
56-
stillFailedTests.AddRange(retryFailed);
57-
}
58-
59-
if (stillFailedTests.Any())
60-
{
61-
throw new Exception($"{stillFailedTests.Count} test(s) failed after retry");
62-
}
63-
}
39+
testExecutionHelper.RetryFailedXUnitTests(
40+
testAssemblies,
41+
resultsPath,
42+
testRetryHelper,
43+
(test) => testExecutionHelper.CreateXUnitSettings("retry", isIntegration: false, isRetry: true)
44+
);
6445
});
6546

6647
Task("_NetFramework_Integration_Tests")
@@ -87,7 +68,6 @@ Task("_NetFramework_Integration_Tests_WithRetry")
8768

8869
var resultsPath = paths.TestResults.CombineWithFilePath("xunit-netframework-integration.xml");
8970

90-
var initialFailedTests = new List<string>();
9171
try
9272
{
9373
var settings = testExecutionHelper.CreateXUnitSettings("xunit-netframework-integration", isIntegration: true);
@@ -96,32 +76,14 @@ Task("_NetFramework_Integration_Tests_WithRetry")
9676
catch
9777
{
9878
Warning("Some tests failed. Retrying failed tests...");
99-
initialFailedTests = testRetryHelper.FindFailedXUnitTests(resultsPath);
10079
}
10180

102-
if (initialFailedTests.Any())
103-
{
104-
testExecutionHelper.RetryFailedXUnitTests(
105-
testAssemblies,
106-
resultsPath,
107-
testRetryHelper,
108-
(test) => testExecutionHelper.CreateXUnitSettings("retry", isIntegration: true, isRetry: true)
109-
);
110-
111-
// Check retry result files to see if tests still failed
112-
var stillFailedTests = new List<string>();
113-
for (int i = 1; i <= initialFailedTests.Count; i++)
114-
{
115-
var retryResultsPath = paths.TestResults.CombineWithFilePath($"xunit-netframework-integration-{i}.xml");
116-
var retryFailed = testRetryHelper.FindFailedXUnitTests(retryResultsPath);
117-
stillFailedTests.AddRange(retryFailed);
118-
}
119-
120-
if (stillFailedTests.Any())
121-
{
122-
throw new Exception($"{stillFailedTests.Count} test(s) failed after retry");
123-
}
124-
}
81+
testExecutionHelper.RetryFailedXUnitTests(
82+
testAssemblies,
83+
resultsPath,
84+
testRetryHelper,
85+
(test) => testExecutionHelper.CreateXUnitSettings("retry", isIntegration: true, isRetry: true)
86+
);
12587
});
12688

12789
///////////////////////////////////////////////////////////////////////////////
@@ -155,35 +117,16 @@ Task("_NetStandard_Unit_Tests_WithRetry")
155117
var filter = testExecutionHelper.CreateUnitTestFilter(IsRunningOnUnix());
156118
var settings = testExecutionHelper.CreateDotNetTestSettings(resultsPath, filter, framework, configuration);
157119

158-
var initialFailedTests = new List<string>();
159120
try
160121
{
161122
testExecutionHelper.RunDotNetTests(project, settings);
162123
}
163124
catch
164125
{
165126
Warning("Some tests failed. Retrying failed tests...");
166-
initialFailedTests = testRetryHelper.FindFailedDotNetTests(resultsPath);
167127
}
168128

169-
if (initialFailedTests.Any())
170-
{
171-
testExecutionHelper.RetryFailedDotNetTests(project, resultsPath, testRetryHelper, framework, configuration);
172-
173-
// Check retry result files to see if tests still failed
174-
var stillFailedTests = new List<string>();
175-
for (int i = 1; i <= initialFailedTests.Count; i++)
176-
{
177-
var retryResultsPath = paths.TestResults.CombineWithFilePath($"tests-netstandard-unit-{i}.trx");
178-
var retryFailed = testRetryHelper.FindFailedDotNetTests(retryResultsPath);
179-
stillFailedTests.AddRange(retryFailed);
180-
}
181-
182-
if (stillFailedTests.Any())
183-
{
184-
throw new Exception($"{stillFailedTests.Count} test(s) failed after retry");
185-
}
186-
}
129+
testExecutionHelper.RetryFailedDotNetTests(project, resultsPath, testRetryHelper, framework, configuration);
187130
});
188131

189132
Task("_NetStandard_Integration_Tests")
@@ -213,35 +156,16 @@ Task("_NetStandard_Integration_Tests_WithRetry")
213156
var filter = testExecutionHelper.CreateIntegrationTestFilter();
214157
var settings = testExecutionHelper.CreateDotNetTestSettings(resultsPath, filter, framework, configuration);
215158

216-
var initialFailedTests = new List<string>();
217159
try
218160
{
219161
testExecutionHelper.RunDotNetTests(project, settings);
220162
}
221163
catch
222164
{
223165
Warning("Some tests failed. Retrying failed tests...");
224-
initialFailedTests = testRetryHelper.FindFailedDotNetTests(resultsPath);
225166
}
226167

227-
if (initialFailedTests.Any())
228-
{
229-
testExecutionHelper.RetryFailedDotNetTests(project, resultsPath, testRetryHelper, framework, configuration);
230-
231-
// Check retry result files to see if tests still failed
232-
var stillFailedTests = new List<string>();
233-
for (int i = 1; i <= initialFailedTests.Count; i++)
234-
{
235-
var retryResultsPath = paths.TestResults.CombineWithFilePath($"tests-netstandard-integration-{i}.trx");
236-
var retryFailed = testRetryHelper.FindFailedDotNetTests(retryResultsPath);
237-
stillFailedTests.AddRange(retryFailed);
238-
}
239-
240-
if (stillFailedTests.Any())
241-
{
242-
throw new Exception($"{stillFailedTests.Count} test(s) failed after retry");
243-
}
244-
}
168+
testExecutionHelper.RetryFailedDotNetTests(project, resultsPath, testRetryHelper, framework, configuration);
245169
});
246170

247171
///////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)