Skip to content

Commit 7316da3

Browse files
committed
Sync with core 5902456
core: fix the CI builds. The iOS simulator's clipboard test gets Objective-C++ enabled in the directory that compiles it, the Android x86_64 test hosts get a position-independent core library, and the OpenHarmony icon copy no longer uses an API newer than the pinned SDK. Also fix the two workspace checks that were failing. gofmt compares the working tree byte for byte, so every Go file was reported on a Windows checkout that turns LF into CRLF; .gitattributes now pins *.go to LF. The C# clipboard async helpers get the braces and blank lines dotnet format requires.
1 parent 32d41e3 commit 7316da3

3 files changed

Lines changed: 25 additions & 7 deletions

File tree

‎.gitattributes‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
*.ps1 text
1919
*.cmake text
2020

21+
# Go tooling compares the working tree byte for byte: gofmt rewrites CRLF to LF
22+
# and `gofmt -l` then reports every file on a checkout that converted them
23+
# (Windows runners default core.autocrlf to true). Pin LF so the check is about
24+
# formatting, not line endings.
25+
*.go text eol=lf
26+
2127
# Binary files should remain untouched
2228
*.png binary
2329
*.jpg binary

‎bindings/csharp/src/NativeAPI/Clipboard.cs‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,37 +173,49 @@ public bool IsMonitoring()
173173
return rawResult;
174174
}
175175

176-
private static bool ValidText(string? value) {
176+
private static bool ValidText(string? value)
177+
{
177178
if (value is null) return true;
178179
if (value.IndexOf((char)0) >= 0) return false;
179180
try { new System.Text.UTF8Encoding(false, true).GetByteCount(value); return true; }
180181
catch (System.Text.EncoderFallbackException) { return false; }
181182
}
182-
public System.Threading.Tasks.Task<ClipboardData> ReadAsync() {
183+
184+
public System.Threading.Tasks.Task<ClipboardData> ReadAsync()
185+
{
183186
var completion = new System.Threading.Tasks.TaskCompletionSource<ClipboardData>(System.Threading.Tasks.TaskCreationOptions.RunContinuationsAsynchronously);
184187
Read((success, value) => { if (success) completion.TrySetResult(value); else completion.TrySetException(new InvalidOperationException("Clipboard operation failed")); });
185188
return completion.Task;
186189
}
187-
public System.Threading.Tasks.Task<string?> ReadTextAsync() {
190+
191+
public System.Threading.Tasks.Task<string?> ReadTextAsync()
192+
{
188193
var completion = new System.Threading.Tasks.TaskCompletionSource<string?>(System.Threading.Tasks.TaskCreationOptions.RunContinuationsAsynchronously);
189194
ReadText((success, value) => { if (success) completion.TrySetResult(value); else completion.TrySetException(new InvalidOperationException("Clipboard operation failed")); });
190195
return completion.Task;
191196
}
192-
public System.Threading.Tasks.Task<string?> ReadHtmlAsync() {
197+
198+
public System.Threading.Tasks.Task<string?> ReadHtmlAsync()
199+
{
193200
var completion = new System.Threading.Tasks.TaskCompletionSource<string?>(System.Threading.Tasks.TaskCreationOptions.RunContinuationsAsynchronously);
194201
ReadHtml((success, value) => { if (success) completion.TrySetResult(value); else completion.TrySetException(new InvalidOperationException("Clipboard operation failed")); });
195202
return completion.Task;
196203
}
197-
public System.Threading.Tasks.Task<Image?> ReadImageAsync() {
204+
205+
public System.Threading.Tasks.Task<Image?> ReadImageAsync()
206+
{
198207
var completion = new System.Threading.Tasks.TaskCompletionSource<Image?>(System.Threading.Tasks.TaskCreationOptions.RunContinuationsAsynchronously);
199208
ReadImage((success, value) => { if (success) completion.TrySetResult(value); else completion.TrySetException(new InvalidOperationException("Clipboard operation failed")); });
200209
return completion.Task;
201210
}
202-
public System.Threading.Tasks.Task<string[]> ReadFilePathsAsync() {
211+
212+
public System.Threading.Tasks.Task<string[]> ReadFilePathsAsync()
213+
{
203214
var completion = new System.Threading.Tasks.TaskCompletionSource<string[]>(System.Threading.Tasks.TaskCreationOptions.RunContinuationsAsynchronously);
204215
ReadFilePaths((success, value) => { if (success) completion.TrySetResult(value); else completion.TrySetException(new InvalidOperationException("Clipboard operation failed")); });
205216
return completion.Task;
206217
}
218+
207219
/// <summary>Registers <paramref name="callback"/> for every ClipboardEvent this Clipboard emits.</summary>
208220
/// <remarks>
209221
/// The delegate is kept alive until the listener is removed or its emitter

0 commit comments

Comments
 (0)