diff --git a/.gitattributes b/.gitattributes index ec32f35e1b21..a15c04510a22 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,3 +9,5 @@ # stored as 'lf' and converted to 'crlf' on Windows. **/.template.config/localize/templatestrings.*.json text + +.github/workflows/*.lock.yml linguist-generated=true merge=ours diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json new file mode 100644 index 000000000000..97077a3bc29e --- /dev/null +++ b/.github/aw/actions-lock.json @@ -0,0 +1,9 @@ +{ + "entries": { + "github/gh-aw-actions/setup@v0.68.3": { + "repo": "github/gh-aw-actions/setup", + "version": "v0.68.3", + "sha": "ba90f2186d7ad780ec640f364005fa24e797b360" + } + } +} diff --git a/.github/skills/macios-reviewer/SKILL.md b/.github/skills/macios-reviewer/SKILL.md new file mode 100644 index 000000000000..4e58caf65a61 --- /dev/null +++ b/.github/skills/macios-reviewer/SKILL.md @@ -0,0 +1,112 @@ +--- +name: macios-reviewer +description: >- + Review dotnet/macios PRs against established rules. Trigger on "review this PR", + a GitHub PR URL, or code review requests. Checks bindings, MSBuild, nullable, + formatting, performance, testing, native runtime code, and Apple platform patterns. +--- + +# .NET for Apple Platforms PR Reviewer + +Review PRs against guidelines distilled from past reviews by senior maintainers of dotnet/macios (Sebastien, Rolf, Chris, Manuel, Alex). + +## Review Mindset + +Be polite but skeptical. Prioritize bugs, performance regressions, safety issues, and pattern violations over style nitpicks. **3 important comments > 15 nitpicks.** + +Flag severity clearly in every comment: +- ❌ **error** — Must fix before merge. Bugs, security issues, broken bindings, breaking API changes. +- ⚠️ **warning** — Should fix. Performance issues, missing validation, inconsistency with patterns. +- 💡 **suggestion** — Consider changing. Style, readability, optional improvements. + +**Every review should produce at least one inline comment.** Even clean PRs have opportunities for improvement — code consolidation, missing edge-case tests, documentation gaps, or binding improvements. Use 💡 suggestions for these. Only omit inline comments if the PR is truly trivial (e.g., a 1-line typo fix or dependency bump). + +## Workflow + +### 1. Identify the PR + +If triggered from an agentic workflow (slash command on a PR), use the PR from the event context. Otherwise, extract `owner`, `repo`, `pr_number` from a URL or reference provided by the user. +Formats: `https://github.com/{owner}/{repo}/pull/{number}`, `{owner}/{repo}#{number}`, or bare number (defaults to `dotnet/macios`). + +### 2. Gather context (before reading PR description) + +``` +gh pr diff {number} --repo {owner}/{repo} +gh pr view {number} --repo {owner}/{repo} --json files +``` + +For each changed file, read the **full source file** (not just the diff) to understand surrounding invariants, call patterns, and data flow. If the change modifies a public/internal API or utility, search for callers. Check whether sibling types need the same fix. + +**Form an independent assessment** of what the change does and what problems it has *before* reading the PR description. + +### 3. Incorporate PR narrative and reconcile + +``` +gh pr view {number} --repo {owner}/{repo} --json title,body +``` + +Now read the PR description and linked issues. Treat them as claims to verify, not facts to accept. Where your independent reading disagrees with the PR description, investigate further. If the PR claims a performance improvement, require evidence (benchmarks, profiling data). If it claims a bug fix, verify the bug exists and the fix addresses root cause — not symptoms. + +### 4. Check CI status + +``` +gh pr checks {number} --repo {owner}/{repo} +``` + +Review the CI results. **Never post ✅ LGTM if any required CI check is failing or if the code doesn't build.** + +### 5. Load review rules + +Read `references/review-rules.md` from this skill's directory. + +### 6. Analyze the diff + +For each changed file, check against the review rules. Record issues as: + +```json +{ "path": "src/Example.cs", "line": 42, "side": "RIGHT", "body": "..." } +``` + +**What to look for (in priority order):** +1. **Bugs & correctness** — race conditions, null dereferences, incorrect selectors, wrong platform attributes +2. **Breaking changes** — API signature changes, removed members, changed parameter types without `XAMCORE_5_0` guard +3. **Binding correctness** — wrong `[Export]` selectors, missing `[NullAllowed]`, incorrect return types, missing platform attributes +4. **Safety** — thread safety, resource leaks, memory management issues +5. **Performance** — O(n²) patterns, unnecessary allocations, missing caches +6. **Missing tests** — untested error paths, edge cases, missing regression tests for bug fixes +7. **Code duplication** — near-identical methods that should be consolidated +8. **Consistency** — dedup patterns mixed within the same PR, API return types inconsistent with repo conventions +9. **Documentation** — misleading comments, undocumented behavioral decisions + +Constraints: +- Only comment on added/modified lines in the diff — the API rejects out-of-range lines. +- `line` = line number in the NEW file (right side). Double-check against the diff. +- One issue per comment. +- **Don't pile on.** If the same issue appears many times, flag it once with a note listing all affected files. +- **Don't flag what CI catches.** Skip compiler errors, formatting the linter will catch, etc. +- **Avoid false positives.** Verify the concern actually applies given the full context. If unsure, phrase it as a question rather than a firm claim. +- **Don't report potential C# compilation errors** — the compiler will report those. +- **Ignore comments from 'vs-mobiletools-engineering-service2'** when processing issues and pull requests. + +### 7. Post the review + +Post your findings directly: + +- **Inline comments** on specific lines of the diff with the severity, category, and explanation. +- **Review summary** with the overall verdict (✅ LGTM, ⚠️ Needs Changes, or ❌ Reject), issue counts by severity, and positive callouts. + +If no issues found **and CI is green**, submit with at most one or two 💡 suggestions and a positive summary. Truly trivial PRs (dependency bumps, 1-line typo fixes) may have no inline comments. + +**Copilot-authored PRs:** If the PR author is `Copilot` (the GitHub Copilot coding agent) and the verdict is ⚠️ Needs Changes or ❌ Reject, prefix the review summary with `@copilot ` so the comment automatically triggers Copilot to address the feedback. Do NOT add the prefix for ✅ LGTM verdicts. + +## Comment format + +``` +🤖 {severity} **{Category}** — {What's wrong and what to do instead.} + +_{Rule: Brief name}_ +``` + +Where `{severity}` is ❌, ⚠️, or 💡. + +**Categories:** Binding definition · Platform attributes · Breaking change · MSBuild tasks · MSBuild targets · Nullable · Async pattern · Error handling · Memory management · Security · Formatting · Performance · Code organization · Patterns · Native runtime · Testing · YAGNI · API design · Documentation diff --git a/.github/skills/macios-reviewer/references/review-rules.md b/.github/skills/macios-reviewer/references/review-rules.md new file mode 100644 index 000000000000..6b72979d10a9 --- /dev/null +++ b/.github/skills/macios-reviewer/references/review-rules.md @@ -0,0 +1,240 @@ +# .NET for Apple Platforms Review Rules + +Distilled from past code reviews by senior maintainers of dotnet/macios +(Sebastien Pouliot, Rolf Bjarne Kvinge, Chris Hamons, Manuel de la Peña, Alex Soto), +the conventions in [copilot-instructions.md](../../../copilot-instructions.md), +and the repository's `.editorconfig`. + +--- + +## 1. Binding Definition Conventions + +Binding definitions (`src/*.cs`) are the core of this repository. They define the +C# API surface for Apple frameworks. Getting them wrong causes broken APIs that +ship to every .NET Apple developer. + +| Check | What to look for | +|-------|-----------------| +| **Correct `[Export]` selectors** | The Objective-C selector in `[Export ("...")]` must exactly match Apple's header. A wrong selector causes a 'Selector not found' Objective-C exception at runtime. Verify against Apple's documentation or headers. | +| **`[NullAllowed]` on nullable parameters** | If an Objective-C parameter accepts `nil`, the C# binding must have `[NullAllowed]`. Missing it causes unnecessary `ArgumentNullException`s. Conversely, don't add `[NullAllowed]` if Apple's docs say the parameter must not be nil. Use `[return: NullAllowed]` on return values that can be nil. | +| **Method naming conventions** | C# method names must follow .NET naming guidelines. Methods need a verb: `CreateWatt()` not `Watt()` for factory methods. Properties don't need a verb. In Objective-C there was no distinction between a no-arg method and a read-only property — bind as a property when it represents state, as a method when it performs computation or has side effects. | +| **Delegate/protocol naming** | In protocols of the `*Delegate` kind, use the second parameter for the method name: `DidBeginActivity (HKLiveWorkoutBuilder workoutBuilder, ...)` not `DidBeginActivity (HKWorkoutActivity activity, ...)`. The first parameter is typically the sender. | +| **Use interface types for protocol parameters** | When an Objective-C method takes a protocol type, use the `I`-prefixed interface (e.g., `ICPListTemplateItem[]`) not the concrete class (`CPListItem[]`). This matches Apple's intent and avoids unnecessarily restricting the API. | +| **Properties vs methods** | Objective-C `+unitMethod` that returns a singleton or constant should be bound as a static read-only property (`HKUnit Diopter { get; }`) not a method. Factory methods that take parameters (`+unitWithPrefix:`) should be methods (`CreateWatt (HKMetricPrefix prefix)`). Follow the existing pattern in the same type. | +| **Alphabetical ordering** | Lists of framework entries, enum values, and similar declarations should be alphabetically sorted. | +| **Use custom delegates over `Action<>` for complex callbacks** | When a callback has more than 2-3 parameters, when parameter meaning is unclear (e.g., `Action`), or when any parameter or the return type is nullable, define a named delegate type instead. This improves API discoverability and allows proper nullability annotations. | +| **Platform availability attributes** | Every new type and member must have correct platform attributes (`[iOS (version)]`, `[Mac (version)]`, `[TV (version)]`, `[MacCatalyst (version)]`, `[NoiOS]`, `[NoMac]`, `[NoTV]`, `[NoMacCatalyst]`). Removing an attribute makes the API available from the earliest supported version, which is almost certainly wrong. | +| **Don't restrict beyond Apple's documentation** | If Apple documents an API as available on a platform, don't add `[No*]` attributes without good reason. Check headers and documentation carefully. | +| **`[Sealed]` for duplicate selectors** | When two properties share the same Objective-C selector (e.g., during deprecation transitions), use `[Sealed]` on the old one to avoid a compile error. | +| **`ArgumentSemantic` for properties** | Properties that hold references to objects should specify `ArgumentSemantic.Strong`, `.Weak`, `.Copy`, or `.Assign` matching the Objective-C declaration. | + +--- + +## 2. Breaking Changes & Compatibility + +| Check | What to look for | +|-------|-----------------| +| **Guard breaking changes with `XAMCORE_5_0`** | When fixing an incorrect binding (wrong parameter type, wrong return type), wrap the old API in `#if !XAMCORE_5_0` with `[Obsolete]` and add the corrected API alongside it. This preserves backward compatibility until the next major breaking-change release. | +| **`[Obsolete]` messages must be helpful** | Obsolete messages should tell users what to use instead: `[Obsolete ("Use '.ctor (ICPListTemplateItem [], string, string)' constructor instead.")]`. | +| **Renaming properties is breaking** | Even `Items` → `Items2` is acceptable as a temporary measure when the correct type must coexist with the old type behind `XAMCORE_5_0`. | +| **Parameter name changes are breaking** | Changing a public method's parameter name (including case) breaks named arguments and late-bound scenarios. | + +--- + +## 3. MSBuild Task Conventions (C#) + +Build tasks ship to customers. Getting them wrong causes broken builds. + +| Check | What to look for | +|-------|-----------------| +| **`[Required]` properties** | `[Required]` properties must be non-nullable with a default: `public string Foo { get; set; } = "";` or `public ITaskItem[] Bar { get; set; } = [];`. Non-`[Required]` and `[Output]` properties must be nullable (`string?`, `ITaskItem[]?`). | +| **Return `!Log.HasLoggedErrors`** | Task `Execute()` methods should return `!Log.HasLoggedErrors`, not hardcoded `true`/`false`. | +| **SessionId for remote execution** | Tasks that must execute on a Mac (when building from Windows) need the `SessionId` property and `IsMacEnabled` condition. Without these, the task only runs on Windows. | +| **`Inputs`/`Outputs` for incremental builds** | Targets that write files must have `Inputs` and `Outputs` attributes. Missing them breaks incremental builds. | +| **`FileWrites` for intermediate files** | Intermediate files must be added to `@(FileWrites)` so `IncrementalClean` doesn't delete them. Don't use `` — it won't evaluate when the target is skipped. | +| **Condition evaluation timing** | `Condition` on a `` is evaluated *before* `DependsOnTargets` runs. Comments should document this when it matters. | + +--- + +## 4. MSBuild Targets & XML + +| Check | What to look for | +|-------|-----------------| +| **Underscore prefix for internal names** | Internal targets, properties, and item groups should be prefixed with `_`. | +| **Prefer `$(XDependsOn)` over `BeforeTargets`/`AfterTargets`** | `AfterTargets` runs even if the predecessor failed, causing confusing cascading errors. | +| **Use `->Count()` for empty checks** | `'@(Items->Count())' != '0'` over `'@(Items)' != ''` to avoid huge log messages from string joins. | +| **XML indentation** | MSBuild/XML files use 2 spaces for indentation in `.csproj` files, and tabs for `.props`/`.targets` files (per `.editorconfig`). | + +--- + +## 5. Nullable Reference Types + +| Check | What to look for | +|-------|-----------------| +| **`#nullable enable`** | New files should have `#nullable enable` at the top unless already enabled at the project level. | +| **Never use `!` (null-forgiving operator)** | The postfix `!` operator is banned. Add proper null checks or make types non-nullable. AI-generated code frequently sprinkles `!` — reject it. This rule is about postfix `!`, not logical negation `!`. | +| **`ArgumentNullException.ThrowIfNull`** | .NET 9+ code should use `ArgumentNullException.ThrowIfNull (parameter)`. `netstandard2.0` code should use `throw new ArgumentNullException (nameof (parameter))`. | +| **Don't change `string.IsNullOrEmpty()` checks** | If you see an existing `string.IsNullOrEmpty()` check, leave it as-is. | +| **MSBuild task nullable pattern** | See §3 for the `[Required]`/non-`[Required]`/`[Output]` nullable patterns. | + +--- + +## 6. Formatting & Style + +C# code formatting is handled automatically and should **not** be reviewed for +formatting issues — doing so just adds noise. Review formatting only for +non-C# text files (XML, shell scripts, YAML, etc.). + +| Check | What to look for | +|-------|-----------------| +| **Don't review C# formatting** | C# code is automatically formatted. Do not comment on C# whitespace, brace placement, indentation, or spacing issues. | +| **XML/MSBuild indentation** | `.csproj` files use 2 spaces; `.props`/`.targets` files use tabs (per `.editorconfig`). | +| **Shell scripts** | Should be properly indented and follow existing style in the file. | +| **Max line width ~120 characters** | Applies to non-C# files. Don't merge two lines into a single 160-character monster. | + +--- + +## 7. Async, Cancellation & Thread Safety + +| Check | What to look for | +|-------|-----------------| +| **CancellationToken propagation** | Every `async` method that accepts a `CancellationToken` must pass it to ALL downstream async calls. | +| **OperationCanceledException** | Catch-all blocks must NOT swallow `OperationCanceledException`. | +| **Thread safety of shared state** | Static caches and shared mutable state need proper synchronization (`ConcurrentDictionary`, `Interlocked`, or locks). | + +--- + +## 8. Error Handling + +| Check | What to look for | +|-------|-----------------| +| **No empty catch blocks** | Every `catch` must capture the `Exception` and log or rethrow it. | +| **Validate parameters** | Throw `ArgumentException` or `ArgumentNullException` for invalid inputs. Use `nameof` for parameter names. | +| **Challenge exception swallowing** | `catch { continue; }` or `catch { return null; }` hides real problems. The default should be to let unexpected exceptions propagate. | +| **Include actionable details in exceptions** | Include the unsupported value or unexpected type. Never throw empty exceptions. | +| **Use `ThrowIf` helpers** | In .NET 9+ projects, prefer `ArgumentOutOfRangeException.ThrowIfNegative`, `ArgumentNullException.ThrowIfNull`, etc. | +| **Initialize output parameters in all paths** | Methods with `out` parameters must initialize them in all error paths. | + +--- + +## 9. Memory Management & Native Interop + +| Check | What to look for | +|-------|-----------------| +| **`using` for `IDisposable` resources** | Use `using` statements for objects implementing `IDisposable`, especially `NSObject` subclasses obtained from factory methods. | +| **`GC.KeepAlive` after handle access** | When accessing `.Handle` or `.GetHandle()` on a managed wrapper and passing it to native code, call `GC.KeepAlive (obj)` after the native call to prevent premature GC. Cache the handle in a local before `fixed` blocks. | +| **NativeObject pattern** | `NativeObject` wrappers use an internal `[Preserve]` constructor `(NativeHandle handle, bool owns)` and rely on base `Retain`/`Release` defaults. | +| **Dispose pattern for sealed classes** | A `sealed` class doesn't need `Dispose(bool)` + `GC.SuppressFinalize`. Just implement `IDisposable.Dispose()` directly. | +| **Runtime function naming** | Native runtime functions (`runtime/*.m`) should use the `xamarin_` prefix for release-build functions, not `debug_`. | +| **SIMD type marshalling** | SIMD matrix types like `NMatrix4` use `xamarin_simd__` native shims for marshalling across ObjC boundaries. Don't try to marshal them directly. | + +--- + +## 10. Performance + +| Check | What to look for | +|-------|-----------------| +| **Avoid unnecessary allocations** | Don't create intermediate collections when LINQ chaining or a single pass would do. | +| **Pre-allocate collections when size is known** | Use `new List (capacity)` or `new Dictionary (count)`. | +| **`HashSet.Add()` already handles duplicates** | Don't call `.Contains()` before `.Add()`. | +| **Don't wrap a value in an interpolated string** | `$"{someString}"` is an unnecessary `string.Format` call. | +| **Cache repeated accessor calls** | If `foo.Bar.Baz` is used multiple times, assign to a local. | +| **Watch for O(n²)** | Nested loops, repeated `.Contains()` on a `List`, or LINQ `.Where()` inside a loop. Switch to `HashSet` or `Dictionary` for lookups. | +| **Extract throw helpers** | `if (x) throw new ...` in hot methods prevents inlining. Extract into a `[DoesNotReturn]` helper. | +| **Place cheap checks before expensive ones** | Test null checks and boolean flags before allocating strings or doing I/O. | +| **Avoid closures in hot paths** | Lambdas that capture locals allocate a closure per call. In loops or frequently-called methods, use static methods or cache delegates. | + +--- + +## 11. Security + +| Check | What to look for | +|-------|-----------------| +| **Zip Slip protection** | Archive extraction must validate that every entry path resolves under the destination directory after `Path.GetFullPath()`. | +| **Command injection** | Arguments passed to `Process.Start` must be sanitized. Use `ArgumentList`, not string interpolation. | +| **Path traversal** | `StartsWith()` checks on paths must normalize with `Path.GetFullPath()` first. | + +--- + +## 12. Testing + +| Check | What to look for | +|-------|-----------------| +| **Bug fixes need regression tests** | Every PR that fixes a bug should include a test. If the PR says "fixes #1234" but adds no test, ask for one. | +| **Test assertions must be specific** | Avoid `Assert.That (a == b, Is.True)` — it gives poor failure messages. Prefer `Assert.That (a, Is.EqualTo (b))`. One exception: when testing a specific comparison operator. | +| **NUnit conventions** | Use `[TestFixture]`, `[Test]`, `[TestCase]`. Use `Assert.That` with NUnit constraints for rich failure messages. | +| **Platform-specific test guards** | Use `TestRuntime.AssertXcodeVersion()` to skip tests on older OS versions. Scope the guard to the right platform — if a test works on iOS but not macOS, wrap in `#if MONOMAC` not a blanket skip. | +| **Deterministic test data** | Tests should not depend on system locale, timezone, or current date. | +| **Test edge cases** | Empty collections, null inputs, boundary values. If the PR only tests the happy path, suggest edge cases. | +| **Different linking modes** | Consider whether tests should run under "Don't link", "Link SDK only", and "Link all" modes. | + +--- + +## 13. Code Organization + +| Check | What to look for | +|-------|-----------------| +| **Use `record` for data types** | Immutable data-carrier types should be `record` or `readonly record struct` — free value equality and boilerplate. | +| **Remove unused code** | Dead methods, speculative helpers, and code "for later" should be removed. No commented-out code — Git has history. | +| **New helpers default to `internal`** | Unless a confirmed external consumer needs them. | +| **Reduce indentation with early returns** | Invert conditions and use `continue` or `return` to reduce nesting. | +| **Don't initialize fields to default values** | `bool flag = false;` is noise. The CLR zero-initializes all fields. | +| **Well-named constants over magic numbers** | `if (retryCount > 3)` should be `if (retryCount > MaxRetries)`. | +| **Use `/// `** | For overridden members, prefer `/// ` over duplicating XML docs. | + +--- + +## 14. Patterns & Conventions + +| Check | What to look for | +|-------|-----------------| +| **Use existing utilities** | Check `Runtime`, `TestRuntime`, and other existing utilities before writing new helpers. | +| **Move bash code out of YAML** | Pipeline bash code should be in `.sh` files for syntax highlighting and shellcheck support, not inline YAML blocks. | +| **Unrelated changes** | If a line change seems unrelated to the PR's purpose, ask about it. Keep PRs focused. | +| **Comments explain "why", not "what"** | `// increment i` adds nothing. Explain intent, not mechanics. | +| **Remove stale comments** | If the code changed, update the comment. Wrong comments are worse than no comments. | +| **Track TODOs as issues** | A `// TODO` hidden in code will be forgotten. File an issue and reference it. | +| **`#else`/`#endif` comments** | Annotate `#else` and `#endif` with the original expression when preprocessor blocks are long. | +| **TryCreate pattern** | `TryCreate` methods conventionally return a `bool` + an `out` object/result parameter, and sometimes also an `out` status parameter. | +| **Factory method names** | If `CreateFoo()` sometimes returns an existing instance, rename to `GetOrCreateFoo()`. | +| **Apple feedback tracking** | File a mirror issue for any Apple feedback filed, since others cannot see Apple feedback directly. | + +--- + +## 15. Resource & Localization Files + +| Check | What to look for | +|-------|-----------------| +| **Only modify English `.resx` files** | Never modify non-English `.resx` files or `.lcl` files — they are auto-generated by the localization pipeline. | + +--- + +## 16. XML Documentation + +| Check | What to look for | +|-------|-----------------| +| **No Xamarin.iOS / Xamarin.Mac references** | Rewrite any mentions of Xamarin.iOS or Xamarin.Mac — these are old product names no longer used. | +| **Remove empty `` and `` nodes** | Empty XML doc elements add noise. | +| **Indent nested XML tags** | Use 2 spaces per indentation level within XML doc comments. | +| **Replace include attributes** | If an XML doc has an include attribute, replace it with the inlined content from the included file. | + +--- + +## 17. YAGNI & AI-Specific Pitfalls + +These are patterns that AI-generated code consistently gets wrong in this repo: + +| Pattern | What to watch for | +|---------|------------------| +| **Reinventing the wheel** | AI creates new infrastructure instead of using existing utilities. ALWAYS check if a similar utility exists. | +| **Over-engineering** | HttpClient injection "for testability", speculative helpers, unused overloads. If no caller needs it today, remove it. | +| **Swallowed errors** | AI catch blocks love to eat exceptions silently. Check EVERY catch block. | +| **Null-forgiving operator** | AI sprinkles `!` everywhere. This is banned in this repo. | +| **Wrong formatting** | AI generates standard C# formatting (no space before parens). This repo uses Mono style with automatic formatting — but AI-generated code in non-C# files (XML, YAML, shell) may have wrong indentation or style. | +| **`string.Empty` and `Array.Empty()`** | AI defaults to these. Use `""` and `[]` instead. | +| **Sloppy structure** | Multiple types in one file, `#region` directives, classes where records would do. New helpers marked `public` when `internal` suffices. | +| **Docs describe intent not reality** | AI doc comments often describe what the code *should* do, not what it *actually* does. | +| **Unused parameters** | AI adds `CancellationToken` parameters but never observes them. | +| **Modifying localization files** | AI modifies non-English `.resx` or `.lcl` files. Only English resource files should be edited. | +| **`git commit --amend`** | Never amend commits. Always create new commits — the maintainer will squash as needed. | +| **Filler words in docs** | "So" at the start of a sentence adds nothing. Be direct. | diff --git a/.github/workflows/macios-reviewer.lock.yml b/.github/workflows/macios-reviewer.lock.yml new file mode 100644 index 000000000000..660a02993332 --- /dev/null +++ b/.github/workflows/macios-reviewer.lock.yml @@ -0,0 +1,1312 @@ +# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"a4ffe1d52364aca7fafba9ba975ec40a3f4fc4908801119268fc1812f9b09cbe","compiler_version":"v0.68.3","strict":true,"agent_id":"copilot","agent_model":"claude-sonnet-4.5"} +# gh-aw-manifest: {"version":1,"secrets":["COPILOT_GITHUB_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GITHUB_TOKEN"],"actions":[{"repo":"actions/checkout","sha":"de0fac2e4500dabe0009e67214ff5f5447ce83dd","version":"v6.0.2"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"373c709c69115d41ff229c7e5df9f8788daa9553","version":"v9"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"ba90f2186d7ad780ec640f364005fa24e797b360","version":"v0.68.3"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.20"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.20"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.2.19"},{"image":"ghcr.io/github/github-mcp-server:v0.32.0"},{"image":"node:lts-alpine"}]} +# ___ _ _ +# / _ \ | | (_) +# | |_| | __ _ ___ _ __ | |_ _ ___ +# | _ |/ _` |/ _ \ '_ \| __| |/ __| +# | | | | (_| | __/ | | | |_| | (__ +# \_| |_/\__, |\___|_| |_|\__|_|\___| +# __/ | +# _ _ |___/ +# | | | | / _| | +# | | | | ___ _ __ _ __| |_| | _____ ____ +# | |/\| |/ _ \ '__| |/ /| _| |/ _ \ \ /\ / / ___| +# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ +# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ +# +# This file was automatically generated by gh-aw (v0.68.3). DO NOT EDIT. +# +# To update this file, edit the corresponding .md file and run: +# gh aw compile +# Not all edits will cause changes to this file. +# +# For more information: https://github.github.com/gh-aw/introduction/overview/ +# +# +# Secrets used: +# - COPILOT_GITHUB_TOKEN +# - GH_AW_GITHUB_MCP_SERVER_TOKEN +# - GH_AW_GITHUB_TOKEN +# - GITHUB_TOKEN +# +# Custom actions used: +# - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 +# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 +# - actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 +# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 +# - github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 +# +# Container images used: +# - ghcr.io/github/gh-aw-firewall/agent:0.25.20 +# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20 +# - ghcr.io/github/gh-aw-firewall/squid:0.25.20 +# - ghcr.io/github/gh-aw-mcpg:v0.2.19 +# - ghcr.io/github/github-mcp-server:v0.32.0 +# - node:lts-alpine + +name: ".NET for Apple Platforms PR Reviewer" +"on": + issue_comment: + types: + - created + - edited + # roles: # Roles processed as role check in pre-activation job + # - admin # Roles processed as role check in pre-activation job + # - maintainer # Roles processed as role check in pre-activation job + # - write # Roles processed as role check in pre-activation job + +permissions: {} + +concurrency: + group: "gh-aw-${{ github.workflow }}-${{ github.event.issue.number || github.event.pull_request.number || github.run_id }}" + +run-name: ".NET for Apple Platforms PR Reviewer" + +jobs: + activation: + needs: pre_activation + if: "needs.pre_activation.outputs.activated == 'true' && (github.event_name == 'issue_comment' && (startsWith(github.event.comment.body, '/review ') || startsWith(github.event.comment.body, '/review\n') || github.event.comment.body == '/review') && github.event.issue.pull_request != null || !(github.event_name == 'issue_comment'))" + runs-on: ubuntu-slim + permissions: + actions: read + contents: read + discussions: write + issues: write + pull-requests: write + outputs: + body: ${{ steps.sanitized.outputs.body }} + comment_id: ${{ steps.add-comment.outputs.comment-id }} + comment_repo: ${{ steps.add-comment.outputs.comment-repo }} + comment_url: ${{ steps.add-comment.outputs.comment-url }} + lockdown_check_failed: ${{ steps.generate_aw_info.outputs.lockdown_check_failed == 'true' }} + model: ${{ steps.generate_aw_info.outputs.model }} + secret_verification_result: ${{ steps.validate-secret.outputs.verification_result }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + slash_command: ${{ needs.pre_activation.outputs.matched_command }} + stale_lock_file_failed: ${{ steps.check-lock-file.outputs.stale_lock_file_failed == 'true' }} + text: ${{ steps.sanitized.outputs.text }} + title: ${{ steps.sanitized.outputs.title }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.pre_activation.outputs.setup-trace-id }} + - name: Generate agentic run info + id: generate_aw_info + env: + GH_AW_INFO_ENGINE_ID: "copilot" + GH_AW_INFO_ENGINE_NAME: "GitHub Copilot CLI" + GH_AW_INFO_MODEL: "claude-sonnet-4.5" + GH_AW_INFO_VERSION: "1.0.21" + GH_AW_INFO_AGENT_VERSION: "1.0.21" + GH_AW_INFO_CLI_VERSION: "v0.68.3" + GH_AW_INFO_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + GH_AW_INFO_EXPERIMENTAL: "false" + GH_AW_INFO_SUPPORTS_TOOLS_ALLOWLIST: "true" + GH_AW_INFO_STAGED: "false" + GH_AW_INFO_ALLOWED_DOMAINS: '["defaults","dotnet","github","aka.ms","dev.azure.com","microsoft.com","vsassets.io"]' + GH_AW_INFO_FIREWALL_ENABLED: "true" + GH_AW_INFO_AWF_VERSION: "v0.25.20" + GH_AW_INFO_AWMG_VERSION: "" + GH_AW_INFO_FIREWALL_TYPE: "squid" + GH_AW_COMPILED_STRICT: "true" + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_aw_info.cjs'); + await main(core, context); + - name: Add eyes reaction for immediate feedback + id: react + if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.id == github.repository_id + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_REACTION: "eyes" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/add_reaction.cjs'); + await main(); + - name: Validate COPILOT_GITHUB_TOKEN secret + id: validate-secret + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_multi_secret.sh" COPILOT_GITHUB_TOKEN 'GitHub Copilot CLI' https://github.github.com/gh-aw/reference/engines/#github-copilot-default + env: + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + - name: Checkout .github and .agents folders + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + sparse-checkout: | + .github + .agents + sparse-checkout-cone-mode: true + fetch-depth: 1 + - name: Check workflow lock file + id: check-lock-file + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_WORKFLOW_FILE: "macios-reviewer.lock.yml" + GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_workflow_timestamp_api.cjs'); + await main(); + - name: Check compile-agentic version + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_COMPILED_VERSION: "v0.68.3" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_version_updates.cjs'); + await main(); + - name: Compute current body text + id: sanitized + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/compute_text.cjs'); + await main(); + - name: Add comment with workflow run link + id: add-comment + if: github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment' || github.event_name == 'pull_request' && github.event.pull_request.head.repo.id == github.repository_id + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/add_workflow_run_comment.cjs'); + await main(); + - name: Create prompt with built-in context + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl + GH_AW_GITHUB_ACTOR: ${{ github.actor }} + GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} + GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} + GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} + # poutine:ignore untrusted_checkout_exec + run: | + bash "${RUNNER_TEMP}/gh-aw/actions/create_prompt_first.sh" + { + cat << 'GH_AW_PROMPT_31522cd090dd3137_EOF' + + GH_AW_PROMPT_31522cd090dd3137_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/xpia.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/temp_folder_prompt.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/markdown.md" + cat "${RUNNER_TEMP}/gh-aw/prompts/safe_outputs_prompt.md" + cat << 'GH_AW_PROMPT_31522cd090dd3137_EOF' + + Tools: create_pull_request_review_comment(max:50), submit_pull_request_review, missing_tool, missing_data, noop + + + The following GitHub context information is available for this workflow: + {{#if __GH_AW_GITHUB_ACTOR__ }} + - **actor**: __GH_AW_GITHUB_ACTOR__ + {{/if}} + {{#if __GH_AW_GITHUB_REPOSITORY__ }} + - **repository**: __GH_AW_GITHUB_REPOSITORY__ + {{/if}} + {{#if __GH_AW_GITHUB_WORKSPACE__ }} + - **workspace**: __GH_AW_GITHUB_WORKSPACE__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ }} + - **issue-number**: #__GH_AW_GITHUB_EVENT_ISSUE_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ }} + - **discussion-number**: #__GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ }} + - **pull-request-number**: #__GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER__ + {{/if}} + {{#if __GH_AW_GITHUB_EVENT_COMMENT_ID__ }} + - **comment-id**: __GH_AW_GITHUB_EVENT_COMMENT_ID__ + {{/if}} + {{#if __GH_AW_GITHUB_RUN_ID__ }} + - **workflow-run-id**: __GH_AW_GITHUB_RUN_ID__ + {{/if}} + + + GH_AW_PROMPT_31522cd090dd3137_EOF + cat "${RUNNER_TEMP}/gh-aw/prompts/github_mcp_tools_with_safeoutputs_prompt.md" + if [ "$GITHUB_EVENT_NAME" = "issue_comment" ] && [ -n "$GH_AW_IS_PR_COMMENT" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review_comment" ] || [ "$GITHUB_EVENT_NAME" = "pull_request_review" ]; then + cat "${RUNNER_TEMP}/gh-aw/prompts/pr_context_prompt.md" + fi + cat << 'GH_AW_PROMPT_31522cd090dd3137_EOF' + + {{#runtime-import .github/workflows/macios-reviewer.md}} + GH_AW_PROMPT_31522cd090dd3137_EOF + } > "$GH_AW_PROMPT" + - name: Interpolate variables and render templates + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs'); + await main(); + - name: Substitute placeholders + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_GITHUB_ACTOR: ${{ github.actor }} + GH_AW_GITHUB_EVENT_COMMENT_ID: ${{ github.event.comment.id }} + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: ${{ github.event.discussion.number }} + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: ${{ github.event.issue.number }} + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }} + GH_AW_GITHUB_REPOSITORY: ${{ github.repository }} + GH_AW_GITHUB_RUN_ID: ${{ github.run_id }} + GH_AW_GITHUB_WORKSPACE: ${{ github.workspace }} + GH_AW_IS_PR_COMMENT: ${{ github.event.issue.pull_request && 'true' || '' }} + GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: ${{ needs.pre_activation.outputs.activated }} + GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND: ${{ needs.pre_activation.outputs.matched_command }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + + const substitutePlaceholders = require('${{ runner.temp }}/gh-aw/actions/substitute_placeholders.cjs'); + + // Call the substitution function + return await substitutePlaceholders({ + file: process.env.GH_AW_PROMPT, + substitutions: { + GH_AW_GITHUB_ACTOR: process.env.GH_AW_GITHUB_ACTOR, + GH_AW_GITHUB_EVENT_COMMENT_ID: process.env.GH_AW_GITHUB_EVENT_COMMENT_ID, + GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER: process.env.GH_AW_GITHUB_EVENT_DISCUSSION_NUMBER, + GH_AW_GITHUB_EVENT_ISSUE_NUMBER: process.env.GH_AW_GITHUB_EVENT_ISSUE_NUMBER, + GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER: process.env.GH_AW_GITHUB_EVENT_PULL_REQUEST_NUMBER, + GH_AW_GITHUB_REPOSITORY: process.env.GH_AW_GITHUB_REPOSITORY, + GH_AW_GITHUB_RUN_ID: process.env.GH_AW_GITHUB_RUN_ID, + GH_AW_GITHUB_WORKSPACE: process.env.GH_AW_GITHUB_WORKSPACE, + GH_AW_IS_PR_COMMENT: process.env.GH_AW_IS_PR_COMMENT, + GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_ACTIVATED, + GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND: process.env.GH_AW_NEEDS_PRE_ACTIVATION_OUTPUTS_MATCHED_COMMAND + } + }); + - name: Validate prompt placeholders + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/validate_prompt_placeholders.sh" + - name: Print prompt + env: + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + # poutine:ignore untrusted_checkout_exec + run: bash "${RUNNER_TEMP}/gh-aw/actions/print_prompt_summary.sh" + - name: Upload activation artifact + if: success() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: activation + path: | + /tmp/gh-aw/aw_info.json + /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/github_rate_limits.jsonl + if-no-files-found: ignore + retention-days: 1 + + agent: + needs: activation + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + env: + DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} + GH_AW_ASSETS_ALLOWED_EXTS: "" + GH_AW_ASSETS_BRANCH: "" + GH_AW_ASSETS_MAX_SIZE_KB: 0 + GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs + GH_AW_WORKFLOW_ID_SANITIZED: maciosreviewer + outputs: + agentic_engine_timeout: ${{ steps.detect-copilot-errors.outputs.agentic_engine_timeout || 'false' }} + checkout_pr_success: ${{ steps.checkout-pr.outputs.checkout_pr_success || 'true' }} + effective_tokens: ${{ steps.parse-mcp-gateway.outputs.effective_tokens }} + has_patch: ${{ steps.collect_output.outputs.has_patch }} + inference_access_error: ${{ steps.detect-copilot-errors.outputs.inference_access_error || 'false' }} + mcp_policy_error: ${{ steps.detect-copilot-errors.outputs.mcp_policy_error || 'false' }} + model: ${{ needs.activation.outputs.model }} + model_not_supported_error: ${{ steps.detect-copilot-errors.outputs.model_not_supported_error || 'false' }} + output: ${{ steps.collect_output.outputs.output }} + output_types: ${{ steps.collect_output.outputs.output_types }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + - name: Set runtime paths + id: set-runtime-paths + run: | + { + echo "GH_AW_SAFE_OUTPUTS=${RUNNER_TEMP}/gh-aw/safeoutputs/outputs.jsonl" + echo "GH_AW_SAFE_OUTPUTS_CONFIG_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" + echo "GH_AW_SAFE_OUTPUTS_TOOLS_PATH=${RUNNER_TEMP}/gh-aw/safeoutputs/tools.json" + } >> "$GITHUB_OUTPUT" + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Create gh-aw temp directory + run: bash "${RUNNER_TEMP}/gh-aw/actions/create_gh_aw_tmp_dir.sh" + - name: Configure gh CLI for GitHub Enterprise + run: bash "${RUNNER_TEMP}/gh-aw/actions/configure_gh_for_ghe.sh" + env: + GH_TOKEN: ${{ github.token }} + - name: Configure Git credentials + env: + REPO_NAME: ${{ github.repository }} + SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git config --global am.keepcr true + # Re-authenticate git with GitHub token + SERVER_URL_STRIPPED="${SERVER_URL#https://}" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + echo "Git configured with standard GitHub Actions identity" + - name: Checkout PR branch + id: checkout-pr + if: | + github.event.pull_request || github.event.issue.pull_request + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/checkout_pr_branch.cjs'); + await main(); + - name: Install GitHub Copilot CLI + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21 + env: + GH_HOST: github.com + - name: Install AWF binary + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20 + - name: Parse integrity filter lists + id: parse-guard-vars + env: + GH_AW_BLOCKED_USERS_VAR: ${{ vars.GH_AW_GITHUB_BLOCKED_USERS || '' }} + GH_AW_TRUSTED_USERS_VAR: ${{ vars.GH_AW_GITHUB_TRUSTED_USERS || '' }} + GH_AW_APPROVAL_LABELS_VAR: ${{ vars.GH_AW_GITHUB_APPROVAL_LABELS || '' }} + run: bash "${RUNNER_TEMP}/gh-aw/actions/parse_guard_list.sh" + - name: Download container images + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.20 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20 ghcr.io/github/gh-aw-firewall/squid:0.25.20 ghcr.io/github/gh-aw-mcpg:v0.2.19 ghcr.io/github/github-mcp-server:v0.32.0 node:lts-alpine + - name: Write Safe Outputs Config + run: | + mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs" + mkdir -p /tmp/gh-aw/safeoutputs + mkdir -p /tmp/gh-aw/mcp-logs/safeoutputs + cat > "${RUNNER_TEMP}/gh-aw/safeoutputs/config.json" << 'GH_AW_SAFE_OUTPUTS_CONFIG_89a2d4b9522a1c3e_EOF' + {"create_pull_request_review_comment":{"max":50,"side":"RIGHT"},"create_report_incomplete_issue":{},"missing_data":{},"missing_tool":{},"noop":{"max":1,"report-as-issue":"true"},"report_incomplete":{},"submit_pull_request_review":{"allowed_events":["COMMENT","REQUEST_CHANGES"],"max":1}} + GH_AW_SAFE_OUTPUTS_CONFIG_89a2d4b9522a1c3e_EOF + - name: Write Safe Outputs Tools + env: + GH_AW_TOOLS_META_JSON: | + { + "description_suffixes": { + "create_pull_request_review_comment": " CONSTRAINTS: Maximum 50 review comment(s) can be created. Comments will be on the RIGHT side of the diff.", + "submit_pull_request_review": " CONSTRAINTS: Maximum 1 review(s) can be submitted." + }, + "repo_params": {}, + "dynamic_tools": [] + } + GH_AW_VALIDATION_JSON: | + { + "create_pull_request_review_comment": { + "defaultMax": 1, + "fields": { + "body": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "line": { + "required": true, + "positiveInteger": true + }, + "path": { + "required": true, + "type": "string" + }, + "pull_request_number": { + "optionalPositiveInteger": true + }, + "repo": { + "type": "string", + "maxLength": 256 + }, + "side": { + "type": "string", + "enum": [ + "LEFT", + "RIGHT" + ] + }, + "start_line": { + "optionalPositiveInteger": true + } + }, + "customValidation": "startLineLessOrEqualLine" + }, + "missing_data": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "context": { + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "data_type": { + "type": "string", + "sanitize": true, + "maxLength": 128 + }, + "reason": { + "type": "string", + "sanitize": true, + "maxLength": 256 + } + } + }, + "missing_tool": { + "defaultMax": 20, + "fields": { + "alternatives": { + "type": "string", + "sanitize": true, + "maxLength": 512 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 256 + }, + "tool": { + "type": "string", + "sanitize": true, + "maxLength": 128 + } + } + }, + "noop": { + "defaultMax": 1, + "fields": { + "message": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 65000 + } + } + }, + "report_incomplete": { + "defaultMax": 5, + "fields": { + "details": { + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "reason": { + "required": true, + "type": "string", + "sanitize": true, + "maxLength": 1024 + } + } + }, + "submit_pull_request_review": { + "defaultMax": 1, + "fields": { + "body": { + "type": "string", + "sanitize": true, + "maxLength": 65000 + }, + "event": { + "type": "string", + "enum": [ + "APPROVE", + "REQUEST_CHANGES", + "COMMENT" + ] + } + } + } + } + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/generate_safe_outputs_tools.cjs'); + await main(); + - name: Generate Safe Outputs MCP Server Config + id: safe-outputs-config + run: | + # Generate a secure random API key (360 bits of entropy, 40+ chars) + # Mask immediately to prevent timing vulnerabilities + API_KEY=$(openssl rand -base64 45 | tr -d '/+=') + echo "::add-mask::${API_KEY}" + + PORT=3001 + + # Set outputs for next steps + { + echo "safe_outputs_api_key=${API_KEY}" + echo "safe_outputs_port=${PORT}" + } >> "$GITHUB_OUTPUT" + + echo "Safe Outputs MCP server will run on port ${PORT}" + + - name: Start Safe Outputs MCP HTTP Server + id: safe-outputs-start + env: + DEBUG: '*' + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} + GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-config.outputs.safe_outputs_port }} + GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-config.outputs.safe_outputs_api_key }} + GH_AW_SAFE_OUTPUTS_TOOLS_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/tools.json + GH_AW_SAFE_OUTPUTS_CONFIG_PATH: ${{ runner.temp }}/gh-aw/safeoutputs/config.json + GH_AW_MCP_LOG_DIR: /tmp/gh-aw/mcp-logs/safeoutputs + run: | + # Environment variables are set above to prevent template injection + export DEBUG + export GH_AW_SAFE_OUTPUTS + export GH_AW_SAFE_OUTPUTS_PORT + export GH_AW_SAFE_OUTPUTS_API_KEY + export GH_AW_SAFE_OUTPUTS_TOOLS_PATH + export GH_AW_SAFE_OUTPUTS_CONFIG_PATH + export GH_AW_MCP_LOG_DIR + + bash "${RUNNER_TEMP}/gh-aw/actions/start_safe_outputs_server.sh" + + - name: Start MCP Gateway + id: start-mcp-gateway + env: + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} + GH_AW_SAFE_OUTPUTS_API_KEY: ${{ steps.safe-outputs-start.outputs.api_key }} + GH_AW_SAFE_OUTPUTS_PORT: ${{ steps.safe-outputs-start.outputs.port }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + run: | + set -eo pipefail + mkdir -p /tmp/gh-aw/mcp-config + + # Export gateway environment variables for MCP config and gateway script + export MCP_GATEWAY_PORT="80" + export MCP_GATEWAY_DOMAIN="host.docker.internal" + MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=') + echo "::add-mask::${MCP_GATEWAY_API_KEY}" + export MCP_GATEWAY_API_KEY + export MCP_GATEWAY_PAYLOAD_DIR="/tmp/gh-aw/mcp-payloads" + mkdir -p "${MCP_GATEWAY_PAYLOAD_DIR}" + export MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD="524288" + export DEBUG="*" + + export GH_AW_ENGINE="copilot" + export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host -v /var/run/docker.sock:/var/run/docker.sock -e MCP_GATEWAY_PORT -e MCP_GATEWAY_DOMAIN -e MCP_GATEWAY_API_KEY -e MCP_GATEWAY_PAYLOAD_DIR -e MCP_GATEWAY_PAYLOAD_SIZE_THRESHOLD -e DEBUG -e MCP_GATEWAY_LOG_DIR -e GH_AW_MCP_LOG_DIR -e GH_AW_SAFE_OUTPUTS -e GH_AW_SAFE_OUTPUTS_CONFIG_PATH -e GH_AW_SAFE_OUTPUTS_TOOLS_PATH -e GH_AW_ASSETS_BRANCH -e GH_AW_ASSETS_MAX_SIZE_KB -e GH_AW_ASSETS_ALLOWED_EXTS -e DEFAULT_BRANCH -e GITHUB_MCP_SERVER_TOKEN -e GITHUB_MCP_GUARD_MIN_INTEGRITY -e GITHUB_MCP_GUARD_REPOS -e GITHUB_REPOSITORY -e GITHUB_SERVER_URL -e GITHUB_SHA -e GITHUB_WORKSPACE -e GITHUB_TOKEN -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RUN_ATTEMPT -e GITHUB_JOB -e GITHUB_ACTION -e GITHUB_EVENT_NAME -e GITHUB_EVENT_PATH -e GITHUB_ACTOR -e GITHUB_ACTOR_ID -e GITHUB_TRIGGERING_ACTOR -e GITHUB_WORKFLOW -e GITHUB_WORKFLOW_REF -e GITHUB_WORKFLOW_SHA -e GITHUB_REF -e GITHUB_REF_NAME -e GITHUB_REF_TYPE -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GH_AW_SAFE_OUTPUTS_PORT -e GH_AW_SAFE_OUTPUTS_API_KEY -v /tmp/gh-aw/mcp-payloads:/tmp/gh-aw/mcp-payloads:rw -v /opt:/opt:ro -v /tmp:/tmp:rw -v '"${GITHUB_WORKSPACE}"':'"${GITHUB_WORKSPACE}"':rw ghcr.io/github/gh-aw-mcpg:v0.2.19' + + mkdir -p /home/runner/.copilot + cat << GH_AW_MCP_CONFIG_8d4f4bdb31699167_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh" + { + "mcpServers": { + "github": { + "type": "stdio", + "container": "ghcr.io/github/github-mcp-server:v0.32.0", + "env": { + "GITHUB_HOST": "\${GITHUB_SERVER_URL}", + "GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}", + "GITHUB_READ_ONLY": "1", + "GITHUB_TOOLSETS": "pull_requests,repos" + }, + "guard-policies": { + "allow-only": { + "approval-labels": ${{ steps.parse-guard-vars.outputs.approval_labels }}, + "blocked-users": ${{ steps.parse-guard-vars.outputs.blocked_users }}, + "min-integrity": "none", + "repos": "all", + "trusted-users": ${{ steps.parse-guard-vars.outputs.trusted_users }} + } + } + }, + "safeoutputs": { + "type": "http", + "url": "http://host.docker.internal:$GH_AW_SAFE_OUTPUTS_PORT", + "headers": { + "Authorization": "\${GH_AW_SAFE_OUTPUTS_API_KEY}" + }, + "guard-policies": { + "write-sink": { + "accept": [ + "*" + ] + } + } + } + }, + "gateway": { + "port": $MCP_GATEWAY_PORT, + "domain": "${MCP_GATEWAY_DOMAIN}", + "apiKey": "${MCP_GATEWAY_API_KEY}", + "payloadDir": "${MCP_GATEWAY_PAYLOAD_DIR}" + } + } + GH_AW_MCP_CONFIG_8d4f4bdb31699167_EOF + - name: Download activation artifact + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: activation + path: /tmp/gh-aw + - name: Clean git credentials + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/clean_git_credentials.sh" + - name: Execute GitHub Copilot CLI + id: agentic_execution + # Copilot CLI tool arguments (sorted): + timeout-minutes: 20 + run: | + set -o pipefail + touch /tmp/gh-aw/agent-step-summary.md + (umask 177 && touch /tmp/gh-aw/agent-stdio.log) + # shellcheck disable=SC1003 + sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --exclude-env GITHUB_MCP_SERVER_TOKEN --exclude-env MCP_GATEWAY_API_KEY --allow-domains '*.githubusercontent.com,*.vsblob.vsassets.io,aka.ms,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.nuget.org,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,azuresearch-usnc.nuget.org,azuresearch-ussc.nuget.org,builds.dotnet.microsoft.com,ci.dot.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dc.services.visualstudio.com,dev.azure.com,dist.nuget.org,docs.github.com,dot.net,dotnet.microsoft.com,dotnetcli.blob.core.windows.net,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,microsoft.com,nuget.org,nuget.pkg.github.com,nugetregistryv2prod.blob.core.windows.net,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,oneocsp.microsoft.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,pkgs.dev.azure.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,vsassets.io,www.googleapis.com,www.microsoft.com' --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.20 --skip-pull --enable-api-proxy \ + -- /bin/bash -c 'node ${RUNNER_TEMP}/gh-aw/actions/copilot_driver.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --allow-all-paths --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log + env: + COPILOT_AGENT_RUNNER_TYPE: STANDALONE + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + COPILOT_MODEL: claude-sonnet-4.5 + GH_AW_MCP_CONFIG: /home/runner/.copilot/mcp-config.json + GH_AW_PHASE: agent + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} + GH_AW_VERSION: v0.68.3 + GITHUB_API_URL: ${{ github.api_url }} + GITHUB_AW: true + GITHUB_HEAD_REF: ${{ github.head_ref }} + GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + GITHUB_REF_NAME: ${{ github.ref_name }} + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md + GITHUB_WORKSPACE: ${{ github.workspace }} + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_AUTHOR_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + XDG_CONFIG_HOME: /home/runner + - name: Detect Copilot errors + id: detect-copilot-errors + if: always() + continue-on-error: true + run: node "${RUNNER_TEMP}/gh-aw/actions/detect_copilot_errors.cjs" + - name: Configure Git credentials + env: + REPO_NAME: ${{ github.repository }} + SERVER_URL: ${{ github.server_url }} + GITHUB_TOKEN: ${{ github.token }} + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git config --global am.keepcr true + # Re-authenticate git with GitHub token + SERVER_URL_STRIPPED="${SERVER_URL#https://}" + git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@${SERVER_URL_STRIPPED}/${REPO_NAME}.git" + echo "Git configured with standard GitHub Actions identity" + - name: Copy Copilot session state files to logs + if: always() + continue-on-error: true + run: bash "${RUNNER_TEMP}/gh-aw/actions/copy_copilot_session_state.sh" + - name: Stop MCP Gateway + if: always() + continue-on-error: true + env: + MCP_GATEWAY_PORT: ${{ steps.start-mcp-gateway.outputs.gateway-port }} + MCP_GATEWAY_API_KEY: ${{ steps.start-mcp-gateway.outputs.gateway-api-key }} + GATEWAY_PID: ${{ steps.start-mcp-gateway.outputs.gateway-pid }} + run: | + bash "${RUNNER_TEMP}/gh-aw/actions/stop_mcp_gateway.sh" "$GATEWAY_PID" + - name: Redact secrets in logs + if: always() + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/redact_secrets.cjs'); + await main(); + env: + GH_AW_SECRET_NAMES: 'COPILOT_GITHUB_TOKEN,GH_AW_GITHUB_MCP_SERVER_TOKEN,GH_AW_GITHUB_TOKEN,GITHUB_TOKEN' + SECRET_COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + SECRET_GH_AW_GITHUB_MCP_SERVER_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN }} + SECRET_GH_AW_GITHUB_TOKEN: ${{ secrets.GH_AW_GITHUB_TOKEN }} + SECRET_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Append agent step summary + if: always() + run: bash "${RUNNER_TEMP}/gh-aw/actions/append_agent_step_summary.sh" + - name: Copy Safe Outputs + if: always() + env: + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} + run: | + mkdir -p /tmp/gh-aw + cp "$GH_AW_SAFE_OUTPUTS" /tmp/gh-aw/safeoutputs.jsonl 2>/dev/null || true + - name: Ingest agent output + id: collect_output + if: always() + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_SAFE_OUTPUTS: ${{ steps.set-runtime-paths.outputs.GH_AW_SAFE_OUTPUTS }} + GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,*.vsblob.vsassets.io,aka.ms,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.nuget.org,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,azuresearch-usnc.nuget.org,azuresearch-ussc.nuget.org,builds.dotnet.microsoft.com,ci.dot.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dc.services.visualstudio.com,dev.azure.com,dist.nuget.org,docs.github.com,dot.net,dotnet.microsoft.com,dotnetcli.blob.core.windows.net,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,microsoft.com,nuget.org,nuget.pkg.github.com,nugetregistryv2prod.blob.core.windows.net,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,oneocsp.microsoft.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,pkgs.dev.azure.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,vsassets.io,www.googleapis.com,www.microsoft.com" + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_API_URL: ${{ github.api_url }} + GH_AW_COMMAND: review + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/collect_ndjson_output.cjs'); + await main(); + - name: Parse agent logs for step summary + if: always() + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/ + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_copilot_log.cjs'); + await main(); + - name: Parse MCP Gateway logs for step summary + if: always() + id: parse-mcp-gateway + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_mcp_gateway_log.cjs'); + await main(); + - name: Print firewall logs + if: always() + continue-on-error: true + env: + AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs + run: | + # Fix permissions on firewall logs so they can be uploaded as artifacts + # AWF runs with sudo, creating files owned by root + sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall/logs 2>/dev/null || true + # Only run awf logs summary if awf command exists (it may not be installed if workflow failed before install step) + if command -v awf &> /dev/null; then + awf logs summary | tee -a "$GITHUB_STEP_SUMMARY" + else + echo 'AWF binary not installed, skipping firewall log summary' + fi + - name: Parse token usage for step summary + if: always() + continue-on-error: true + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_token_usage.cjs'); + await main(); + - name: Write agent output placeholder if missing + if: always() + run: | + if [ ! -f /tmp/gh-aw/agent_output.json ]; then + echo '{"items":[]}' > /tmp/gh-aw/agent_output.json + fi + - name: Upload agent artifacts + if: always() + continue-on-error: true + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: agent + path: | + /tmp/gh-aw/aw-prompts/prompt.txt + /tmp/gh-aw/sandbox/agent/logs/ + /tmp/gh-aw/redacted-urls.log + /tmp/gh-aw/mcp-logs/ + /tmp/gh-aw/proxy-logs/ + !/tmp/gh-aw/proxy-logs/proxy-tls/ + /tmp/gh-aw/agent_usage.json + /tmp/gh-aw/agent-stdio.log + /tmp/gh-aw/agent/ + /tmp/gh-aw/github_rate_limits.jsonl + /tmp/gh-aw/safeoutputs.jsonl + /tmp/gh-aw/agent_output.json + /tmp/gh-aw/aw-*.patch + /tmp/gh-aw/aw-*.bundle + /tmp/gh-aw/sandbox/firewall/logs/ + /tmp/gh-aw/sandbox/firewall/audit/ + if-no-files-found: ignore + + conclusion: + needs: + - activation + - agent + - detection + - safe_outputs + if: > + always() && (needs.agent.result != 'skipped' || needs.activation.outputs.lockdown_check_failed == 'true' || + needs.activation.outputs.stale_lock_file_failed == 'true') + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + concurrency: + group: "gh-aw-conclusion-macios-reviewer" + cancel-in-progress: false + outputs: + incomplete_count: ${{ steps.report_incomplete.outputs.incomplete_count }} + noop_message: ${{ steps.noop.outputs.noop_message }} + tools_reported: ${{ steps.missing_tool.outputs.tools_reported }} + total_count: ${{ steps.missing_tool.outputs.total_count }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Process no-op messages + id: noop + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_NOOP_MAX: "1" + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_NOOP_REPORT_AS_ISSUE: "true" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_noop_message.cjs'); + await main(); + - name: Log detection run + id: detection_runs + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_detection_runs.cjs'); + await main(); + - name: Record missing tool + id: missing_tool + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/missing_tool.cjs'); + await main(); + - name: Record incomplete + id: report_incomplete + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true" + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/report_incomplete_handler.cjs'); + await main(); + - name: Handle agent failure + id: handle_agent_failure + if: always() + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_WORKFLOW_ID: "macios-reviewer" + GH_AW_ENGINE_ID: "copilot" + GH_AW_SECRET_VERIFICATION_RESULT: ${{ needs.activation.outputs.secret_verification_result }} + GH_AW_CHECKOUT_PR_SUCCESS: ${{ needs.agent.outputs.checkout_pr_success }} + GH_AW_INFERENCE_ACCESS_ERROR: ${{ needs.agent.outputs.inference_access_error }} + GH_AW_MCP_POLICY_ERROR: ${{ needs.agent.outputs.mcp_policy_error }} + GH_AW_AGENTIC_ENGINE_TIMEOUT: ${{ needs.agent.outputs.agentic_engine_timeout }} + GH_AW_MODEL_NOT_SUPPORTED_ERROR: ${{ needs.agent.outputs.model_not_supported_error }} + GH_AW_LOCKDOWN_CHECK_FAILED: ${{ needs.activation.outputs.lockdown_check_failed }} + GH_AW_STALE_LOCK_FILE_FAILED: ${{ needs.activation.outputs.stale_lock_file_failed }} + GH_AW_GROUP_REPORTS: "false" + GH_AW_FAILURE_REPORT_AS_ISSUE: "true" + GH_AW_TIMEOUT_MINUTES: "20" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/handle_agent_failure.cjs'); + await main(); + - name: Update reaction comment with completion status + id: conclusion + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_COMMENT_ID: ${{ needs.activation.outputs.comment_id }} + GH_AW_COMMENT_REPO: ${{ needs.activation.outputs.comment_repo }} + GH_AW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + GH_AW_AGENT_CONCLUSION: ${{ needs.agent.result }} + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/notify_comment_error.cjs'); + await main(); + + detection: + needs: + - activation + - agent + if: > + always() && needs.agent.result != 'skipped' && (needs.agent.outputs.output_types != '' || needs.agent.outputs.has_patch == 'true') + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + detection_conclusion: ${{ steps.detection_conclusion.outputs.conclusion }} + detection_reason: ${{ steps.detection_conclusion.outputs.reason }} + detection_success: ${{ steps.detection_conclusion.outputs.success }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Checkout repository for patch context + if: needs.agent.outputs.has_patch == 'true' + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + # --- Threat Detection --- + - name: Clean stale firewall files from agent artifact + run: | + rm -rf /tmp/gh-aw/sandbox/firewall/logs + rm -rf /tmp/gh-aw/sandbox/firewall/audit + - name: Download container images + run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.20 ghcr.io/github/gh-aw-firewall/api-proxy:0.25.20 ghcr.io/github/gh-aw-firewall/squid:0.25.20 + - name: Check if detection needed + id: detection_guard + if: always() + env: + OUTPUT_TYPES: ${{ needs.agent.outputs.output_types }} + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} + run: | + if [[ -n "$OUTPUT_TYPES" || "$HAS_PATCH" == "true" ]]; then + echo "run_detection=true" >> "$GITHUB_OUTPUT" + echo "Detection will run: output_types=$OUTPUT_TYPES, has_patch=$HAS_PATCH" + else + echo "run_detection=false" >> "$GITHUB_OUTPUT" + echo "Detection skipped: no agent outputs or patches to analyze" + fi + - name: Clear MCP configuration for detection + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + rm -f /tmp/gh-aw/mcp-config/mcp-servers.json + rm -f /home/runner/.copilot/mcp-config.json + rm -f "$GITHUB_WORKSPACE/.gemini/settings.json" + - name: Prepare threat detection files + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + mkdir -p /tmp/gh-aw/threat-detection/aw-prompts + cp /tmp/gh-aw/aw-prompts/prompt.txt /tmp/gh-aw/threat-detection/aw-prompts/prompt.txt 2>/dev/null || true + cp /tmp/gh-aw/agent_output.json /tmp/gh-aw/threat-detection/agent_output.json 2>/dev/null || true + for f in /tmp/gh-aw/aw-*.patch; do + [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true + done + for f in /tmp/gh-aw/aw-*.bundle; do + [ -f "$f" ] && cp "$f" /tmp/gh-aw/threat-detection/ 2>/dev/null || true + done + echo "Prepared threat detection files:" + ls -la /tmp/gh-aw/threat-detection/ 2>/dev/null || true + - name: Setup threat detection + if: always() && steps.detection_guard.outputs.run_detection == 'true' + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + WORKFLOW_DESCRIPTION: "No description provided" + HAS_PATCH: ${{ needs.agent.outputs.has_patch }} + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/setup_threat_detection.cjs'); + await main(); + - name: Ensure threat-detection directory and log + if: always() && steps.detection_guard.outputs.run_detection == 'true' + run: | + mkdir -p /tmp/gh-aw/threat-detection + touch /tmp/gh-aw/threat-detection/detection.log + - name: Install GitHub Copilot CLI + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21 + env: + GH_HOST: github.com + - name: Install AWF binary + run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20 + - name: Execute GitHub Copilot CLI + if: always() && steps.detection_guard.outputs.run_detection == 'true' + id: detection_agentic_execution + # Copilot CLI tool arguments (sorted): + timeout-minutes: 20 + run: | + set -o pipefail + touch /tmp/gh-aw/agent-step-summary.md + (umask 177 && touch /tmp/gh-aw/threat-detection/detection.log) + # shellcheck disable=SC1003 + sudo -E awf --container-workdir "${GITHUB_WORKSPACE}" --mount "${RUNNER_TEMP}/gh-aw:${RUNNER_TEMP}/gh-aw:ro" --mount "${RUNNER_TEMP}/gh-aw:/host${RUNNER_TEMP}/gh-aw:ro" --env-all --exclude-env COPILOT_GITHUB_TOKEN --allow-domains api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,github.com,host.docker.internal,telemetry.enterprise.githubcopilot.com --log-level info --proxy-logs-dir /tmp/gh-aw/sandbox/firewall/logs --audit-dir /tmp/gh-aw/sandbox/firewall/audit --enable-host-access --image-tag 0.25.20 --skip-pull --enable-api-proxy \ + -- /bin/bash -c 'node ${RUNNER_TEMP}/gh-aw/actions/copilot_driver.cjs /usr/local/bin/copilot --add-dir /tmp/gh-aw/ --log-level all --log-dir /tmp/gh-aw/sandbox/agent/logs/ --disable-builtin-mcps --no-ask-user --allow-all-tools --add-dir "${GITHUB_WORKSPACE}" --prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"' 2>&1 | tee -a /tmp/gh-aw/threat-detection/detection.log + env: + COPILOT_AGENT_RUNNER_TYPE: STANDALONE + COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }} + COPILOT_MODEL: claude-sonnet-4.5 + GH_AW_PHASE: detection + GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt + GH_AW_VERSION: v0.68.3 + GITHUB_API_URL: ${{ github.api_url }} + GITHUB_AW: true + GITHUB_HEAD_REF: ${{ github.head_ref }} + GITHUB_REF_NAME: ${{ github.ref_name }} + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_STEP_SUMMARY: /tmp/gh-aw/agent-step-summary.md + GITHUB_WORKSPACE: ${{ github.workspace }} + GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_AUTHOR_NAME: github-actions[bot] + GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com + GIT_COMMITTER_NAME: github-actions[bot] + XDG_CONFIG_HOME: /home/runner + - name: Upload threat detection log + if: always() && steps.detection_guard.outputs.run_detection == 'true' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: detection + path: /tmp/gh-aw/threat-detection/detection.log + if-no-files-found: ignore + - name: Parse and conclude threat detection + id: detection_conclusion + if: always() + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }} + GH_AW_DETECTION_CONTINUE_ON_ERROR: "true" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/parse_threat_detection_results.cjs'); + await main(); + + pre_activation: + if: "github.event_name == 'issue_comment' && (startsWith(github.event.comment.body, '/review ') || startsWith(github.event.comment.body, '/review\n') || github.event.comment.body == '/review') && github.event.issue.pull_request != null || !(github.event_name == 'issue_comment')" + runs-on: ubuntu-slim + outputs: + activated: ${{ steps.check_membership.outputs.is_team_member == 'true' && steps.check_command_position.outputs.command_position_ok == 'true' }} + matched_command: ${{ steps.check_command_position.outputs.matched_command }} + setup-trace-id: ${{ steps.setup.outputs.trace-id }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + - name: Check team membership for command workflow + id: check_membership + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_REQUIRED_ROLES: "admin,maintainer,write" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_membership.cjs'); + await main(); + - name: Check command position + id: check_command_position + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_COMMANDS: "[\"review\"]" + with: + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/check_command_position.cjs'); + await main(); + + safe_outputs: + needs: + - activation + - agent + - detection + if: (!cancelled()) && needs.agent.result != 'skipped' && needs.detection.result == 'success' + runs-on: ubuntu-slim + permissions: + contents: read + pull-requests: write + timeout-minutes: 15 + env: + GH_AW_CALLER_WORKFLOW_ID: "${{ github.repository }}/macios-reviewer" + GH_AW_DETECTION_CONCLUSION: ${{ needs.detection.outputs.detection_conclusion }} + GH_AW_DETECTION_REASON: ${{ needs.detection.outputs.detection_reason }} + GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }} + GH_AW_ENGINE_ID: "copilot" + GH_AW_ENGINE_MODEL: "claude-sonnet-4.5" + GH_AW_WORKFLOW_ID: "macios-reviewer" + GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer" + outputs: + code_push_failure_count: ${{ steps.process_safe_outputs.outputs.code_push_failure_count }} + code_push_failure_errors: ${{ steps.process_safe_outputs.outputs.code_push_failure_errors }} + create_discussion_error_count: ${{ steps.process_safe_outputs.outputs.create_discussion_error_count }} + create_discussion_errors: ${{ steps.process_safe_outputs.outputs.create_discussion_errors }} + process_safe_outputs_processed_count: ${{ steps.process_safe_outputs.outputs.processed_count }} + process_safe_outputs_temporary_id_map: ${{ steps.process_safe_outputs.outputs.temporary_id_map }} + steps: + - name: Setup Scripts + id: setup + uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3 + with: + destination: ${{ runner.temp }}/gh-aw/actions + job-name: ${{ github.job }} + trace-id: ${{ needs.activation.outputs.setup-trace-id }} + - name: Download agent output artifact + id: download-agent-output + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: agent + path: /tmp/gh-aw/ + - name: Setup agent output environment variable + id: setup-agent-output-env + if: steps.download-agent-output.outcome == 'success' + run: | + mkdir -p /tmp/gh-aw/ + find "/tmp/gh-aw/" -type f -print + echo "GH_AW_AGENT_OUTPUT=/tmp/gh-aw/agent_output.json" >> "$GITHUB_OUTPUT" + - name: Configure GH_HOST for enterprise compatibility + id: ghes-host-config + shell: bash + run: | + # Derive GH_HOST from GITHUB_SERVER_URL so the gh CLI targets the correct + # GitHub instance (GHES/GHEC). On github.com this is a harmless no-op. + GH_HOST="${GITHUB_SERVER_URL#https://}" + GH_HOST="${GH_HOST#http://}" + echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV" + - name: Process Safe Outputs + id: process_safe_outputs + uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9 + env: + GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }} + GH_AW_ALLOWED_DOMAINS: "*.githubusercontent.com,*.vsblob.vsassets.io,aka.ms,api.business.githubcopilot.com,api.enterprise.githubcopilot.com,api.github.com,api.githubcopilot.com,api.individual.githubcopilot.com,api.nuget.org,api.snapcraft.io,archive.ubuntu.com,azure.archive.ubuntu.com,azuresearch-usnc.nuget.org,azuresearch-ussc.nuget.org,builds.dotnet.microsoft.com,ci.dot.net,codeload.github.com,crl.geotrust.com,crl.globalsign.com,crl.identrust.com,crl.sectigo.com,crl.thawte.com,crl.usertrust.com,crl.verisign.com,crl3.digicert.com,crl4.digicert.com,crls.ssl.com,dc.services.visualstudio.com,dev.azure.com,dist.nuget.org,docs.github.com,dot.net,dotnet.microsoft.com,dotnetcli.blob.core.windows.net,github-cloud.githubusercontent.com,github-cloud.s3.amazonaws.com,github.blog,github.com,github.githubassets.com,host.docker.internal,json-schema.org,json.schemastore.org,keyserver.ubuntu.com,lfs.github.com,microsoft.com,nuget.org,nuget.pkg.github.com,nugetregistryv2prod.blob.core.windows.net,objects.githubusercontent.com,ocsp.digicert.com,ocsp.geotrust.com,ocsp.globalsign.com,ocsp.identrust.com,ocsp.sectigo.com,ocsp.ssl.com,ocsp.thawte.com,ocsp.usertrust.com,ocsp.verisign.com,oneocsp.microsoft.com,packagecloud.io,packages.cloud.google.com,packages.microsoft.com,pkgs.dev.azure.com,ppa.launchpad.net,raw.githubusercontent.com,registry.npmjs.org,s.symcb.com,s.symcd.com,security.ubuntu.com,telemetry.enterprise.githubcopilot.com,ts-crl.ws.symantec.com,ts-ocsp.ws.symantec.com,vsassets.io,www.googleapis.com,www.microsoft.com" + GITHUB_SERVER_URL: ${{ github.server_url }} + GITHUB_API_URL: ${{ github.api_url }} + GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG: "{\"create_pull_request_review_comment\":{\"max\":50,\"side\":\"RIGHT\"},\"create_report_incomplete_issue\":{},\"missing_data\":{},\"missing_tool\":{},\"noop\":{\"max\":1,\"report-as-issue\":\"true\"},\"report_incomplete\":{},\"submit_pull_request_review\":{\"allowed_events\":[\"COMMENT\",\"REQUEST_CHANGES\"],\"max\":1}}" + with: + github-token: ${{ secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + script: | + const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs'); + setupGlobals(core, github, context, exec, io, getOctokit); + const { main } = require('${{ runner.temp }}/gh-aw/actions/safe_output_handler_manager.cjs'); + await main(); + - name: Upload Safe Outputs Items + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: safe-outputs-items + path: | + /tmp/gh-aw/safe-output-items.jsonl + /tmp/gh-aw/temporary-id-map.json + if-no-files-found: ignore + diff --git a/.github/workflows/macios-reviewer.md b/.github/workflows/macios-reviewer.md new file mode 100644 index 000000000000..72da3cc06bd9 --- /dev/null +++ b/.github/workflows/macios-reviewer.md @@ -0,0 +1,61 @@ +--- +on: + slash_command: + name: review + events: [pull_request_comment] + roles: [admin, maintainer, write] +permissions: + contents: read + pull-requests: read +engine: + id: copilot + model: claude-sonnet-4.5 +network: + allowed: + - defaults + - dotnet + - github + - "aka.ms" + - "dev.azure.com" + - "microsoft.com" + - "vsassets.io" +tools: + github: + toolsets: [pull_requests, repos] + min-integrity: none +safe-outputs: + create-pull-request-review-comment: + max: 50 + submit-pull-request-review: + max: 1 + allowed-events: [COMMENT, REQUEST_CHANGES] +--- + +# .NET for Apple Platforms PR Reviewer + +A maintainer commented `/review` on this pull request. Perform a thorough code review following the dotnet/macios review guidelines. + +## Instructions + +1. Read the review rules from `.github/skills/macios-reviewer/references/review-rules.md` — these contain the detailed patterns and anti-patterns to check for. +2. Read the review methodology from `.github/skills/macios-reviewer/SKILL.md` — this defines the review workflow, mindset, severity levels, and comment format. +3. Follow the skill's workflow to analyze the pull request: + - Gather context: read the diff and changed files + - For each changed file, read the **full source file** to understand surrounding context + - Form an independent assessment before reading the PR description + - Read the PR title and description — treat claims as things to verify + - Check CI status + - Analyze the diff against the review rules +4. Post your findings as inline review comments and a review summary. + +## Constraints + +- Only comment on added/modified lines visible in the diff. +- One issue per inline comment. +- If the same issue appears many times, flag it once listing all affected files. +- Don't flag what CI catches (compiler errors, linter issues). +- Don't review C# code formatting — it is handled automatically. +- Avoid false positives — verify concerns given the full file context. +- **Never submit an APPROVE event.** Use COMMENT for clean PRs and REQUEST_CHANGES when issues are found. +- Prioritize: bugs > breaking changes > binding correctness > safety > performance > missing tests > duplication > consistency > documentation. +- Ignore comments from the user 'vs-mobiletools-engineering-service2'. diff --git a/Make.config b/Make.config index 509f55767d66..0a6780c786d1 100644 --- a/Make.config +++ b/Make.config @@ -50,10 +50,10 @@ include $(TOP)/Make.versions # The value is taken from the name + version of the Ref pack. # Example: given the Ref pack "Microsoft.iOS.Ref.net8.0_17.5" with the version "17.5.8030", the value # to write here would be the part after "Microsoft.iOS.Ref." + "/" + version: "net8.0_17.5/17.5.8030" -STABLE_NUGET_VERSION_iOS=net10.0_26.2/26.2.10191 -STABLE_NUGET_VERSION_tvOS=net10.0_26.2/26.2.10191 -STABLE_NUGET_VERSION_MacCatalyst=net10.0_26.2/26.2.10191 -STABLE_NUGET_VERSION_macOS=net10.0_26.2/26.2.10191 +STABLE_NUGET_VERSION_iOS=net10.0_26.2/26.2.10233 +STABLE_NUGET_VERSION_tvOS=net10.0_26.2/26.2.10233 +STABLE_NUGET_VERSION_MacCatalyst=net10.0_26.2/26.2.10233 +STABLE_NUGET_VERSION_macOS=net10.0_26.2/26.2.10233 PACKAGE_HEAD_REV=$(shell git rev-parse HEAD) @@ -208,9 +208,9 @@ MACCATALYST_NUGET_VERSION_FULL=$(MACCATALYST_NUGET_VERSION_NO_METADATA)$(NUGET_B # Xcode version should have both a major and a minor version (even if the minor version is 0) XCODE_VERSION=26.4 -XCODE_URL=https://bosstoragemirror.blob.core.windows.net/internal-files/xcodes/Xcode_26.4.xip +XCODE_URL=https://bosstoragemirror.blob.core.windows.net/internal-files/xcodes/Xcode_26.4.1.xip ifndef IS_LINUX -XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.4.0.app/Contents/Developer +XCODE_DEVELOPER_ROOT=/Applications/Xcode_26.4.1.app/Contents/Developer XCODE_PRODUCT_BUILD_VERSION:=$(shell /usr/libexec/PlistBuddy -c 'Print :ProductBuildVersion' $(XCODE_DEVELOPER_ROOT)/../version.plist 2>/dev/null || echo " $(shell tput setaf 1 2>/dev/null)The required Xcode ($(XCODE_VERSION)) is not installed in $(basename $(basename $(XCODE_DEVELOPER_ROOT)))$(shell tput sgr0 2>/dev/null)" >&2) # We define stable Xcode as the Xcode app being named like "Xcode_#.#[.#].app" diff --git a/docs/api/AddressBook/ABAddressBook.xml b/docs/api/AddressBook/ABAddressBook.xml index 414f20e1f82d..54a3b3098000 100644 --- a/docs/api/AddressBook/ABAddressBook.xml +++ b/docs/api/AddressBook/ABAddressBook.xml @@ -19,18 +19,6 @@ if (addressBook != null) { - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the ABAddressBook object. - - This Dispose method releases the resources used by the ABAddressBook class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the ABAddressBook ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - Provides access to the system Address Book. @@ -86,4 +74,4 @@ if (addressBook != null) { - \ No newline at end of file + diff --git a/docs/api/AddressBook/ABRecord.xml b/docs/api/AddressBook/ABRecord.xml deleted file mode 100644 index f74bdeb626ca..000000000000 --- a/docs/api/AddressBook/ABRecord.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the ABRecord object. - - This Dispose method releases the resources used by the ABRecord class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the ABRecord ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/AudioToolbox/AudioConverter.xml b/docs/api/AudioToolbox/AudioConverter.xml deleted file mode 100644 index 26b15e2550ff..000000000000 --- a/docs/api/AudioToolbox/AudioConverter.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the AudioConverter object. - - This Dispose method releases the resources used by the AudioConverter class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the AudioConverter ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/AudioToolbox/MusicPlayer.xml b/docs/api/AudioToolbox/MusicPlayer.xml deleted file mode 100644 index e3c6293fc3ab..000000000000 --- a/docs/api/AudioToolbox/MusicPlayer.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MusicPlayer object. - - This Dispose method releases the resources used by the MusicPlayer class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MusicPlayer ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/AudioToolbox/MusicSequence.xml b/docs/api/AudioToolbox/MusicSequence.xml deleted file mode 100644 index a44b15023afc..000000000000 --- a/docs/api/AudioToolbox/MusicSequence.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MusicSequence object. - - This Dispose method releases the resources used by the MusicSequence class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MusicSequence ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/AudioToolbox/MusicTrack.xml b/docs/api/AudioToolbox/MusicTrack.xml deleted file mode 100644 index b0b373048dbe..000000000000 --- a/docs/api/AudioToolbox/MusicTrack.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MusicTrack object. - - This Dispose method releases the resources used by the MusicTrack class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MusicTrack ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/AudioUnit/AUGraph.xml b/docs/api/AudioUnit/AUGraph.xml index 2826d40902e9..ec76ec405feb 100644 --- a/docs/api/AudioUnit/AUGraph.xml +++ b/docs/api/AudioUnit/AUGraph.xml @@ -1,16 +1,4 @@ - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the AUGraph object. - - This Dispose method releases the resources used by the AUGraph class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the AUGraph ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - An audio processing graph. @@ -50,4 +38,4 @@ void createAUGraph () - \ No newline at end of file + diff --git a/docs/api/AudioUnit/AudioUnit.xml b/docs/api/AudioUnit/AudioUnit.xml deleted file mode 100644 index 1b1844867ad3..000000000000 --- a/docs/api/AudioUnit/AudioUnit.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the AudioUnit object. - - This Dispose method releases the resources used by the AudioUnit class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the AudioUnit ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreAnimation/CALayerDelegate.xml b/docs/api/CoreAnimation/CALayerDelegate.xml deleted file mode 100644 index 2b4384b3fc5b..000000000000 --- a/docs/api/CoreAnimation/CALayerDelegate.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CALayerDelegate object. - - This Dispose method releases the resources used by the CALayerDelegate class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CALayerDelegate ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreFoundation/CFMessagePort.xml b/docs/api/CoreFoundation/CFMessagePort.xml deleted file mode 100644 index 49f502229d2f..000000000000 --- a/docs/api/CoreFoundation/CFMessagePort.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CFMessagePort object. - - This Dispose method releases the resources used by the CFMessagePort class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CFMessagePort ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreFoundation/CFRunLoopSourceCustom.xml b/docs/api/CoreFoundation/CFRunLoopSourceCustom.xml deleted file mode 100644 index ca98fb3b86e6..000000000000 --- a/docs/api/CoreFoundation/CFRunLoopSourceCustom.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CFRunLoopSourceCustom object. - - This Dispose method releases the resources used by the CFRunLoopSourceCustom class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CFRunLoopSourceCustom ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreFoundation/CFSocket.xml b/docs/api/CoreFoundation/CFSocket.xml deleted file mode 100644 index 4275eb97807f..000000000000 --- a/docs/api/CoreFoundation/CFSocket.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CFSocket object. - - This Dispose method releases the resources used by the CFSocket class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CFSocket ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreFoundation/CFStream.xml b/docs/api/CoreFoundation/CFStream.xml index a10b924780ed..1154bb681795 100644 --- a/docs/api/CoreFoundation/CFStream.xml +++ b/docs/api/CoreFoundation/CFStream.xml @@ -21,18 +21,6 @@ - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CFStream object. - - This Dispose method releases the resources used by the CFStream class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CFStream ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - An abstract class that defines a stream for reading or writing bytes - modern applications should use the  APIs instead. @@ -60,4 +48,4 @@ ObjCRuntime.Runtime.GetNSObject(writeStream.Handle); - \ No newline at end of file + diff --git a/docs/api/CoreFoundation/DispatchSource.xml b/docs/api/CoreFoundation/DispatchSource.xml index b4780a89b938..82bd7455e9ae 100644 --- a/docs/api/CoreFoundation/DispatchSource.xml +++ b/docs/api/CoreFoundation/DispatchSource.xml @@ -27,18 +27,6 @@ Important: a cancellation handler is required for file descriptor and mach port based sources in order to safely close the descriptor or destroy the port. Closing the descriptor or port before the cancellation handler has run may result in a race condition: if a new descriptor is allocated with the same value as the recently closed descriptor while the source's event handler is still running, the event handler may read/write data to the wrong descriptor. - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the DispatchSource object. - - This Dispose method releases the resources used by the DispatchSource class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the DispatchSource ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - DispatchSource is a base class used to reprenset event sources that can monitor a variety of system objects and events including file descriptors, mach ports, processes, virtual filesystem nodes, signal delivery and timers. @@ -166,4 +154,4 @@ - \ No newline at end of file + diff --git a/docs/api/CoreGraphics/CGBitmapContext.xml b/docs/api/CoreGraphics/CGBitmapContext.xml deleted file mode 100644 index 29417f8b3cca..000000000000 --- a/docs/api/CoreGraphics/CGBitmapContext.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CGBitmapContext object. - - This Dispose method releases the resources used by the CGBitmapContext class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CGBitmapContext ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreGraphics/CGContextPDF.xml b/docs/api/CoreGraphics/CGContextPDF.xml deleted file mode 100644 index 63b07d9a2175..000000000000 --- a/docs/api/CoreGraphics/CGContextPDF.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CGContextPDF object. - - This Dispose method releases the resources used by the CGContextPDF class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CGContextPDF ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreGraphics/CGPDFScanner.xml b/docs/api/CoreGraphics/CGPDFScanner.xml deleted file mode 100644 index fc065adfb515..000000000000 --- a/docs/api/CoreGraphics/CGPDFScanner.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CGPDFScanner object. - - This Dispose method releases the resources used by the CGPDFScanner class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CGPDFScanner ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreMedia/CMBufferQueue.xml b/docs/api/CoreMedia/CMBufferQueue.xml deleted file mode 100644 index bff0563b93c6..000000000000 --- a/docs/api/CoreMedia/CMBufferQueue.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CMBufferQueue object. - - This Dispose method releases the resources used by the CMBufferQueue class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CMBufferQueue ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreMedia/CMSampleBuffer.xml b/docs/api/CoreMedia/CMSampleBuffer.xml deleted file mode 100644 index 603d7d71a651..000000000000 --- a/docs/api/CoreMedia/CMSampleBuffer.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the CMSampleBuffer object. - - This Dispose method releases the resources used by the CMSampleBuffer class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the CMSampleBuffer ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreMidi/MidiClient.xml b/docs/api/CoreMidi/MidiClient.xml index 92ad5da881c5..2974d06b6e87 100644 --- a/docs/api/CoreMidi/MidiClient.xml +++ b/docs/api/CoreMidi/MidiClient.xml @@ -1,16 +1,4 @@ - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MidiClient object. - - This Dispose method releases the resources used by the MidiClient class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MidiClient ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - Main entry point to use MIDI in MacOS X and iOS. @@ -69,4 +57,4 @@ inputPort.MessageReceived += delegate(object sender, MidiPacketsEventArgs e) { CoreMidiSample - \ No newline at end of file + diff --git a/docs/api/CoreMidi/MidiEndpoint.xml b/docs/api/CoreMidi/MidiEndpoint.xml deleted file mode 100644 index 5baf2107efd7..000000000000 --- a/docs/api/CoreMidi/MidiEndpoint.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MidiEndpoint object. - - This Dispose method releases the resources used by the MidiEndpoint class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MidiEndpoint ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/CoreMidi/MidiPort.xml b/docs/api/CoreMidi/MidiPort.xml deleted file mode 100644 index 8f2a073727da..000000000000 --- a/docs/api/CoreMidi/MidiPort.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MidiPort object. - - This Dispose method releases the resources used by the MidiPort class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MidiPort ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/Foundation/NSInputStream.xml b/docs/api/Foundation/NSInputStream.xml index f0301a69fb2e..dcc411e8610f 100644 --- a/docs/api/Foundation/NSInputStream.xml +++ b/docs/api/Foundation/NSInputStream.xml @@ -56,16 +56,4 @@ Apple documentation for NSInputStream - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the NSInputStream object. - - This Dispose method releases the resources used by the NSInputStream class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the NSInputStream ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file + diff --git a/docs/api/Foundation/NSObject.xml b/docs/api/Foundation/NSObject.xml index c3284b1f96bb..fcaa3f4f8d68 100644 --- a/docs/api/Foundation/NSObject.xml +++ b/docs/api/Foundation/NSObject.xml @@ -356,16 +356,16 @@ public UIView (CGRect frame) : base (NSObjectFlag.Empty) + Releases the resources used by this object. - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. + If set to , the method is invoked directly and disposes managed and unmanaged resources. If set to , the method is called by the garbage collector finalizer and should only release unmanaged resources. - Releases the resources used by the NSObject object. - This Dispose method releases the resources used by the NSObject class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the NSObject ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx + This method releases the resources used by this class. + This method is called by both the method and the object finalizer (). When invoked by the method, the parameter is set to and any managed object references that this object holds are also disposed or released. When invoked by the object finalizer, on the finalizer thread, the parameter is set to . + Calling the method when the application is finished using this instance ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the method, the object is no longer useful and developers should no longer make any calls to it. + @@ -464,4 +464,4 @@ An IDisposable object.  Invoke the Dispose method on this object to remove the - \ No newline at end of file + diff --git a/docs/api/GameKit/GKPeerPickerController.xml b/docs/api/GameKit/GKPeerPickerController.xml index 0a48efecaf2f..995e12a24cbe 100644 --- a/docs/api/GameKit/GKPeerPickerController.xml +++ b/docs/api/GameKit/GKPeerPickerController.xml @@ -31,16 +31,4 @@ public UIView (CGRect frame) : base (NSObjectFlag.Empty) - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the GKPeerPickerController object. - - This Dispose method releases the resources used by the GKPeerPickerController class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the GKPeerPickerController ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file + diff --git a/docs/api/MediaToolbox/MTAudioProcessingTap.xml b/docs/api/MediaToolbox/MTAudioProcessingTap.xml deleted file mode 100644 index 0916f9ce732f..000000000000 --- a/docs/api/MediaToolbox/MTAudioProcessingTap.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the MTAudioProcessingTap object. - - This Dispose method releases the resources used by the MTAudioProcessingTap class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the MTAudioProcessingTap ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/NewsstandKit/NKAssetDownload.xml b/docs/api/NewsstandKit/NKAssetDownload.xml index 6eb6ac5c5b86..faec2f7be143 100644 --- a/docs/api/NewsstandKit/NKAssetDownload.xml +++ b/docs/api/NewsstandKit/NKAssetDownload.xml @@ -31,16 +31,4 @@ public UIView (CGRect frame) : base (NSObjectFlag.Empty) - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the NKAssetDownload object. - - This Dispose method releases the resources used by the NKAssetDownload class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the NKAssetDownload ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file + diff --git a/docs/api/Security/SslContext.xml b/docs/api/Security/SslContext.xml deleted file mode 100644 index 200a6c491b64..000000000000 --- a/docs/api/Security/SslContext.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the SslContext object. - - This Dispose method releases the resources used by the SslContext class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the SslContext ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/api/VideoToolbox/VTMultiPassStorage.xml b/docs/api/VideoToolbox/VTMultiPassStorage.xml deleted file mode 100644 index f9d6d6d1085c..000000000000 --- a/docs/api/VideoToolbox/VTMultiPassStorage.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. - - Releases the resources used by the VTMultiPassStorage object. - - This Dispose method releases the resources used by the VTMultiPassStorage class. - This method is called by both the Dispose() method and the object finalizer (Finalize). When invoked by the Dispose method, the parameter disposing is set to and any managed object references that this object holds are also disposed or released; when invoked by the object finalizer, on the finalizer thread the value is set to . - Calling the Dispose method when the application is finished using the VTMultiPassStorage ensures that all external resources used by this managed object are released as soon as possible. Once developers have invoked the Dispose method, the object is no longer useful and developers should no longer make any calls to it. - For more information on how to override this method and on the Dispose/IDisposable pattern, read the ``Implementing a Dispose Method'' document at https://msdn.microsoft.com/en-us/library/fs2xkftw.aspx - - - \ No newline at end of file diff --git a/docs/building-apps/build-properties.md b/docs/building-apps/build-properties.md index 98623c7160e6..75156945982b 100644 --- a/docs/building-apps/build-properties.md +++ b/docs/building-apps/build-properties.md @@ -373,9 +373,7 @@ See [BuildIpa](#buildipa) for iOS and tvOS projects. ## Device -Specifies which mobile device or emulator to target when using `dotnet run ---device ` or MSBuild targets that interact with devices (such as -`Run`, `Install`, or `Uninstall`). +Specifies which mobile device or simulator to target when using `dotnet run --device ` or MSBuild targets that interact with devices (such as `Run`, `Install`, or `Uninstall`). The value can be anything the command-line tools `simctl` or `devicectl` accept for the device name; this is typically either the UDID or the name of @@ -987,7 +985,7 @@ Default: A boolean property that specifies whether native libraries in binding projects should be embedded in the managed assembly, or put into a `.resources` directory next to the managed assembly. -The default value is `true` (which means native libraries will _not_ be embeddded in the managed assembly). +The default value is `true` (which means native libraries will _not_ be embedded in the managed assembly). > [!NOTE] > Xcframeworks won't work correctly if embedded inside the managed assembly (if this property is not `true`). diff --git a/docs/building-apps/build-targets.md b/docs/building-apps/build-targets.md index 86a0ff27503a..fbf0abff811e 100644 --- a/docs/building-apps/build-targets.md +++ b/docs/building-apps/build-targets.md @@ -47,8 +47,8 @@ Added in .NET 11. ## Run Builds the source code within a project and all dependencies, and then deploys and runs it -on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property. +on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property. ```dotnetcli -dotnet build -t:Run project.csproj -p:Device=$(MY_DEVICE_UDID) +dotnet build -t:Run project.csproj -p:Device= ``` diff --git a/dotnet/targets/Microsoft.Sdk.Mobile.targets b/dotnet/targets/Microsoft.Sdk.Mobile.targets index db28965e02bd..b852c5aa027a 100644 --- a/dotnet/targets/Microsoft.Sdk.Mobile.targets +++ b/dotnet/targets/Microsoft.Sdk.Mobile.targets @@ -20,12 +20,14 @@ + DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;ComputeAvailableDevices"> - + @@ -53,6 +55,8 @@ - + @@ -105,6 +109,8 @@ AdditionalArguments="@(MlaunchAdditionalArguments)" AppManifestPath="$(_AppBundleManifestPath)" CaptureOutput="$(_MlaunchCaptureOutput)" + DiscardedDevices="@(DiscardedDevices)" + Devices="@(Devices)" DeviceName="$(Device)" EnvironmentVariables="@(MlaunchEnvironmentVariables)" LaunchApp="$(_AppBundlePath)" diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets index 94dae574e7ff..0ff20eb0c50c 100644 --- a/dotnet/targets/Xamarin.Shared.Sdk.targets +++ b/dotnet/targets/Xamarin.Shared.Sdk.targets @@ -590,6 +590,11 @@ <_UseDynamicDependenciesForSmartEnumPreservation Condition="'$(_UseDynamicDependenciesForSmartEnumPreservation)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) <_UseDynamicDependenciesForBlockCodePreservation Condition="'$(_UseDynamicDependenciesForBlockCodePreservation)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) <_UseDynamicDependenciesForGeneratedCodeOptimizations Condition="'$(_UseDynamicDependenciesForGeneratedCodeOptimizations)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) + <_UseLinkDescriptionForApplyPreserveAttribute Condition="'$(_UseLinkDescriptionForApplyPreserveAttribute)' == '' And '$(_XamarinRuntime)' == 'NativeAOT'">true + <_UseLinkDescriptionForApplyPreserveAttribute Condition="'$(_UseLinkDescriptionForApplyPreserveAttribute)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) + <_UseDynamicDependenciesForMarkStaticRegistrar Condition="'$(_UseDynamicDependenciesForMarkStaticRegistrar)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) + <_UseDynamicDependenciesForMarkNSObjects Condition="'$(_UseDynamicDependenciesForMarkNSObjects)' == ''">$(_UseDynamicDependenciesInsteadOfMarking) + <_UseDynamicDependenciesForMarkDispatcher Condition="'$(_UseDynamicDependenciesForMarkDispatcher)' == '' And '$(_UseDynamicDependenciesForApplyPreserveAttribute)' == 'true' And '$(_UseDynamicDependenciesForMarkStaticRegistrar)' == 'true' And '$(_UseDynamicDependenciesForMarkNSObjects)' == 'true'">true @@ -798,6 +803,9 @@ <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.PreserveSmartEnumConversionsStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForSmartEnumPreservation)' == 'true'" /> <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.PreserveBlockCodeStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForBlockCodePreservation)' == 'true'" /> <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.OptimizeGeneratedCodeStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForGeneratedCodeOptimizations)' == 'true'" /> + <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.ApplyPreserveAttributeStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseLinkDescriptionForApplyPreserveAttribute)' == 'true'" /> + <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.MarkForStaticRegistrarStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForMarkStaticRegistrar)' == 'true'" /> + <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.Steps.MarkNSObjectsStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForMarkNSObjects)' == 'true'" /> <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.RegistrarRemovalTrackingStep" /> @@ -812,7 +820,7 @@ <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true'" Type="Xamarin.Linker.BackingFieldDelayHandler" /> <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForProtocolPreservation)' != 'true'" Type="Xamarin.Linker.MarkIProtocolHandler" /> - <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true'" Type="Xamarin.Linker.Steps.MarkDispatcher" /> + <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForMarkDispatcher)' != 'true'" Type="Xamarin.Linker.Steps.MarkDispatcher" /> <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForSmartEnumPreservation)' != 'true'" Type="Xamarin.Linker.Steps.PreserveSmartEnumConversionsHandler" /> + $(NoWarn);IL2008 + diff --git a/eng/Signing.props b/eng/Signing.props new file mode 100644 index 000000000000..512b976e5777 --- /dev/null +++ b/eng/Signing.props @@ -0,0 +1,16 @@ + + + true + + + + + + + + + + + + + diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 79e8d9e6ed1b..58a12463ef3e 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -5,52 +5,52 @@ This file should be imported by eng/Versions.props --> - - 11.0.0-beta.26215.121 - 11.0.0-beta.26215.121 - 0.11.5-preview.26215.121 - 11.0.0-beta.26215.121 - 11.0.0-preview.4.26215.121 - 11.0.0-preview.4.26215.121 - 11.0.0-preview.4.26215.121 - 11.0.100-preview.4.26215.121 - 11.0.0-preview.4.26215.121 - 11.0.100-preview.4.26215.121 - - 26.0.11017 - 26.4.10255 - 26.0.11017 - 26.4.10255 - 26.0.11017 - 26.4.10255 - 26.0.11017 - 26.4.10255 - - 10.0.0-prerelease.25516.4 + + 11.0.0-beta.26215.121 + 11.0.0-beta.26215.121 + 0.11.5-preview.26215.121 + 11.0.0-beta.26215.121 + 11.0.0-preview.4.26215.121 + 11.0.0-preview.4.26215.121 + 11.0.0-preview.4.26215.121 + 11.0.100-preview.4.26215.121 + 11.0.0-preview.4.26215.121 + 11.0.100-preview.4.26215.121 + + 26.0.11017 + 26.4.10255 + 26.0.11017 + 26.4.10255 + 26.0.11017 + 26.4.10255 + 26.0.11017 + 26.4.10255 + + 11.0.0-prerelease.26217.1 - - $(MicrosoftDotNetArcadeSdkPackageVersion) - $(MicrosoftDotNetBuildTasksFeedPackageVersion) - $(MicrosoftDotNetCecilPackageVersion) - $(MicrosoftDotNetSharedFrameworkSdkPackageVersion) - $(MicrosoftNETILLinkPackageVersion) - $(MicrosoftNETILLinkTasksPackageVersion) - $(MicrosoftNETRuntimeMonoTargetsSdkPackageVersion) - $(MicrosoftNETSdkPackageVersion) - $(MicrosoftNETCoreAppRefPackageVersion) - $(MicrosoftTemplateEngineAuthoringTasksPackageVersion) - - $(MicrosoftiOSSdknet100_260PackageVersion) - $(MicrosoftiOSSdknet100_264PackageVersion) - $(MicrosoftMacCatalystSdknet100_260PackageVersion) - $(MicrosoftMacCatalystSdknet100_264PackageVersion) - $(MicrosoftmacOSSdknet100_260PackageVersion) - $(MicrosoftmacOSSdknet100_264PackageVersion) - $(MicrosofttvOSSdknet100_260PackageVersion) - $(MicrosofttvOSSdknet100_264PackageVersion) - - $(MicrosoftDotNetXHarnessiOSSharedPackageVersion) + + $(MicrosoftDotNetArcadeSdkPackageVersion) + $(MicrosoftDotNetBuildTasksFeedPackageVersion) + $(MicrosoftDotNetCecilPackageVersion) + $(MicrosoftDotNetSharedFrameworkSdkPackageVersion) + $(MicrosoftNETILLinkPackageVersion) + $(MicrosoftNETILLinkTasksPackageVersion) + $(MicrosoftNETRuntimeMonoTargetsSdkPackageVersion) + $(MicrosoftNETSdkPackageVersion) + $(MicrosoftNETCoreAppRefPackageVersion) + $(MicrosoftTemplateEngineAuthoringTasksPackageVersion) + + $(MicrosoftiOSSdknet100_260PackageVersion) + $(MicrosoftiOSSdknet100_264PackageVersion) + $(MicrosoftMacCatalystSdknet100_260PackageVersion) + $(MicrosoftMacCatalystSdknet100_264PackageVersion) + $(MicrosoftmacOSSdknet100_260PackageVersion) + $(MicrosoftmacOSSdknet100_264PackageVersion) + $(MicrosofttvOSSdknet100_260PackageVersion) + $(MicrosofttvOSSdknet100_264PackageVersion) + + $(MicrosoftDotNetXHarnessiOSSharedPackageVersion) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e25d901c85b5..62348232febe 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -73,9 +73,9 @@ https://github.com/dotnet/dotnet ab01524bbb2ef1eea0ffaef161b3ef5686e8f256 - + https://github.com/dotnet/xharness - 88399512021dfa8b5f45d91f84c8ce6f0959b127 + 866707736d49c2323628744716cda2475b3af9ee https://github.com/dotnet/dotnet diff --git a/mk/xamarin.mk b/mk/xamarin.mk index af8e9f465e9c..537af408111d 100644 --- a/mk/xamarin.mk +++ b/mk/xamarin.mk @@ -1,5 +1,5 @@ # Available versions can be seen here: # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.Tools.Mlaunch/versions -MLAUNCH_NUGET_VERSION=1.1.111 +MLAUNCH_NUGET_VERSION=1.1.113 # https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/AppleDocReader/versions ADR_NUGET_VERSION=1.0.0 diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs index 459b84eff347..3b0f1b6115b6 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs @@ -42,6 +42,9 @@ public class GetMlaunchArguments : XamarinTask, ICancelableTask { [Required] public string MlaunchPath { get; set; } = string.Empty; + public ITaskItem [] Devices { get; set; } = Array.Empty (); + public ITaskItem [] DiscardedDevices { get; set; } = Array.Empty (); + [Output] public string MlaunchArguments { get; set; } = string.Empty; @@ -58,17 +61,26 @@ public IPhoneDeviceType DeviceType { } } - List? GetDeviceTypes (bool onlyExact) + sealed class SimulatorDeviceInfo { + public string Identifier { get; set; } = string.Empty; + public string Name { get; set; } = string.Empty; + public long RuntimeVersion { get; set; } + public int DeviceTypeOrder { get; set; } = int.MinValue; + public bool IsCompatible { get; set; } + public string? NotApplicableBecause { get; set; } + } + + List<(long Min, long Max, string Identifier)>? GetDeviceTypes () { var output = GetSimulatorList (); - if (output is null) + if (string.IsNullOrEmpty (output)) return null; // Which product family are we looking for? string [] productFamilies; switch (DeviceType) { case IPhoneDeviceType.IPhone: // if we're looking for an iPhone, an iPad also works - productFamilies = onlyExact ? ["iPhone"] : ["iPhone", "iPad"]; + productFamilies = ["iPhone", "iPad"]; break; case IPhoneDeviceType.IPad: productFamilies = ["iPad"]; @@ -100,10 +112,31 @@ public IPhoneDeviceType DeviceType { continue; deviceTypes.Add ((minRuntimeVersion, maxRuntimeVersion, identifier)); } - // Sort by minRuntimeVersion, this is a rudimentary way of sorting so that the last device is at the end. - deviceTypes.Sort ((a, b) => a.Min.CompareTo (b.Min)); - // Return the sorted list - return deviceTypes.Select (v => v.Identifier).ToList (); + + deviceTypes.Sort ((a, b) => { + var rv = a.Min.CompareTo (b.Min); + if (rv != 0) + return rv; + rv = a.Max.CompareTo (b.Max); + if (rv != 0) + return rv; + return StringComparer.Ordinal.Compare (a.Identifier, b.Identifier); + }); + + return deviceTypes; + } + + static bool TryGetSimulatorVersion (long versionValue, out Version? version) + { + if (versionValue <= 0) { + version = null; + return false; + } + + var major = (int) ((versionValue >> 16) & 0xFF); + var minor = (int) ((versionValue >> 8) & 0xFF); + version = new Version (major, minor); + return true; } string? simulator_list; @@ -142,49 +175,100 @@ public IPhoneDeviceType DeviceType { return device_list; } - List<(string Identifier, string Name, string? NotApplicableBecause)> GetDeviceListForSimulator () + List GetSimulatorDevices () { - var rv = new List<(string Identifier, string Name, string? NotApplicableBecause)> (); + var rv = new List (); var output = GetSimulatorList (); if (string.IsNullOrEmpty (output)) return rv; - var deviceTypes = GetDeviceTypes (false); + var deviceTypes = GetDeviceTypes (); if (deviceTypes is null) return rv; - // Load mlaunch's output + var deviceTypeOrders = deviceTypes + .Select ((v, index) => (v.Identifier, Index: index)) + .ToDictionary (v => v.Identifier, v => v.Index, StringComparer.Ordinal); + var xml = new XmlDocument (); xml.LoadXml (output); - // Get the device types for the product family we're looking for + + var runtimePrefix = $"com.apple.CoreSimulator.SimRuntime.{PlatformName}-"; + var runtimeVersions = new Dictionary (StringComparer.Ordinal); + var runtimeNodes = xml.SelectNodes ("/MTouch/Simulator/SupportedRuntimes/SimRuntime")?.Cast () ?? Array.Empty (); + foreach (var node in runtimeNodes) { + var identifier = node.SelectSingleNode ("Identifier")?.InnerText ?? string.Empty; + var versionValue = node.SelectSingleNode ("Version")?.InnerText ?? string.Empty; + if (long.TryParse (versionValue, out var version)) + runtimeVersions [identifier] = version; + } + var nodes = xml.SelectNodes ($"/MTouch/Simulator/AvailableDevices/SimDevice")?.Cast () ?? Array.Empty (); foreach (var node in nodes) { + var device = new SimulatorDeviceInfo { + Identifier = node.Attributes? ["UDID"]?.Value ?? string.Empty, + Name = node.Attributes? ["Name"]?.Value ?? string.Empty, + }; + var simDeviceType = node.SelectSingleNode ("SimDeviceType")?.InnerText ?? string.Empty; - if (!deviceTypes.Contains (simDeviceType)) - continue; - var udid = node.Attributes? ["UDID"]?.Value ?? string.Empty; - var name = node.Attributes? ["Name"]?.Value ?? string.Empty; - string? notApplicableBecause = null; + var simRuntime = node.SelectSingleNode ("SimRuntime")?.InnerText ?? string.Empty; + runtimeVersions.TryGetValue (simRuntime, out var simRuntimeVersion); + device.RuntimeVersion = simRuntimeVersion; - var simRuntime = node.SelectSingleNode ("SimRuntime")?.InnerText; - if (!string.IsNullOrEmpty (simRuntime)) { - var simRuntimeVersionString = xml.SelectSingleNode ($"/MTouch/Simulator/SupportedRuntimes/SimRuntime[Identifier='{simRuntime}']/Version")?.InnerText; - if (int.TryParse (simRuntimeVersionString, out var simRuntimeVersionNumber)) { - var simRuntimeVersionMajor = (simRuntimeVersionNumber >> 16) & 0xFF; - var simRuntimeVersionMinor = (simRuntimeVersionNumber >> 8) & 0xFF; - var simRuntimeVersion = new Version (simRuntimeVersionMajor, simRuntimeVersionMinor); - if (Version.TryParse (SupportedOSPlatformVersion, out var supportedOSPlatformVersion) && simRuntimeVersion < supportedOSPlatformVersion) - notApplicableBecause = $" [OS version ({simRuntimeVersion}) lower than minimum supported platform version ({SupportedOSPlatformVersion}) for this app]"; - } + string? notApplicableBecause = null; + if (!simRuntime.StartsWith (runtimePrefix, StringComparison.Ordinal)) { + notApplicableBecause = $" [Simulator runtime ({simRuntime}) does not match the requested platform ({PlatformName}) for this app]"; + } else if (!deviceTypeOrders.TryGetValue (simDeviceType, out var deviceTypeOrder)) { + notApplicableBecause = $" [Simulator device type ({simDeviceType}) is not applicable for this app]"; + } else { + device.IsCompatible = true; + device.DeviceTypeOrder = deviceTypeOrder; + if (Version.TryParse (SupportedOSPlatformVersion, out var supportedOSPlatformVersion) && TryGetSimulatorVersion (simRuntimeVersion, out var simRuntimeVersionValue) && simRuntimeVersionValue is not null && simRuntimeVersionValue < supportedOSPlatformVersion) + notApplicableBecause = $" [OS version ({simRuntimeVersionValue}) lower than minimum supported platform version ({SupportedOSPlatformVersion}) for this app]"; } - rv.Add ((udid, name, notApplicableBecause)); + + device.NotApplicableBecause = notApplicableBecause; + rv.Add (device); } + return rv; } + string SelectSimulatorDevice () + { + var simulator = GetTaskItemsOfType (Devices, "Simulator").FirstOrDefault (); + if (simulator is null) { + var sb = new StringBuilder (); + sb.AppendLine ("The 'Devices' item group does not contain any simulators."); + AppendDiscardedDevices (sb, "", "Simulator"); + Log.LogError (sb.ToString ().TrimEnd ()); + return ""; + } + + return GetDeviceIdentifier (simulator); + } + + List<(string Identifier, string Name, string? NotApplicableBecause)> GetDeviceListForSimulator () + { + if (Devices.Length > 0 || DiscardedDevices.Length > 0) + return GetDevicesFromTaskItems ("Simulator", Devices); + + return GetSimulatorDevices () + .Where (v => v.IsCompatible) + .OrderByDescending (v => v.RuntimeVersion) + .ThenByDescending (v => v.DeviceTypeOrder) + .ThenBy (v => v.Name, StringComparer.Ordinal) + .ThenBy (v => v.Identifier, StringComparer.Ordinal) + .Select (v => (v.Identifier, v.Name, v.NotApplicableBecause)) + .ToList (); + } + List<(string Identifier, string Name, string? NotApplicableBecause)> GetDeviceListForDevice () { + if (Devices.Length > 0 || DiscardedDevices.Length > 0) + return GetDevicesFromTaskItems ("Device", Devices); + var rv = new List<(string Identifier, string Name, string? NotApplicableBecause)> (); var output = GetDeviceList (); @@ -226,9 +310,90 @@ public IPhoneDeviceType DeviceType { return rv; } + static string GetDeviceIdentifier (ITaskItem device) + { + var udid = device.GetMetadata ("UDID"); + return string.IsNullOrEmpty (udid) ? device.ItemSpec : udid; + } + + static string GetDeviceName (ITaskItem device) + { + var name = device.GetMetadata ("Name"); + if (string.IsNullOrEmpty (name)) + name = device.GetMetadata ("Description"); + return string.IsNullOrEmpty (name) ? GetDeviceIdentifier (device) : name; + } + + static string FormatDevice (ITaskItem device) + { + var identifier = GetDeviceIdentifier (device); + var name = GetDeviceName (device); + return name == identifier ? identifier : $"{name} ({identifier})"; + } + + static ITaskItem [] GetTaskItemsOfType (ITaskItem [] items, string type) + { + return items + .Where (v => string.Equals (v.GetMetadata ("Type"), type, StringComparison.OrdinalIgnoreCase)) + .ToArray (); + } + + string GetApplicableDeviceType () + { + return SdkIsSimulator ? "Simulator" : "Device"; + } + + void FilterTaskItemInputs () + { + var type = GetApplicableDeviceType (); + Devices = GetTaskItemsOfType (Devices, type); + DiscardedDevices = GetTaskItemsOfType (DiscardedDevices, type); + } + + static List<(string Identifier, string Name, string? NotApplicableBecause)> GetDevicesFromTaskItems (string type, ITaskItem [] items) + { + return items + .Where (v => string.Equals (v.GetMetadata ("Type"), type, StringComparison.OrdinalIgnoreCase)) + .Select (v => { + var reason = v.GetMetadata ("DiscardedReason"); + return (GetDeviceIdentifier (v), GetDeviceName (v), string.IsNullOrEmpty (reason) ? null : reason); + }) + .ToList (); + } + + void AppendDiscardedDevices (StringBuilder sb, string indent, string? type = null) + { + var discardedDevices = DiscardedDevices + .Where (v => type is null || string.Equals (v.GetMetadata ("Type"), type, StringComparison.OrdinalIgnoreCase)) + .ToArray (); + + if (discardedDevices.Length == 0) + return; + + sb.AppendLine ($"{indent}The following devices were discarded:"); + foreach (var device in discardedDevices) { + var reason = device.GetMetadata ("DiscardedReason"); + if (string.IsNullOrEmpty (reason)) { + sb.AppendLine ($"{indent} {FormatDevice (device)}"); + } else { + sb.AppendLine ($"{indent} {FormatDevice (device)}: {reason}"); + } + } + } + + void LogNoAvailableDevicesError () + { + var sb = new StringBuilder (); + sb.AppendLine ("No applicable and available devices found."); + AppendDiscardedDevices (sb, "", GetApplicableDeviceType ()); + Log.LogError (sb.ToString ().TrimEnd ()); + } + protected string GenerateCommandLineCommands () { var sb = new List (); + string? selectedSimulator = null; + var deviceName = DeviceName; if (!string.IsNullOrEmpty (LaunchApp)) { sb.Add (SdkIsSimulator ? "--launchsim" : "--launchdev"); @@ -240,58 +405,38 @@ protected string GenerateCommandLineCommands () sb.Add (InstallApp); } - if (SdkIsSimulator && string.IsNullOrEmpty (DeviceName)) { - var simruntime = $"com.apple.CoreSimulator.SimRuntime.{PlatformName}-{SdkVersion.Replace ('.', '-')}"; - var simdevicetypes = GetDeviceTypes (true); - string simdevicetype; - - if (simdevicetypes?.Count > 0) { - // Use the latest device type we can find. This seems to be what Xcode does by default. - simdevicetype = simdevicetypes.Last (); - } else { - // We couldn't find any device types, so pick one. - switch (Platform) { - case ApplePlatform.iOS: - // Don't try to launch an iPad-only app on an iPhone - if (DeviceType == IPhoneDeviceType.IPad) { - simdevicetype = "com.apple.CoreSimulator.SimDeviceType.iPad--7th-generation-"; - } else { - simdevicetype = "com.apple.CoreSimulator.SimDeviceType.iPhone-11"; - } - break; - case ApplePlatform.TVOS: - simdevicetype = "com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p"; - break; - default: - throw new InvalidOperationException (string.Format (MSBStrings.InvalidPlatform, Platform)); - } - } - DeviceName = $":v2:runtime={simruntime},devicetype={simdevicetype}"; + if (SdkIsSimulator && string.IsNullOrEmpty (deviceName)) { + selectedSimulator = SelectSimulatorDevice (); + deviceName = selectedSimulator; } - if (!string.IsNullOrEmpty (DeviceName)) { + if (!string.IsNullOrEmpty (deviceName)) { if (SdkIsSimulator) { sb.Add ("--device"); - // Figure out whether we got the exact name of a simulator, in which case construct the corresponding argument. - string? simulator = null; - var deviceList = GetDeviceListForSimulator (); - var simulatorsByIdentifier = deviceList.Where (v => v.Identifier == DeviceName).ToArray (); - if (simulatorsByIdentifier.Length == 1) { - simulator = simulatorsByIdentifier [0].Identifier; + if (!string.IsNullOrEmpty (selectedSimulator)) { + sb.Add ($":v2:udid={selectedSimulator}"); } else { - var simulatorsByName = deviceList.Where (v => v.Name == DeviceName).ToArray (); - if (simulatorsByName.Length == 1) - simulator = simulatorsByName [0].Identifier; - } - if (!string.IsNullOrEmpty (simulator)) { - sb.Add ($":v2:udid={simulator}"); - } else { - sb.Add (DeviceName); + // Figure out whether we got the exact name of a simulator, in which case construct the corresponding argument. + string? simulator = null; + var deviceList = GetDeviceListForSimulator (); + var simulatorsByIdentifier = deviceList.Where (v => v.Identifier == deviceName).ToArray (); + if (simulatorsByIdentifier.Length == 1) { + simulator = simulatorsByIdentifier [0].Identifier; + } else { + var simulatorsByName = deviceList.Where (v => v.Name == deviceName).ToArray (); + if (simulatorsByName.Length == 1) + simulator = simulatorsByName [0].Identifier; + } + if (!string.IsNullOrEmpty (simulator)) { + sb.Add ($":v2:udid={simulator}"); + } else { + sb.Add (deviceName); + } } } else { sb.Add ("--devname"); - sb.Add (DeviceName); + sb.Add (deviceName); } } @@ -364,6 +509,7 @@ void ShowHelp () var sampleDevice = firstDevice.Name == StringUtils.Quote (firstDevice.Name) ? firstDevice.Name : firstDevice.Identifier; sb.AppendLine ($" dotnet run -f {f} -r {rid} -p:DeviceName={sampleDevice}"); } + AppendDiscardedDevices (sb, " ", "Device"); sb.AppendLine ($""); sb.AppendLine ($"To run in a simulator:"); @@ -382,6 +528,7 @@ void ShowHelp () var sampleDevice = firstSim.Name == StringUtils.Quote (firstSim.Name) ? firstSim.Name : firstSim.Identifier; sb.AppendLine ($" dotnet run -f {f} -p:DeviceName={sampleDevice}"); } + AppendDiscardedDevices (sb, " ", "Simulator"); sb.AppendLine (); // Sadly the only way to have the help show up in the terminal reliably is to make it a warning @@ -398,6 +545,12 @@ public override bool Execute () return !Log.HasLoggedErrors; } + FilterTaskItemInputs (); + if (Devices.Length == 0) { + LogNoAvailableDevicesError (); + return false; + } + MlaunchArguments = GenerateCommandLineCommands (); return !Log.HasLoggedErrors; } diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs index 614fe03d8165..fec1b1aae419 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/ILLink.cs @@ -35,12 +35,43 @@ public class ILLink : global::ILLink.Tasks.ILLink, ITaskCallback, IHasSessionId // if the linked output should be copied to windows (as opposed to only creating empty output files) public bool CopyToWindows { get; set; } + ITaskItem []? linkerCacheItemsToCopyToWindows; + ITaskItem [] LinkerCacheItemsToCopyToWindows { + get { + if (!CopyToWindows) + return []; + + // We might get called before LinkerCacheItems has been populated, in which case we don't want to cache any results. + if (LinkerCacheItems.Length == 0) + return []; + + if (linkerCacheItemsToCopyToWindows is null) { + linkerCacheItemsToCopyToWindows = LinkerCacheItems.Where (item => { + var extension = item.GetMetadata ("Extension"); + switch (extension.ToLowerInvariant ()) { + case ".h": + case ".m": + case ".mm": + return false; // we don't need any native code on Windows. + default: + return true; // copy the rest of the files to Windows + } + }).ToArray (); + } + return linkerCacheItemsToCopyToWindows; + } + } + public override bool Execute () { if (this.ShouldExecuteRemotely (SessionId)) { if (XamarinTask.ExecuteRemotely (this, out var taskRunner)) { - if (CopyToWindows) - XamarinTask.CopyFilesToWindowsAsync (this, taskRunner, LinkedItems).Wait (); + if (CopyToWindows) { + var filesToCopy = new List (); + filesToCopy.AddRange (LinkedItems); + filesToCopy.AddRange (LinkerCacheItemsToCopyToWindows); + XamarinTask.CopyFilesToWindowsAsync (this, taskRunner, filesToCopy).Wait (); + } return true; } @@ -96,9 +127,16 @@ ITaskItem [] GetAllFilesWithMetadata (string directory, DateTime executionStartT public bool ShouldCreateOutputFile (ITaskItem item) { - if (CopyToWindows && Array.IndexOf (LinkedItems, item) >= 0) { - Log.LogMessage (MessageImportance.Low, "Not creating output file '{0}' because the entire file will be copied to Windows", item.ItemSpec); - return false; + if (CopyToWindows) { + if (Array.IndexOf (LinkedItems, item) >= 0) { + Log.LogMessage (MessageImportance.Low, "Not creating output file '{0}' because the entire file will be copied to Windows", item.ItemSpec); + return false; + } + + if (Array.IndexOf (LinkerCacheItemsToCopyToWindows, item) >= 0) { + Log.LogMessage (MessageImportance.Low, "Not creating output file '{0}' because the entire file will be copied to Windows (because it's not native code)", item.ItemSpec); + return false; + } } var modifiedMetadata = item.GetMetadata ("Modified"); diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets index 7718f0fbf1d8..ffc82202b601 100644 --- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets +++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets @@ -2953,7 +2953,8 @@ Copyright (C) 2018 Microsoft. All rights reserved. - <_PostProcessingItem Include="@(_FilteredFrameworkToPublish->'$(_AppBundleName)$(AppBundleExtension)/$(_AppFrameworksRelativePath)%(Filename)%(Extension).framework/%(Filename)%(Extension)')"> + + <_PostProcessingItem Condition="@(_FilteredFrameworkToPublish->Count()) > 0" Include="@(_FilteredFrameworkToPublish->'$(_AppBundleName)$(AppBundleExtension)/$(_AppFrameworksRelativePath)%(Filename)%(Extension).framework/%(Filename)%(Extension)')"> %(Identity) diff --git a/src/AVFoundation/Enums.cs b/src/AVFoundation/Enums.cs index 08cd40c0b8b5..b68ea9c95ab9 100644 --- a/src/AVFoundation/Enums.cs +++ b/src/AVFoundation/Enums.cs @@ -313,7 +313,7 @@ public enum AVError : long { OperationInterrupted = -11847, /// Indicates that the media format is not supported by the device. IncompatibleAsset = -11848, - /// Indicates taht the media data could not be loaded due to missing required data. + /// Indicates that the media data could not be loaded due to missing required data. FailedToLoadMediaData = -11849, /// Indicates that the media server is not correctly configured. ServerIncorrectlyConfigured = -11850, diff --git a/src/AddressBook/ABAddressBook.cs b/src/AddressBook/ABAddressBook.cs index 1cad31d1891e..9bb491f40e51 100644 --- a/src/AddressBook/ABAddressBook.cs +++ b/src/AddressBook/ABAddressBook.cs @@ -233,7 +233,7 @@ static ABAddressBook () ErrorDomain = Dlfcn.GetStringConstant (Libraries.AddressBook.Handle, "ABAddressBookErrorDomain")!; } - /// + /// protected override void Dispose (bool disposing) { if (sender.IsAllocated) diff --git a/src/AddressBook/ABRecord.cs b/src/AddressBook/ABRecord.cs index 3dfbceeb0488..1914d19bae27 100644 --- a/src/AddressBook/ABRecord.cs +++ b/src/AddressBook/ABRecord.cs @@ -128,7 +128,7 @@ internal static ABRecord FromHandle (IntPtr handle, ABAddressBook? addressbook, return rec; } - /// + /// protected override void Dispose (bool disposing) { AddressBook = null; diff --git a/src/AudioToolbox/AudioBuffers.cs b/src/AudioToolbox/AudioBuffers.cs index de94fc9ef8fd..b8ae09c4c6f3 100644 --- a/src/AudioToolbox/AudioBuffers.cs +++ b/src/AudioToolbox/AudioBuffers.cs @@ -41,9 +41,7 @@ public class AudioBuffers : IDisposable, INativeObject { readonly bool owns; /// Pointer to an existing C-based AudioBufferList. - /// Creates and AudioBuffers object that can be used to query and manipulate a native AudioBuffersList structure. - /// - /// + /// Creates an AudioBuffers object that can be used to query and manipulate a native AudioBuffersList structure. public AudioBuffers (IntPtr address) : this (address, false) { @@ -51,8 +49,7 @@ public AudioBuffers (IntPtr address) /// Pointer to an existing C-based AudioBufferList. /// Determines whether the user code owns the buffer pointed to by address, in that case, calling Dispose will release the buffer. - /// Creates and AudioBuffers object that can be used to query and manipulate a native AudioBuffersList structure. - /// Creates and AudioBuffers object that can be used to query and manipulate a native AudioBuffersList structure. + /// Creates an AudioBuffers object that can be used to query and manipulate a native AudioBuffersList structure. /// /// If you set owns to true, the structure pointed to by /// "address" will be released when you call . diff --git a/src/AudioToolbox/AudioConverter.cs b/src/AudioToolbox/AudioConverter.cs index 310e439a568e..8114a5ed5d4a 100644 --- a/src/AudioToolbox/AudioConverter.cs +++ b/src/AudioToolbox/AudioConverter.cs @@ -521,7 +521,7 @@ public static AudioFormatType []? EncodeFormats { } } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) diff --git a/src/AudioToolbox/AudioFile.cs b/src/AudioToolbox/AudioFile.cs index d2a69f209e86..a55032cae892 100644 --- a/src/AudioToolbox/AudioFile.cs +++ b/src/AudioToolbox/AudioFile.cs @@ -76,7 +76,7 @@ public enum AudioFileType { // UInt32 AudioFileTypeID M4A = 0x6d346166, // m4af /// MPEG-4 Audio Layer with metadata for bookmarks, chapter markers, images and hyperlinks. M4B = 0x6d346266, // m4bf - /// Apple Core Audio Format. CAF files are containers that can contain multiple audio formats, metadata tracks. Uses 64-bit offsetes, so it is not limited to 4GB. + /// Apple Core Audio Format. CAF files are containers that can contain multiple audio formats and metadata tracks. Uses 64-bit offsets, so the format is not limited to 4GB. CAF = 0x63616666, // caff /// 3GP (3GPP file format) is a multimedia container format defined by the Third Generation Partnership Project (3GPP) for 3G UMTS multimedia services. It is used on 3G mobile phones but can also be played on some 2G and 4G phones. ThreeGP = 0x33677070, // 3gpp @@ -2717,8 +2717,7 @@ static int SourceSetSize (IntPtr clientData, long size) /// If the is created in reading mode, this method should return the size of the audio data. If the is created to write data, this method is invoked to set the audio file size. public abstract long Size { get; set; } - /// Releases the resources used by the object. - /// If set to , the method is invoked directly and will dispose managed and unmanaged resources; If set to the method is being called by the garbage collector finalizer and should only release unmanaged resources. + /// protected override void Dispose (bool disposing) { base.Dispose (disposing); @@ -2804,4 +2803,3 @@ protected void Open (AudioFileType fileTypeHint) } } } - diff --git a/src/AudioToolbox/AudioFileStream.cs b/src/AudioToolbox/AudioFileStream.cs index 43704a8569b4..7522ab3b4b56 100644 --- a/src/AudioToolbox/AudioFileStream.cs +++ b/src/AudioToolbox/AudioFileStream.cs @@ -324,7 +324,7 @@ protected virtual void OnPacketDecoded (int numberOfBytes, IntPtr inputData, Aud public EventHandler? PropertyFound; /// The property that has been found. /// - /// Invoked when a propety is found. + /// Invoked when a property is found. /// The default implementation merely raises the PropetyFound event. protected virtual void OnPropertyFound (AudioFileStreamProperty propertyID, ref AudioFileStreamPropertyFlag ioFlags) { @@ -418,7 +418,7 @@ public AudioFileStreamStatus ParseBytes (byte [] bytes, bool discontinuity) } /// Buffer containing the data. - /// First byte withing the array that contains the data to decode. + /// First byte within the array that contains the data to decode. /// Number of bytes to parse. /// True if this invocation to ParseBytes is contiguous to the previous one, false otherwise. /// Parses and decode a portion of the array of bytes provided. diff --git a/src/AudioToolbox/AudioSessions.cs b/src/AudioToolbox/AudioSessions.cs index c7c4c5d48326..9b312d7945a4 100644 --- a/src/AudioToolbox/AudioSessions.cs +++ b/src/AudioToolbox/AudioSessions.cs @@ -259,7 +259,7 @@ public enum AudioSessionInputRouteKind { // UInt32 AudioSessionPropertyID HeadsetMic, /// Bluetooth based microphone BluetoothHFP, - /// Microphone connected through USB (connected either throught the Lightning or 30-pin ports). + /// Microphone connected through USB (connected either through the Lightning or 30-pin ports). USBAudio, } diff --git a/src/AudioToolbox/AudioType.cs b/src/AudioToolbox/AudioType.cs index 4a6201b9c187..a8bfe3d02bb8 100644 --- a/src/AudioToolbox/AudioType.cs +++ b/src/AudioToolbox/AudioType.cs @@ -281,7 +281,7 @@ public struct AudioStreamBasicDescription { const int AudioUnitSampleFractionBits = 24; const AudioFormatFlags AudioFormatFlagIsBigEndian = 0; - /// Developers should not use this deprecated field. Canonical is no longer encouraged, since fixed-point no longer provides a performance advantage over floating point. 'AudioFormatFlagsNativeFloatPacked' is preffered instead. + /// Developers should not use this deprecated field. Canonical is no longer encouraged, since fixed-point no longer provides a performance advantage over floating point. 'AudioFormatFlagsNativeFloatPacked' is preferred instead. /// To be added. [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] @@ -1834,7 +1834,7 @@ public enum MPEG4ObjectID { // long Hvxc = 9, } - /// SMPTE-based time representation. SMPTE times are used to synchronize an point in the audio stream with some external event. + /// SMPTE-based time representation. SMPTE times are used to synchronize a point in the audio stream with some external event. /// SMPTE stands for "Society of Motion Picture and Television Engineers" [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] diff --git a/src/AudioToolbox/MusicPlayer.cs b/src/AudioToolbox/MusicPlayer.cs index 79c04a4a7955..9e5a1839ded4 100644 --- a/src/AudioToolbox/MusicPlayer.cs +++ b/src/AudioToolbox/MusicPlayer.cs @@ -125,7 +125,7 @@ public class MusicPlayer : DisposableObject { { } - /// + /// protected override void Dispose (bool disposing) { currentSequence = null; diff --git a/src/AudioToolbox/MusicSequence.cs b/src/AudioToolbox/MusicSequence.cs index 5213b92da09b..b4266319fb37 100644 --- a/src/AudioToolbox/MusicSequence.cs +++ b/src/AudioToolbox/MusicSequence.cs @@ -78,7 +78,7 @@ public MusicSequence () sequenceMap [Handle] = new WeakReference (this); } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) { diff --git a/src/AudioToolbox/MusicTrack.cs b/src/AudioToolbox/MusicTrack.cs index 92c0665fa1e0..f33d217ac0d7 100644 --- a/src/AudioToolbox/MusicTrack.cs +++ b/src/AudioToolbox/MusicTrack.cs @@ -290,7 +290,7 @@ internal MusicTrack (MusicSequence sequence, IntPtr handle, bool owns) this.sequence = sequence; } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) { diff --git a/src/AudioUnit/AUEnums.cs b/src/AudioUnit/AUEnums.cs index d376c7038c8e..05b4c69ff335 100644 --- a/src/AudioUnit/AUEnums.cs +++ b/src/AudioUnit/AUEnums.cs @@ -1180,7 +1180,7 @@ public enum AudioUnitBusType : long { /// Enumerates flag values that describe the state of an audio transport. [Native] public enum AUHostTransportStateFlags : ulong { - /// Indicates that state change has occured, such as a stop, start, seek, or other change since the host transport state block was last called. + /// Indicates that a state change has occurred, such as a stop, start, seek, or other change since the host transport state block was last called. Changed = 1, /// Indicates that the transport is moving. Moving = 2, @@ -1208,7 +1208,7 @@ public enum AudioComponentInstantiationOptions : uint { LoadedRemotely = 1u << 31, } - /// Enumerates audio unit bus input-ouput capabilities. + /// Enumerates audio unit bus input-output capabilities. [Native] public enum AUAudioUnitBusType : long { /// Indicates an input bus. diff --git a/src/AudioUnit/AUGraph.cs b/src/AudioUnit/AUGraph.cs index cf15c94b3694..bb6580ac220e 100644 --- a/src/AudioUnit/AUGraph.cs +++ b/src/AudioUnit/AUGraph.cs @@ -554,7 +554,7 @@ public void LogAllNodes () CAShow (GetCheckedHandle ()); } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) { diff --git a/src/AudioUnit/AudioUnit.cs b/src/AudioUnit/AudioUnit.cs index 964a6443c67d..27b409f76acb 100644 --- a/src/AudioUnit/AudioUnit.cs +++ b/src/AudioUnit/AudioUnit.cs @@ -1093,7 +1093,7 @@ public AudioUnitStatus ScheduleParameter (AudioUnitParameterEvent inParameterEve [DllImport (Constants.AudioUnitLibrary)] static extern int AudioComponentInstanceDispose (IntPtr inInstance); - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) { @@ -1625,11 +1625,11 @@ public struct AURenderEvent { [SupportedOSPlatform ("tvos")] [StructLayout (LayoutKind.Sequential)] public struct AURecordedParameterEvent { - /// The host time at which the change occured. + /// The host time at which the change occurred. /// To be added. public ulong HostTime; - /// The numeric identfier of the parameter. + /// The numeric identifier of the parameter. /// To be added. public ulong Address; diff --git a/src/CloudKit/Enums.cs b/src/CloudKit/Enums.cs index d905b548b23e..2cb9acb78c9a 100644 --- a/src/CloudKit/Enums.cs +++ b/src/CloudKit/Enums.cs @@ -8,7 +8,7 @@ namespace CloudKit { [MacCatalyst (13, 1)] [Native] public enum CKAccountStatus : long { - /// An error occured when the application tried to determine if the user's account is available. + /// An error occurred when the application tried to determine if the user's account is available. CouldNotDetermine = 0, /// The user's account is available. Available = 1, @@ -37,7 +37,7 @@ public enum CKApplicationPermissions : ulong { public enum CKApplicationPermissionStatus : long { /// The application has not yet requested the permission. InitialState = 0, - /// An error occured while attempting to obtain the permission. + /// An error occurred while attempting to obtain the permission. CouldNotComplete = 1, /// The user denied the permission request. Denied = 2, diff --git a/src/Compression/Compression.cs b/src/Compression/Compression.cs index 7ede110e9917..dcd80d9d1ed7 100644 --- a/src/Compression/Compression.cs +++ b/src/Compression/Compression.cs @@ -652,9 +652,7 @@ private void PurgeBuffers (bool disposing) } } - /// To be added. - /// Releases the unmanaged resources used by the CompressionStream and optionally releases the managed resources. - /// To be added. + /// protected override void Dispose (bool disposing) { try { diff --git a/src/CoreAnimation/CALayer.cs b/src/CoreAnimation/CALayer.cs index c1f2ce814ead..8af4b7110e68 100644 --- a/src/CoreAnimation/CALayer.cs +++ b/src/CoreAnimation/CALayer.cs @@ -67,8 +67,8 @@ void MarkDirtyIfDerived () MarkDirty (true); } - /// The other layer to copy infromation from. - /// This method should be overwritten to provide cloning capabilities for the layer. + /// The other layer to copy information from. + /// This method should be overridden to provide cloning capabilities for the layer. /// You can either override this method and clone the information that you need from the original layer, or perform the copy in your initWithLayer: constructor (see the class description for details and a sample). public virtual void Clone (CALayer other) { diff --git a/src/CoreAnimation/CALayerDelegate.cs b/src/CoreAnimation/CALayerDelegate.cs index 776182d49001..d4a7ee0f0f7f 100644 --- a/src/CoreAnimation/CALayerDelegate.cs +++ b/src/CoreAnimation/CALayerDelegate.cs @@ -40,7 +40,7 @@ internal void SetCALayer (CALayer? layer) calayer = layer is null ? null : new WeakReference (layer); } - /// + /// protected override void Dispose (bool disposing) { if (calayer?.TryGetTarget (out var layer) == true) { diff --git a/src/CoreFoundation/CFMessagePort.cs b/src/CoreFoundation/CFMessagePort.cs index 0ce9a909bf74..43aa87de939e 100644 --- a/src/CoreFoundation/CFMessagePort.cs +++ b/src/CoreFoundation/CFMessagePort.cs @@ -161,7 +161,7 @@ internal CFMessagePort (NativeHandle handle, bool owns) { } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) { diff --git a/src/CoreFoundation/CFRunLoop.cs b/src/CoreFoundation/CFRunLoop.cs index ba237a02634a..27821f39334c 100644 --- a/src/CoreFoundation/CFRunLoop.cs +++ b/src/CoreFoundation/CFRunLoop.cs @@ -212,7 +212,7 @@ static void Perform (IntPtr info) /// To be added. protected abstract void OnPerform (); - /// + /// protected override void Dispose (bool disposing) { if (disposing) { diff --git a/src/CoreFoundation/CFSocket.cs b/src/CoreFoundation/CFSocket.cs index ebee556e6e50..b79befb343cd 100644 --- a/src/CoreFoundation/CFSocket.cs +++ b/src/CoreFoundation/CFSocket.cs @@ -312,7 +312,7 @@ unsafe internal void ReleaseContext (GCHandle gch) } } - /// + /// protected override void Dispose (bool disposing) { if (Handle != NativeHandle.Zero) diff --git a/src/CoreFoundation/CFStream.cs b/src/CoreFoundation/CFStream.cs index 9e75f4956020..2849add4620b 100644 --- a/src/CoreFoundation/CFStream.cs +++ b/src/CoreFoundation/CFStream.cs @@ -789,7 +789,7 @@ protected CFStream (NativeHandle handle, bool owns) { } - /// + /// protected override void Dispose (bool disposing) { if (disposing) { diff --git a/src/CoreFoundation/DispatchSource.cs b/src/CoreFoundation/DispatchSource.cs index 926dcf971f64..644eaa5850c4 100644 --- a/src/CoreFoundation/DispatchSource.cs +++ b/src/CoreFoundation/DispatchSource.cs @@ -231,7 +231,7 @@ public void Cancel () dispatch_source_cancel (GetCheckedHandle ()); } - /// + /// protected override void Dispose (bool disposing) { // Do not call the Cancel method here @@ -873,9 +873,7 @@ public VnodeMonitor (string path, VnodeMonitorKind vnodeKind, DispatchQueue? que InitializeHandle (handle); } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (fd != -1) { diff --git a/src/CoreFoundation/NativeObject.cs b/src/CoreFoundation/NativeObject.cs index be908ae3a8dd..5170e0521045 100644 --- a/src/CoreFoundation/NativeObject.cs +++ b/src/CoreFoundation/NativeObject.cs @@ -49,9 +49,7 @@ protected NativeObject (NativeHandle handle, bool owns, bool verify) Retain (); } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (Handle != NativeHandle.Zero) diff --git a/src/CoreGraphics/CGBitmapContext.cs b/src/CoreGraphics/CGBitmapContext.cs index 08a78ad064a5..0244b4e7a7ae 100644 --- a/src/CoreGraphics/CGBitmapContext.cs +++ b/src/CoreGraphics/CGBitmapContext.cs @@ -103,7 +103,7 @@ public CGBitmapContext (byte []? data, nint width, nint height, nint bitsPerComp this.buffer = buffer; } - /// + /// protected override void Dispose (bool disposing) { if (buffer.IsAllocated) diff --git a/src/CoreGraphics/CGContextPDF.cs b/src/CoreGraphics/CGContextPDF.cs index 8c9ce45549c6..dabc70329833 100644 --- a/src/CoreGraphics/CGContextPDF.cs +++ b/src/CoreGraphics/CGContextPDF.cs @@ -502,7 +502,7 @@ public void SetPageTagStructureTree (NSDictionary pageTagStructureTreeDictionary GC.KeepAlive (pageTagStructureTreeDictionary); } - /// + /// protected override void Dispose (bool disposing) { if (disposing) diff --git a/src/CoreGraphics/CGPDFScanner.cs b/src/CoreGraphics/CGPDFScanner.cs index 487afd40cc91..c488d56603bc 100644 --- a/src/CoreGraphics/CGPDFScanner.cs +++ b/src/CoreGraphics/CGPDFScanner.cs @@ -76,7 +76,7 @@ protected internal override void Release () CGPDFScannerRelease (GetCheckedHandle ()); } - /// + /// protected override void Dispose (bool disposing) { if (gch.IsAllocated) diff --git a/src/CoreImage/CIContext.cs b/src/CoreImage/CIContext.cs index 10baa88ca773..d0f845579dab 100644 --- a/src/CoreImage/CIContext.cs +++ b/src/CoreImage/CIContext.cs @@ -37,7 +37,7 @@ #nullable enable namespace CoreImage { - /// Use to configure the CIContext rendering pipeline. + /// Used to configure the CIContext rendering pipeline. /// You would use an instance of this class to configure the CIContext rendering operations. [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] diff --git a/src/CoreImage/CIFilter.cs b/src/CoreImage/CIFilter.cs index 3ee3998cb41c..6441ce736d2c 100644 --- a/src/CoreImage/CIFilter.cs +++ b/src/CoreImage/CIFilter.cs @@ -133,7 +133,7 @@ internal CIFilter (string name) } /// To be added. - /// Returns an array of strings that specifies the filters taht the system provides for the specified . + /// Returns an array of strings that specifies the filters that the system provides for the specified . /// To be added. /// To be added. public static string [] FilterNamesInCategories (params string []? categories) diff --git a/src/CoreImage/CISampler.cs b/src/CoreImage/CISampler.cs index ad1ae7ee7466..fc61e7da35e9 100644 --- a/src/CoreImage/CISampler.cs +++ b/src/CoreImage/CISampler.cs @@ -52,7 +52,7 @@ public enum CIFilterMode { Linear, } - /// Options to conrol sampler operations for objects. + /// Options to control sampler operations for objects. /// To be added. [SupportedOSPlatform ("ios")] [SupportedOSPlatform ("maccatalyst")] diff --git a/src/CoreMedia/CMAttachmentBearer.cs b/src/CoreMedia/CMAttachmentBearer.cs index 447482d87b67..74aa70c835db 100644 --- a/src/CoreMedia/CMAttachmentBearer.cs +++ b/src/CoreMedia/CMAttachmentBearer.cs @@ -63,7 +63,7 @@ public static class CMAttachmentBearer { /// The object on which this method operates. /// The string that identifies the attachment to return. /// An out parameter that receives a value that tells whether the attachment should propagate or not. - /// Returns the attachment that is identifed by and writes the attachment propagation mode to . + /// Returns the attachment that is identified by and writes the attachment propagation mode to . /// The specified attachment. /// To be added. public static T? GetAttachment (this ICMAttachmentBearer target, string key, out CMAttachmentMode attachmentModeOut) where T : class, INativeObject @@ -132,7 +132,7 @@ public static void RemoveAllAttachments (this ICMAttachmentBearer target) extern static void CMRemoveAttachment (/* CMAttachmentBearerRef */ IntPtr target, /* CFStringRef */ IntPtr key); /// The object on which this method operates. /// The string that identifies the attachment to remove. - /// Removes the attachment that is identifed by . + /// Removes the attachment that is identified by . /// To be added. public static void RemoveAttachment (this ICMAttachmentBearer target, string key) { diff --git a/src/CoreMedia/CMBufferQueue.cs b/src/CoreMedia/CMBufferQueue.cs index 95ff6a1f9113..9cb69f33c6c8 100644 --- a/src/CoreMedia/CMBufferQueue.cs +++ b/src/CoreMedia/CMBufferQueue.cs @@ -87,7 +87,7 @@ struct CMBufferCallbacks2 { internal IntPtr XgetSize; } - /// + /// protected override void Dispose (bool disposing) { queueObjects.Clear (); diff --git a/src/CoreMedia/CMSampleBuffer.cs b/src/CoreMedia/CMSampleBuffer.cs index 740b86194485..8f0acc3daefc 100644 --- a/src/CoreMedia/CMSampleBuffer.cs +++ b/src/CoreMedia/CMSampleBuffer.cs @@ -50,7 +50,7 @@ internal CMSampleBuffer (NativeHandle handle, bool owns) return new CMSampleBuffer (handle, owns); } - /// + /// protected override void Dispose (bool disposing) { if (invalidate.IsAllocated) diff --git a/src/CoreMidi/MidiServices.cs b/src/CoreMidi/MidiServices.cs index f40b1c827e71..903c278009b9 100644 --- a/src/CoreMidi/MidiServices.cs +++ b/src/CoreMidi/MidiServices.cs @@ -738,7 +738,7 @@ static void ClientCallback (IntPtr message, IntPtr context) } } - /// + /// protected override void Dispose (bool disposing) { SetupChanged = null; @@ -1106,7 +1106,7 @@ internal override void DisposeHandle () gch.Free (); } - /// + /// protected override void Dispose (bool disposing) { MessageReceived = null; @@ -2657,7 +2657,7 @@ internal MidiEndpoint (MidiClient client, string name, out MidiError code) } } - /// + /// protected override void Dispose (bool disposing) { MessageReceived = null; diff --git a/src/CoreMidi/MidiThruConnectionParams.cs b/src/CoreMidi/MidiThruConnectionParams.cs index 73952ec67437..d563a4e94284 100644 --- a/src/CoreMidi/MidiThruConnectionParams.cs +++ b/src/CoreMidi/MidiThruConnectionParams.cs @@ -115,7 +115,7 @@ public byte [] Value { [NativeName ("MIDIControlTransform")] [StructLayout (LayoutKind.Sequential)] public struct MidiControlTransform { - /// MIDI conrol type. + /// MIDI control type. /// To be added. public MidiTransformControlType ControlType; /// Resulting control type. @@ -131,7 +131,7 @@ public struct MidiControlTransform { /// This is ignored when  is set to  or . public short Param; - /// MIDI conrol type. + /// MIDI control type. /// Resulting control type. /// Number of the control to be transformed. /// Transformation type to be applied. diff --git a/src/CoreSpotlight/CSEnums.cs b/src/CoreSpotlight/CSEnums.cs index 837479749382..7b328b651f6c 100644 --- a/src/CoreSpotlight/CSEnums.cs +++ b/src/CoreSpotlight/CSEnums.cs @@ -17,7 +17,7 @@ namespace CoreSpotlight { [Native] [ErrorDomain ("CSIndexErrorDomain")] public enum CSIndexErrorCode : long { - /// An unknown error occured. + /// An unknown error occurred. UnknownError = -1, /// The index was not available. IndexUnavailableError = -1000, diff --git a/src/CoreText/CTParagraphStyle.cs b/src/CoreText/CTParagraphStyle.cs index e11efbec2002..13e118c1d741 100644 --- a/src/CoreText/CTParagraphStyle.cs +++ b/src/CoreText/CTParagraphStyle.cs @@ -234,6 +234,7 @@ internal override void WriteValue (CTParagraphStyleSettingValue [] values, int i values [index].pointer = value.Handle; } + /// public override void Dispose (CTParagraphStyleSettingValue [] values, int index) { values [index].pointer = IntPtr.Zero; diff --git a/src/CoreVideo/CVDisplayLink.cs b/src/CoreVideo/CVDisplayLink.cs index 82499c146067..0596a96ca16d 100644 --- a/src/CoreVideo/CVDisplayLink.cs +++ b/src/CoreVideo/CVDisplayLink.cs @@ -171,9 +171,7 @@ protected internal override void Release () CVDisplayLinkRelease (GetCheckedHandle ()); } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (callbackHandle.IsAllocated) { diff --git a/src/Darwin/SystemLog.cs b/src/Darwin/SystemLog.cs index e68877dc16c3..1778333e5197 100644 --- a/src/Darwin/SystemLog.cs +++ b/src/Darwin/SystemLog.cs @@ -61,9 +61,7 @@ public enum Option { NoRemote, } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) @@ -310,9 +308,7 @@ public Message (Kind kind) [DllImport (Constants.SystemLibrary)] extern static void asl_free (IntPtr handle); - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero && Owns) diff --git a/src/EventKit/EKEnums.cs b/src/EventKit/EKEnums.cs index a8b08d1a9d3c..85f69e0a325a 100644 --- a/src/EventKit/EKEnums.cs +++ b/src/EventKit/EKEnums.cs @@ -125,7 +125,7 @@ public enum EKErrorCode : long { SourceDoesNotAllowCalendarAddDelete, /// A recurring reminder's due date was missing. RecurringReminderRequiresDueDate, - /// The soure does not support structured locations. + /// The source does not support structured locations. StructuredLocationsNotSupported, /// Locations are not supported for reminders on the source. ReminderLocationsNotSupported, diff --git a/src/Foundation/Enum.cs b/src/Foundation/Enum.cs index 10b042ff9cd4..ba806c598e9b 100644 --- a/src/Foundation/Enum.cs +++ b/src/Foundation/Enum.cs @@ -1075,7 +1075,7 @@ public enum NSSearchPathDirectory : ulong { CachesDirectory = 13, /// Application support directory (Library/Application Support) ApplicationSupportDirectory = 14, - /// Downloads directory (only avaialble when the domain specified includes the User value) + /// Downloads directory (only available when the domain specified includes the User value) DownloadsDirectory = 15, /// Input methods directory (Library/Input Methods) InputMethodsDirectory = 16, diff --git a/src/Foundation/NSData.cs b/src/Foundation/NSData.cs index 8ed950f07fe0..a6499051e4df 100644 --- a/src/Foundation/NSData.cs +++ b/src/Foundation/NSData.cs @@ -160,6 +160,7 @@ public UnmanagedMemoryStreamWithRef (NSData source) : base ((byte*) source.Bytes this.source = source; } + /// protected override void Dispose (bool disposing) { source = null; diff --git a/src/Foundation/NSInputStream.cs b/src/Foundation/NSInputStream.cs index 23d821cf7bdf..e65843332aeb 100644 --- a/src/Foundation/NSInputStream.cs +++ b/src/Foundation/NSInputStream.cs @@ -78,7 +78,7 @@ public virtual nint Read (IntPtr buffer, nuint len) } } - /// + /// protected override void Dispose (bool disposing) { context.Release (); diff --git a/src/Foundation/NSMutableUrlRequest.cs b/src/Foundation/NSMutableUrlRequest.cs index 110c23f40b62..bd81ceff4638 100644 --- a/src/Foundation/NSMutableUrlRequest.cs +++ b/src/Foundation/NSMutableUrlRequest.cs @@ -9,7 +9,7 @@ public partial class NSUrlRequest { /// /// diff --git a/src/Foundation/NSNotificationCenter.cs b/src/Foundation/NSNotificationCenter.cs index a0a86a0dd033..d956d5c04a4a 100644 --- a/src/Foundation/NSNotificationCenter.cs +++ b/src/Foundation/NSNotificationCenter.cs @@ -48,6 +48,7 @@ public void Post (NSNotification s) s.Dispose (); } + /// protected override void Dispose (bool disposing) { if (disposing && notificationCenter is not null) { diff --git a/src/Foundation/NSObject2.cs b/src/Foundation/NSObject2.cs index a303621f5e77..67db516a5cec 100644 --- a/src/Foundation/NSObject2.cs +++ b/src/Foundation/NSObject2.cs @@ -1091,6 +1091,14 @@ internal void ClearHandle () handle = NativeHandle.Zero; } + // This is weird - a setter only - but it's so that we can remove an object right after creating it using object creation syntax: + // new NSString ("") { RemoveFromObjectMap = true }; + internal bool RemoveFromObjectMap { + set { + Runtime.RemoveFromObjectMap (this); + } + } + /// protected virtual void Dispose (bool disposing) { @@ -1256,6 +1264,7 @@ public override void ObserveValue (NSString keyPath, NSObject ofObject, NSDictio base.ObserveValue (keyPath, ofObject, change, context); } + /// protected override void Dispose (bool disposing) { if (disposing) { diff --git a/src/Foundation/NSString.cs b/src/Foundation/NSString.cs index c16bbc61d28b..31e72a4fdcb7 100644 --- a/src/Foundation/NSString.cs +++ b/src/Foundation/NSString.cs @@ -51,7 +51,7 @@ public partial class NSString : NSObject { #if !COREBUILD /// An instance for an empty (zero-length) string. - public static readonly NSString Empty = new NSString (String.Empty); + public static readonly NSString Empty = new NSString (String.Empty) { RemoveFromObjectMap = true }; internal NSString (NativeHandle handle, bool owns) : base (handle, owns) { diff --git a/src/Foundation/NSUrlSessionHandler.cs b/src/Foundation/NSUrlSessionHandler.cs index 610af3a33997..2c0af8202220 100644 --- a/src/Foundation/NSUrlSessionHandler.cs +++ b/src/Foundation/NSUrlSessionHandler.cs @@ -124,10 +124,6 @@ public partial class NSUrlSessionHandler : HttpMessageHandler { readonly Dictionary inflightRequests; readonly object inflightRequestsLock = new object (); readonly NSUrlSessionConfiguration.SessionConfigurationType sessionType; -#if !MONOMAC && !NET8_0 && !NET10_0_OR_GREATER - NSObject? notificationToken; // needed to make sure we do not hang if not using a background session - readonly object notificationTokenLock = new object (); // need to make sure that threads do no step on each other with a dispose and a remove inflight data -#endif X509ChainPolicy? policy; static NSUrlSessionConfiguration CreateConfig () @@ -161,89 +157,10 @@ public NSUrlSessionHandler (NSUrlSessionConfiguration configuration) allowsCellularAccess = configuration.AllowsCellularAccess; AllowAutoRedirect = true; -#if !NET10_0_OR_GREATER -#pragma warning disable SYSLIB0014 - // SYSLIB0014: 'ServicePointManager' is obsolete: 'WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead. Settings on ServicePointManager no longer affect SslStream or HttpClient.' (https://aka.ms/dotnet-warnings/SYSLIB0014) - // https://github.com/dotnet/macios/issues/20764 - var sp = ServicePointManager.SecurityProtocol; -#pragma warning restore SYSLIB0014 - - // The analyzer has a bug where SupportedOSPlatformGuard attributes don't work correctly (https://github.com/dotnet/roslyn-analyzers/issues/7665#issuecomment-2898275765), so ignore CA1416/CA1422 here - // warning CA1422: This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 12.0 and later, 'tvos' 12.2 and later. 'NSUrlSessionConfiguration.[...]' is obsoleted on: 'ios' 13.0 and later (Use '...' instead.), 'maccatalyst' 13.0 and later (Use '...' instead.), 'macOS/OSX' 10.15 and later (Use '...' instead.). - // warning CA1416: This call site is reachable on: 'ios' 12.2 and later, 'maccatalyst' 12.2 and later, 'macOS/OSX' 10.15 and later, 'tvos' 12.2 and later. 'NSUrlSessionConfiguration.[...]' is only supported on: 'ios' 13.0 and later, 'tvos' 13.0 and later -#pragma warning disable CA1416 -#pragma warning disable CA1422 - if (SystemVersion.IsAtLeastXcode11) { - if ((sp & SecurityProtocolType.Ssl3) != 0) { - // no equivalent - } else if ((sp & SecurityProtocolType.Tls) != 0) { - configuration.TlsMinimumSupportedProtocolVersion = TlsProtocolVersion.Tls10; - } else if ((sp & SecurityProtocolType.Tls11) != 0) { - configuration.TlsMinimumSupportedProtocolVersion = TlsProtocolVersion.Tls11; - } else if ((sp & SecurityProtocolType.Tls12) != 0) { - configuration.TlsMinimumSupportedProtocolVersion = TlsProtocolVersion.Tls12; - } else if ((sp & SecurityProtocolType.Tls13) != 0) { - configuration.TlsMinimumSupportedProtocolVersion = TlsProtocolVersion.Tls13; - } - } else { - if ((sp & SecurityProtocolType.Ssl3) != 0) - configuration.TLSMinimumSupportedProtocol = SslProtocol.Ssl_3_0; - else if ((sp & SecurityProtocolType.Tls) != 0) - configuration.TLSMinimumSupportedProtocol = SslProtocol.Tls_1_0; - else if ((sp & SecurityProtocolType.Tls11) != 0) - configuration.TLSMinimumSupportedProtocol = SslProtocol.Tls_1_1; - else if ((sp & SecurityProtocolType.Tls12) != 0) - configuration.TLSMinimumSupportedProtocol = SslProtocol.Tls_1_2; - else if ((sp & SecurityProtocolType.Tls13) != 0) - configuration.TLSMinimumSupportedProtocol = SslProtocol.Tls_1_3; - } -#pragma warning restore CA1422 -#pragma warning restore CA1416 -#endif // NET10_0_OR_GREATER - session = NSUrlSession.FromConfiguration (configuration, (INSUrlSessionDelegate) new NSUrlSessionHandlerDelegate (this), null); inflightRequests = new Dictionary (); } -#if !MONOMAC && !NET8_0 && !NET10_0_OR_GREATER - - void AddNotification () - { - lock (notificationTokenLock) { - if (!bypassBackgroundCheck && sessionType != NSUrlSessionConfiguration.SessionConfigurationType.Background && notificationToken is null) - notificationToken = NSNotificationCenter.DefaultCenter.AddObserver (UIApplication.WillResignActiveNotification, BackgroundNotificationCb); - } // lock - } - - void RemoveNotification () - { - NSObject? localNotificationToken; - lock (notificationTokenLock) { - localNotificationToken = notificationToken; - notificationToken = null; - } - if (localNotificationToken is not null) - NSNotificationCenter.DefaultCenter.RemoveObserver (localNotificationToken); - } - - void BackgroundNotificationCb (NSNotification obj) - { - // the cancelation task of each of the sources will clean the different resources. Each removal is done - // inside a lock, but of course, the .Values collection will not like that because it is modified during the - // iteration. We split the operation in two, get all the diff cancelation sources, then try to cancel each of them - // which will do the correct lock dance. Note that we could be tempted to do a RemoveAll, that will yield the same - // runtime issue, this is dull but safe. - List> sources; - lock (inflightRequestsLock) { // just lock when we iterate - sources = new List> (inflightRequests.Count); - foreach (var r in inflightRequests.Values) { - sources.Add (r.CompletionSource); - } - } - sources.ForEach (source => { source.TrySetCanceled (); }); - } -#endif - /// The maximum amount of content to load into memory when sending content with a request. /// The maximum size of content to load into memory. /// @@ -259,16 +176,10 @@ void BackgroundNotificationCb (NSNotification obj) void RemoveInflightData (NSUrlSessionTask task, bool cancel = true) { lock (inflightRequestsLock) { - if (inflightRequests.TryGetValue (task, out var data)) { + if (inflightRequests.Remove (task, out var data)) { if (cancel) data.CancellationTokenSource.Cancel (); - inflightRequests.Remove (task); } -#if !MONOMAC && !NET8_0 && !NET10_0_OR_GREATER - // do we need to be notified? If we have not inflightData, we do not - if (inflightRequests.Count == 0) - RemoveNotification (); -#endif } if (cancel) @@ -277,23 +188,19 @@ void RemoveInflightData (NSUrlSessionTask task, bool cancel = true) task?.Dispose (); } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { + var tasks = new List (); lock (inflightRequestsLock) { -#if !MONOMAC && !NET8_0 && !NET10_0_OR_GREATER - // remove the notification if present, method checks against null - RemoveNotification (); -#endif - foreach (var pair in inflightRequests) { - pair.Key?.Cancel (); - pair.Key?.Dispose (); - } - + tasks.AddRange (inflightRequests.Keys); inflightRequests.Clear (); } + foreach (var task in tasks) { + task.Cancel (); + task.Dispose (); + } + session.InvalidateAndCancel (); base.Dispose (disposing); } @@ -366,34 +273,15 @@ public NSUrlSessionHandlerTrustOverrideForUrlCallback? TrustOverrideForUrl { trustOverrideForUrl = value; } } -#if !NET8_0 && !NET10_0_OR_GREATER - // we do check if a user does a request and the application goes to the background, but - // in certain cases the user does that on purpose (BeingBackgroundTask) and wants to be able - // to use the network. In those cases, which are few, we want the developer to explicitly - // bypass the check when there are not request in flight - bool bypassBackgroundCheck = true; -#endif #if !XAMCORE_5_0 [EditorBrowsable (EditorBrowsableState.Never)] -#if NET8_0 || NET10_0_OR_GREATER [Obsolete ("This property is ignored.")] -#else - [Obsolete ("This property will be ignored in .NET 10+.")] -#endif public bool BypassBackgroundSessionCheck { get { -#if NET8_0 || NET10_0_OR_GREATER return true; -#else - return bypassBackgroundCheck; -#endif } set { -#if !NET8_0 && !NET10_0_OR_GREATER - EnsureModifiability (); - bypassBackgroundCheck = value; -#endif } } #endif // !XAMCORE_5_0 @@ -567,10 +455,6 @@ protected override async Task SendAsync (HttpRequestMessage var inflightData = new InflightData (request.RequestUri?.AbsoluteUri!, cancellationToken, request); lock (inflightRequestsLock) { -#if !MONOMAC && !NET8_0 && !NET10_0_OR_GREATER - // Add the notification whenever needed - AddNotification (); -#endif inflightRequests.Add (dataTask, inflightData); } @@ -1289,9 +1173,10 @@ static bool TryGetAuthenticationType (NSUrlProtectionSpace protectionSpace, [Not authenticationType = "NTLM"; } else if (protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodHTTPBasic) { authenticationType = "basic"; + } else if (protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodHTTPDigest) { + authenticationType = "digest"; } else if (protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodNegotiate || - protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodHTMLForm || - protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodHTTPDigest) { + protectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodHTMLForm) { // Want to reject this authentication type to allow the next authentication method in the request to // be used. authenticationType = RejectProtectionSpaceAuthType; @@ -1338,6 +1223,7 @@ public NSUrlSessionDataTaskStreamContent (NSUrlSessionDataTaskStream source, Act disposed = onDisposed; } + /// protected override void Dispose (bool disposing) { var action = Interlocked.Exchange (ref disposed, null); @@ -1403,6 +1289,7 @@ protected override Task CreateContentReadStreamAsync () return Task.FromResult (content); } + /// protected override void Dispose (bool disposing) { if (disposing) { @@ -1703,6 +1590,7 @@ public override void Unschedule (NSRunLoop aRunLoop, NSString nsMode) cfRunLoop.RemoveSource (source, nsMode); } + /// protected override void Dispose (bool disposing) { stream?.Dispose (); diff --git a/src/Foundation/ProtocolAttribute.cs b/src/Foundation/ProtocolAttribute.cs index 2b22ce42d415..930314e65ec5 100644 --- a/src/Foundation/ProtocolAttribute.cs +++ b/src/Foundation/ProtocolAttribute.cs @@ -60,7 +60,7 @@ public sealed class ProtocolAttribute : Attribute { /// public ProtocolAttribute () { } - /// The type of a specific managed type that can be used to wrap an instane of this protocol. + /// The specific managed type that can be used to wrap an instance of this protocol. /// To be added. /// Objective-C protocols are bound as interfaces in managed code, but sometimes a class is needed (in certain /// scenarios our Objective-C-managed bridge have the pointer to an instance of a native object and we only know that it diff --git a/src/GameKit/GKCompat.cs b/src/GameKit/GKCompat.cs index 4e6d760da63a..1548a392bc00 100644 --- a/src/GameKit/GKCompat.cs +++ b/src/GameKit/GKCompat.cs @@ -233,7 +233,7 @@ public virtual NSObject? WeakDelegate { } } - /// + /// protected override void Dispose (bool disposing) { throw new PlatformNotSupportedException (Constants.TypeUnavailable); diff --git a/src/ILLink.Substitutions.MacCatalyst.xml b/src/ILLink.Substitutions.MacCatalyst.xml index c139f91583b5..0b0f7e6d032b 100644 --- a/src/ILLink.Substitutions.MacCatalyst.xml +++ b/src/ILLink.Substitutions.MacCatalyst.xml @@ -15,7 +15,7 @@ - + diff --git a/src/ILLink.Substitutions.iOS.xml b/src/ILLink.Substitutions.iOS.xml index de3ee88011ff..6daa15a685fe 100644 --- a/src/ILLink.Substitutions.iOS.xml +++ b/src/ILLink.Substitutions.iOS.xml @@ -17,7 +17,7 @@ - + diff --git a/src/ILLink.Substitutions.macOS.xml b/src/ILLink.Substitutions.macOS.xml index 1ad679b886f2..6ebaaeb61271 100644 --- a/src/ILLink.Substitutions.macOS.xml +++ b/src/ILLink.Substitutions.macOS.xml @@ -14,7 +14,7 @@ - + diff --git a/src/ILLink.Substitutions.tvOS.xml b/src/ILLink.Substitutions.tvOS.xml index 68854b87bcab..2ef886730f0f 100644 --- a/src/ILLink.Substitutions.tvOS.xml +++ b/src/ILLink.Substitutions.tvOS.xml @@ -17,7 +17,7 @@ - + diff --git a/src/MediaPlayer/MediaPlayer.cs b/src/MediaPlayer/MediaPlayer.cs index 0a083c99f6d0..76a53140f02f 100644 --- a/src/MediaPlayer/MediaPlayer.cs +++ b/src/MediaPlayer/MediaPlayer.cs @@ -446,7 +446,7 @@ public enum MPErrorCode : long { CloudServiceCapabilityMissing, /// A connection to the network could not be established. NetworkConnectionFailed, - /// The identifer was not found in the store front. + /// The identifier was not found in the storefront. NotFound, /// The operation was not supported. NotSupported, diff --git a/src/MediaToolbox/MTAudioProcessingTap.cs b/src/MediaToolbox/MTAudioProcessingTap.cs index 04778249a58c..7c6ad948bbbe 100644 --- a/src/MediaToolbox/MTAudioProcessingTap.cs +++ b/src/MediaToolbox/MTAudioProcessingTap.cs @@ -143,7 +143,7 @@ public MTAudioProcessingTap (MTAudioProcessingTapCallbacks callbacks, MTAudioPro handles [handle] = this; } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) { diff --git a/src/Metal/MTLIOCompression.cs b/src/Metal/MTLIOCompression.cs index 54c1d4cfdc4b..9a9ceada2e79 100644 --- a/src/Metal/MTLIOCompression.cs +++ b/src/Metal/MTLIOCompression.cs @@ -63,6 +63,7 @@ public void AppendData (NSData data) return new MTLIOCompressionContext (handle, owns: true); } + /// protected override void Dispose (bool disposing) { // only call the parent if the user did not call FlushAndDestroy diff --git a/src/NetworkExtension/NEEnums.cs b/src/NetworkExtension/NEEnums.cs index 7f51a108ac4f..8d01e0261fea 100644 --- a/src/NetworkExtension/NEEnums.cs +++ b/src/NetworkExtension/NEEnums.cs @@ -330,7 +330,7 @@ public enum NEProviderStopReason : long { IdleTimeout = 8, /// The network configuration was disabled. ConfigurationDisabled = 9, - /// The netowrk configuration was removed. + /// The network configuration was removed. ConfigurationRemoved = 10, /// The configuration was superseded by another. Superseded = 11, diff --git a/src/NewsstandKit/Compat.cs b/src/NewsstandKit/Compat.cs index 96bfb4202324..734b489d5cf3 100644 --- a/src/NewsstandKit/Compat.cs +++ b/src/NewsstandKit/Compat.cs @@ -75,7 +75,7 @@ public virtual NSDictionary? UserInfo { } } - /// + /// protected override void Dispose (bool disposing) { throw new InvalidOperationException (Constants.NewsstandKitRemoved); diff --git a/src/ObjCRuntime/Class.cs b/src/ObjCRuntime/Class.cs index 8ed877256f4a..819122f30246 100644 --- a/src/ObjCRuntime/Class.cs +++ b/src/ObjCRuntime/Class.cs @@ -886,17 +886,10 @@ internal static bool class_addMethod (IntPtr cls, IntPtr name, IntPtr imp, strin [DllImport ("__Internal")] static extern void xamarin_free (IntPtr ptr); - // This option is turned on by setting _ValidateObjectPointers property to true in the project file. - static bool validate_object_pointers; - static bool ValidateObjectPointers { - get => validate_object_pointers; - set => validate_object_pointers = value; - } - internal unsafe static bool TryGetClass (IntPtr obj, out IntPtr cls, [NotNullWhen (false)] out string? error_message) { error_message = null; - if (ValidateObjectPointers && obj != IntPtr.Zero) { + if (Runtime.ValidateObjectPointers && obj != IntPtr.Zero) { IntPtr error_str; var rv = xamarin_is_object_valid (obj, &error_str); if (rv == 0) { diff --git a/src/ObjCRuntime/ExceptionMode.cs b/src/ObjCRuntime/ExceptionMode.cs index d0aa79a1c8be..45f5b5c2d443 100644 --- a/src/ObjCRuntime/ExceptionMode.cs +++ b/src/ObjCRuntime/ExceptionMode.cs @@ -37,7 +37,7 @@ public enum MarshalObjectiveCExceptionMode { /* This enum must always match the identical enum in runtime/xamarin/main.h */ - /// This enum is used to specify what to do when an managed exception is thrown, and that exception reaches native code. + /// This enum is used to specify what to do when a managed exception is thrown, and that exception reaches native code. /// Exception marshaling public enum MarshalManagedExceptionMode { /// The default mode. This is currently the same as . @@ -52,7 +52,7 @@ public enum MarshalManagedExceptionMode { /// /// /// This option is not recommended, because it leads to undefined behavior (the app may crash, leak memory, deadlock, etc.) - /// if managed exceptions reaches native code (the MonoVM runtime does not know how to unwind native frames, so anything can + /// if managed exceptions reach native code (the MonoVM runtime does not know how to unwind native frames, so anything can /// happen). The recommended option is . /// /// @@ -61,7 +61,7 @@ public enum MarshalManagedExceptionMode { /// Convert the managed exception to an Objective-C exception. This is the recommended option (and also the default behavior). ThrowObjectiveCException = 2, - /// Abort when a managed exception reaches native code. This may be useful during debugging to easily detect when managed exceptions reaches native code. + /// Abort when a managed exception reaches native code. This may be useful during debugging to easily detect when managed exceptions reach native code. Abort = 3, /// Disable marshalling managed exceptions. This is effectively the same as , except that no events will be raised. diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs index 7f63bdc3c785..896fd1b62741 100644 --- a/src/ObjCRuntime/Runtime.cs +++ b/src/ObjCRuntime/Runtime.cs @@ -1636,6 +1636,33 @@ static IntPtr CreateNSObject (IntPtr type_gchandle, IntPtr handle, NSObject.Flag return null; } + /// Remove an object from the object map. + /// + /// Removing an object from the object map can be necessary for managed wrapper objects that are singletons or not really Objective-C classes, but constant pointers. + /// For instance, the constant empty string (@"") is just a singleton pointer which can't be retained/released (retaining/releasing does nothing). + /// The problem arises when the managed wrapper for such a native handle is disposed, then subsequently it re-surfaces, and now we end up finding a + /// disposed object in the object map. + /// + internal static bool RemoveFromObjectMap (NSObject obj) + { + var handle = obj.GetHandle (); + if (handle == NativeHandle.Zero) + return false; + + lock (lock_obj) { + if (!object_map.TryGetValue (handle, out var reference)) + return false; + + if (!object.ReferenceEquals (reference.Target, obj)) + return false; + + object_map.Remove (handle); + reference.Free (); + } + + return true; + } + public static NSObject? GetNSObject (NativeHandle ptr) { return GetNSObject ((IntPtr) ptr, MissingCtorResolution.ThrowConstructor1NotFound); @@ -2688,6 +2715,13 @@ static IntPtr LookupUnmanagedFunction (IntPtr assembly, IntPtr symbol, int id) { return RegistrarHelper.LookupUnmanagedFunction (assembly, Marshal.PtrToStringAuto (symbol), id); } + + // This option is turned on by setting _ValidateObjectPointers property to true in the project file. + static bool validate_object_pointers; + internal static bool ValidateObjectPointers { + get => validate_object_pointers; + set => validate_object_pointers = value; + } } diff --git a/src/PassKit/PKCompat.cs b/src/PassKit/PKCompat.cs index 28813be8c659..4810177e6ffa 100644 --- a/src/PassKit/PKCompat.cs +++ b/src/PassKit/PKCompat.cs @@ -127,9 +127,7 @@ public virtual NSObject? WeakDelegate { } } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { throw new InvalidOperationException (Constants.RemovedFromPassKit); diff --git a/src/PassKit/PKShareablePassMetadata.cs b/src/PassKit/PKShareablePassMetadata.cs index 8d368b284021..2a9469e59b54 100644 --- a/src/PassKit/PKShareablePassMetadata.cs +++ b/src/PassKit/PKShareablePassMetadata.cs @@ -18,9 +18,9 @@ public enum CardType { Configuration = 1, } - /// Create a new instance. + /// Creates a new instance. /// The credential identifier for the new instance. - /// The sharing instance identifer for the new instance. + /// The sharing instance identifier for the new instance. /// The card template identifier for the new instance. /// The preview for the new instance. [SupportedOSPlatform ("ios16.0")] @@ -32,9 +32,9 @@ public PKShareablePassMetadata (string credentialIdentifier, string sharingInsta { } - /// Create a new instance. + /// Creates a new instance. /// The credential identifier for the new instance. - /// The sharing instance identifer for the new instance. + /// The sharing instance identifier for the new instance. /// The template identifier for the new instance. /// The preview for the new instance. /// Specifies whether the parameter specifies a card template identifier or a card configuration identifier. diff --git a/src/SearchKit/SearchKit.cs b/src/SearchKit/SearchKit.cs index b2d5fb4843b7..e5130fbd3c00 100644 --- a/src/SearchKit/SearchKit.cs +++ b/src/SearchKit/SearchKit.cs @@ -373,9 +373,7 @@ public void Close () Dispose (); } - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { if (Handle != NativeHandle.Zero) { diff --git a/src/Security/Authorization.cs b/src/Security/Authorization.cs index dcdef4c18a9c..4bc66a64872c 100644 --- a/src/Security/Authorization.cs +++ b/src/Security/Authorization.cs @@ -201,6 +201,7 @@ public int ExecuteWithPrivileges (string pathToTool, AuthorizationFlags flags, s return retval; } + /// protected override void Dispose (bool disposing) { Dispose (0, disposing); diff --git a/src/Security/Enums.cs b/src/Security/Enums.cs index 3c05fda6c908..4a26085ed2f2 100644 --- a/src/Security/Enums.cs +++ b/src/Security/Enums.cs @@ -847,9 +847,9 @@ public enum SecTrustResult { Unspecified, /// Not enough information is available to trust this certificate. If extra information is supplied then it could be trusted (or not). RecoverableTrustFailure, - /// The certificate could not be trace back to a trusted root. + /// The certificate could not be traced back to a trusted root. FatalTrustFailure, - /// An error occured while trying to determine the certificate trust. + /// An error occurred while trying to determine the certificate trust. ResultOtherError, } diff --git a/src/Security/SslContext.cs b/src/Security/SslContext.cs index bd3cf98b37a0..e27f8084992b 100644 --- a/src/Security/SslContext.cs +++ b/src/Security/SslContext.cs @@ -48,7 +48,7 @@ public SslContext (SslProtocolSide protocolSide, SslConnectionType connectionTyp [DllImport (Constants.SecurityLibrary)] extern static /* OSStatus */ SslStatus SSLClose (/* SSLContextRef */ IntPtr context); - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/SensitiveContentAnalysis/SCVideoStreamAnalyzer.cs b/src/SensitiveContentAnalysis/SCVideoStreamAnalyzer.cs index e43ed8560327..a9ab2fe3f48d 100644 --- a/src/SensitiveContentAnalysis/SCVideoStreamAnalyzer.cs +++ b/src/SensitiveContentAnalysis/SCVideoStreamAnalyzer.cs @@ -7,11 +7,11 @@ namespace SensitiveContentAnalysis { #if __IOS__ && !__MACCATALYST__ public partial class SCVideoStreamAnalyzer { - /// Create a new instance with the specified particant and stream direction. + /// Creates a new instance with the specified participant and stream direction. /// The unique identifier for a participant in the conference call. /// Specifies whether the stream comes from the local camera or a remote location. /// The error object if an error occurs. - /// A new instance with the specified particant and stream direction if successful, otherwise. + /// A new instance with the specified participant and stream direction if successful; otherwise, . public static SCVideoStreamAnalyzer? Create (string participantUuid, SCVideoStreamAnalyzerStreamDirection streamDirection, out NSError? error) { var rv = new SCVideoStreamAnalyzer (NSObjectFlag.Empty); diff --git a/src/StoreKit/Enums.cs b/src/StoreKit/Enums.cs index 2fa3d171e13e..ac7d32a7245b 100644 --- a/src/StoreKit/Enums.cs +++ b/src/StoreKit/Enums.cs @@ -132,7 +132,7 @@ public enum SKCloudServiceCapability : ulong { AddToCloudMusicLibrary = 1 << 8, } - /// Enumerates visiblity settings for a promoted product. + /// Enumerates visibility settings for a promoted product. [Deprecated (PlatformName.iOS, 18, 0 /* Apple's replacement requires Swift */ )] [Deprecated (PlatformName.MacCatalyst, 18, 0 /* Apple's replacement requires Swift */ )] [Deprecated (PlatformName.MacOSX, 15, 0 /* Apple's replacement requires Swift */ )] diff --git a/src/System.Net.Http/CFNetworkHandler.cs b/src/System.Net.Http/CFNetworkHandler.cs index ca3c03af3bda..a4e76243f921 100644 --- a/src/System.Net.Http/CFNetworkHandler.cs +++ b/src/System.Net.Http/CFNetworkHandler.cs @@ -152,9 +152,7 @@ public bool UseSystemProxy { // TODO: Add more properties - /// To be added. - /// To be added. - /// To be added. + /// protected override void Dispose (bool disposing) { // TODO: CloseStream remaining stream buckets if there are any diff --git a/src/SystemConfiguration/NetworkReachability.cs b/src/SystemConfiguration/NetworkReachability.cs index 6944d3cacc77..3fa95a958c5a 100644 --- a/src/SystemConfiguration/NetworkReachability.cs +++ b/src/SystemConfiguration/NetworkReachability.cs @@ -687,6 +687,7 @@ public bool SetDispatchQueue (DispatchQueue? queue) return result; } + /// protected override void Dispose (bool disposing) { if (gch.IsAllocated) diff --git a/src/UIKit/UIControl.cs b/src/UIKit/UIControl.cs index 9345dcf238da..f4787654b8f4 100644 --- a/src/UIKit/UIControl.cs +++ b/src/UIKit/UIControl.cs @@ -38,6 +38,7 @@ public void Activated () eh (source, EventArgs.Empty); } + /// protected override void Dispose (bool disposing) { eh = null; diff --git a/src/UIKit/UIEnums.cs b/src/UIKit/UIEnums.cs index 101165329556..eb66f9e510a3 100644 --- a/src/UIKit/UIEnums.cs +++ b/src/UIKit/UIEnums.cs @@ -662,7 +662,7 @@ public enum UIDocumentState : ulong { } // NSInteger -> UIImagePickerController.h - /// An enumeration of values used to specify the source using by the . + /// An enumeration of values used to specify the source used by the . [Native] [NoTV] [MacCatalyst (13, 1)] @@ -3047,7 +3047,7 @@ public enum UIPreviewActionStyle : long { /// /// objects model not just digital presses but, for instance, trackpads, so a may have both location and force data. Additionally, the system may cancel tracking of a button press at any time. This leads to the following state-machine: /// - /// Statechart showing states and transitions occuring during a press + /// Statechart showing states and transitions occurring during a press /// /// [MacCatalyst (13, 1)] @@ -3714,7 +3714,7 @@ public enum UIPrintErrorCode : long { NoContentError, /// Indicates that UIKit does not recognize the image format. UnknownImageFormatError, - /// Indicates that an internal print error occured. + /// Indicates that an internal print error occurred. JobFailedError, } diff --git a/src/VideoToolbox/VTCompressionSession.cs b/src/VideoToolbox/VTCompressionSession.cs index b57a00dc397a..147ac84fe640 100644 --- a/src/VideoToolbox/VTCompressionSession.cs +++ b/src/VideoToolbox/VTCompressionSession.cs @@ -31,6 +31,7 @@ internal VTCompressionSession (NativeHandle handle, bool owns) : base (handle, o { } + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTDecompressionSession.cs b/src/VideoToolbox/VTDecompressionSession.cs index d5e74e12a445..87397f9c4d19 100644 --- a/src/VideoToolbox/VTDecompressionSession.cs +++ b/src/VideoToolbox/VTDecompressionSession.cs @@ -29,6 +29,7 @@ internal VTDecompressionSession (NativeHandle handle, bool owns) : base (handle, { } + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTMotionEstimationSession.cs b/src/VideoToolbox/VTMotionEstimationSession.cs index c397212e4e85..7582391bfcaf 100644 --- a/src/VideoToolbox/VTMotionEstimationSession.cs +++ b/src/VideoToolbox/VTMotionEstimationSession.cs @@ -25,6 +25,7 @@ internal VTMotionEstimationSession (NativeHandle handle, bool owns) { } + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTMultiPassStorage.cs b/src/VideoToolbox/VTMultiPassStorage.cs index a1c3d27d6caa..93078262eaee 100644 --- a/src/VideoToolbox/VTMultiPassStorage.cs +++ b/src/VideoToolbox/VTMultiPassStorage.cs @@ -29,7 +29,7 @@ internal VTMultiPassStorage (NativeHandle handle, bool owns) { } - /// + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTPixelRotationSession.cs b/src/VideoToolbox/VTPixelRotationSession.cs index f6ff8724d195..7bffad0efdf1 100644 --- a/src/VideoToolbox/VTPixelRotationSession.cs +++ b/src/VideoToolbox/VTPixelRotationSession.cs @@ -32,6 +32,7 @@ internal VTPixelRotationSession (NativeHandle handle, bool owns) : base (handle, [DllImport (Constants.VideoToolboxLibrary)] extern static void VTPixelRotationSessionInvalidate (/* VTPixelRotationSessionRef */ IntPtr session); + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTPixelTransferSession.cs b/src/VideoToolbox/VTPixelTransferSession.cs index 3fa5b7ceecf2..f1bfd6a35da8 100644 --- a/src/VideoToolbox/VTPixelTransferSession.cs +++ b/src/VideoToolbox/VTPixelTransferSession.cs @@ -32,6 +32,7 @@ internal VTPixelTransferSession (NativeHandle handle, bool owns) : base (handle, [DllImport (Constants.VideoToolboxLibrary)] extern static void VTPixelTransferSessionInvalidate (/* VTPixelTransferSessionRef */ IntPtr session); + /// protected override void Dispose (bool disposing) { if (Handle != IntPtr.Zero) diff --git a/src/VideoToolbox/VTRawProcessingSession.cs b/src/VideoToolbox/VTRawProcessingSession.cs index 334720681b79..251f74de6615 100644 --- a/src/VideoToolbox/VTRawProcessingSession.cs +++ b/src/VideoToolbox/VTRawProcessingSession.cs @@ -84,8 +84,7 @@ public void Invalidate () VTRAWProcessingSessionInvalidate (GetCheckedHandle ()); } - /// Dispose of this instance. - /// This will also call . + /// protected override void Dispose (bool disposing) { if (disposing) diff --git a/src/WatchConnectivity/WCEnums.cs b/src/WatchConnectivity/WCEnums.cs index c51b2c2f4600..9d00ed5a6522 100644 --- a/src/WatchConnectivity/WCEnums.cs +++ b/src/WatchConnectivity/WCEnums.cs @@ -44,7 +44,7 @@ public enum WCErrorCode : long { /// Indicates that the receiver did not have enough storage to receive the payload. InsufficientSpace = 7015, // iOS 9.3 / watchOS 2.2 - /// Indicates taht the session was not active. + /// Indicates that the session was not active. SessionInactive = 7016, /// Indicates that the transfer timed out. TransferTimedOut = 7017, diff --git a/src/appkit.cs b/src/appkit.cs index bfa6fd5a5099..d44bfe13ffec 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -29257,18 +29257,22 @@ partial interface NSTextInputContext { } partial interface NSToolbarItemEventArgs { - /// To be added. - /// To be added. - /// To be added. - [Export ("item")] + /// Gets the toolbar item associated with the notification. + /// The toolbar item that will be added to or has been removed from the toolbar. + /// This value is read from the notification's userInfo dictionary using . + [Export ("NSToolbarItemKey")] NSToolbarItem Item { get; } } partial interface NSToolbar { + /// Notification posted when a toolbar is about to add an item. + /// The notification payload can be accessed using . [Notification (typeof (NSToolbarItemEventArgs))] [Field ("NSToolbarWillAddItemNotification")] NSString NSToolbarWillAddItemNotification { get; } + /// Notification posted after a toolbar removes an item. + /// The notification payload can be accessed using . [Notification (typeof (NSToolbarItemEventArgs))] [Field ("NSToolbarDidRemoveItemNotification")] NSString NSToolbarDidRemoveItemNotification { get; } diff --git a/src/audiounit.cs b/src/audiounit.cs index e5b05ed9f446..8d7b5a03da77 100644 --- a/src/audiounit.cs +++ b/src/audiounit.cs @@ -441,7 +441,7 @@ AUParameterTree ParameterTree { [Export ("renderQuality", ArgumentSemantic.Assign)] nint RenderQuality { get; set; } - /// Gets or sets a Boolean value that contols whether an effect should skip processing and go directly to the output. + /// Gets or sets a Boolean value that controls whether an effect should skip processing and go directly to the output. /// To be added. /// To be added. [Export ("shouldBypassEffect")] @@ -819,7 +819,7 @@ interface AUAudioUnitBus { /// Gets or sets the latency of the processing context for the audio unit. /// To be added. - /// For input units, this is the time, in seconds, since the arriving audio was acquired. For ouput units, this is the delay, in seconds, until the output is presented. + /// For input units, this is the time, in seconds, since the arriving audio was acquired. For output units, this is the delay, in seconds, until the output is presented. [Export ("contextPresentationLatency")] double ContextPresentationLatency { get; set; } @@ -878,8 +878,8 @@ interface AUAudioUnitBusArray : INSFastEnumeration { // -(AUAudioUnitBus * __nonnull)objectAtIndexedSubscript:(NSUInteger)index; /// The zero-based index into the bus array of the desired bus. - /// Returns the bus at the spcified location in the array. - /// The bus at the spcified location in the array. + /// Returns the bus at the specified location in the array. + /// The bus at the specified location in the array. /// To be added. [Export ("objectAtIndexedSubscript:")] AUAudioUnitBus GetObject (nuint index); diff --git a/src/avfoundation.cs b/src/avfoundation.cs index b3c96d92db88..1b3cae88f0ac 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -1746,7 +1746,7 @@ interface AVAudioFormat : NSSecureCoding { [Export ("isEqual:"), Internal] bool IsEqual (NSObject obj); - /// Gets a specialized descripter, if required, that is needed to decompress the audio data. + /// Gets a specialized descriptor, if required, that is needed to decompress the audio data. /// /// (More documentation for this node is coming) /// This value can be . @@ -2671,7 +2671,7 @@ interface AVAudioRecorder { /// To be added. /// /// This method creates or erases a file for recording. - /// The method will call this method if ncessary, but application developers may choose to explicitly call it in order to minimize startup lag. + /// The method will call this method if necessary, but application developers may choose to explicitly call it in order to minimize startup lag. /// [Export ("prepareToRecord")] bool PrepareToRecord (); @@ -16110,7 +16110,7 @@ interface AVCaptureFileOutput { /// A delegate object that allows the application developer to respond to events in a object. /// - /// As with many AV Foundation methods, starting, stop, and pause commands are asynchronous and it is only here, in the delegate objet, that one can rely on the state of the underlying capture. + /// As with many AV Foundation methods, starting, stop, and pause commands are asynchronous, and it is only here, in the delegate object, that one can rely on the state of the underlying capture. /// /// Apple documentation for AVCaptureFileOutputRecordingDelegate [BaseType (typeof (NSObject))] @@ -17334,7 +17334,7 @@ interface AVCaptureStillImageOutput { [Export ("automaticallyEnablesStillImageStabilizationWhenAvailable")] bool AutomaticallyEnablesStillImageStabilizationWhenAvailable { get; set; } - /// Indicates whether image stabilzation is currently active for the current capture session. + /// Indicates whether image stabilization is currently active for the current capture session. /// To be added. /// To be added. [NoMac] diff --git a/src/avkit.cs b/src/avkit.cs index 9d10667e070b..fc52d71d63ea 100644 --- a/src/avkit.cs +++ b/src/avkit.cs @@ -961,7 +961,7 @@ interface AVRoutePickerView { /// Initializes the AVRoutePickerView with the specified frame. /// /// This constructor is used to programmatically create a new instance of AVRoutePickerView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/callkit.cs b/src/callkit.cs index 39b35106609b..2ffc411d8033 100644 --- a/src/callkit.cs +++ b/src/callkit.cs @@ -64,7 +64,7 @@ public enum CXErrorCodeIncomingCallError : long { [ErrorDomain ("CXErrorDomainRequestTransaction")] [Native] public enum CXErrorCodeRequestTransactionError : long { - /// An unknown error occured. + /// An unknown error occurred. Unknown = 0, /// To be added. Unentitled = 1, @@ -89,7 +89,7 @@ public enum CXErrorCodeRequestTransactionError : long { [ErrorDomain ("CXErrorDomainCallDirectoryManager")] [Native] public enum CXErrorCodeCallDirectoryManagerError : long { - /// An unknown error occured. + /// An unknown error occurred. Unknown = 0, /// The extension could not be found. NoExtensionFound = 1, @@ -287,7 +287,7 @@ interface CXCallAction { NativeHandle Constructor (NSUuid callUuid); } - /// Informs the system about in-band user actions, such as reqeusts to start a call, or to put a call on hold. + /// Informs the system about in-band user actions, such as requests to start a call or put a call on hold. /// /// Apple documentation for CXCallController [NoMac] diff --git a/src/carplay.cs b/src/carplay.cs index 3d604b44538d..a1a086e390ae 100644 --- a/src/carplay.cs +++ b/src/carplay.cs @@ -1610,7 +1610,7 @@ interface CPSearchTemplateDelegate { /// To be added. /// To be added. /// To be added. - /// Developers must overrride this method to respond to a search selection. + /// Developers must override this method to respond to a search selection. /// To be added. [Abstract] [Export ("searchTemplate:selectedResult:completionHandler:")] diff --git a/src/classkit.cs b/src/classkit.cs index 8b4a3746cab4..0bded3971fd6 100644 --- a/src/classkit.cs +++ b/src/classkit.cs @@ -531,7 +531,7 @@ interface CLSDataStore { [Async (XmlDocs = """ The identifier paths for the contexts to find. - Finds the contexts identifed by a set of identifier paths and returns a task that contains the reults. + Finds the contexts identified by a set of identifier paths and returns a task that contains the results. A task that contains the search results To be added. """)] diff --git a/src/coreanimation.cs b/src/coreanimation.cs index a8195ca8b8bf..c252385eeeb5 100644 --- a/src/coreanimation.cs +++ b/src/coreanimation.cs @@ -219,7 +219,7 @@ interface CAConstraint : NSSecureCoding { interface CADisplayLink { /// Target object to invoke the selector on. /// Selector to invoke. - /// Objective-C style registeration of the method to be invoked every time the display is about to be updated. + /// Objective-C style registration of the method to be invoked every time the display is about to be updated. /// The DisplayLink object that will invoke the specified method on each screen update. /// /// @@ -1615,7 +1615,7 @@ interface CAReplicatorLayer { /// Apple documentation for CAScrollLayer [BaseType (typeof (CALayer))] interface CAScrollLayer { - /// Creates a new sroll layer with default values. + /// Creates a new scroll layer with default values. /// To be added. /// To be added. [Export ("layer"), New, Static] @@ -3259,7 +3259,7 @@ interface CAEmitterCell : CAMediaTiming, NSSecureCoding { [Export ("enabled")] bool Enabled { [Bind ("isEnabled")] get; set; } - /// Gets or sets the frequeny, in Hz, at which particles are emitted. + /// Gets or sets the frequency, in Hz, at which particles are emitted. /// To be added. /// To be added. [Export ("birthRate")] diff --git a/src/coreaudiokit.cs b/src/coreaudiokit.cs index 4730f412f58b..73b7fa30c10f 100644 --- a/src/coreaudiokit.cs +++ b/src/coreaudiokit.cs @@ -252,7 +252,7 @@ interface CAInterAppAudioSwitcherView { /// Initializes the CAInterAppAudioSwitcherView with the specified frame. /// /// This constructor is used to programmatically create a new instance of CAInterAppAudioSwitcherView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect bounds); @@ -283,7 +283,7 @@ interface CAInterAppAudioTransportView { /// Initializes the CAInterAppAudioTransportView with the specified frame. /// /// This constructor is used to programmatically create a new instance of CAInterAppAudioTransportView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect bounds); diff --git a/src/coredata.cs b/src/coredata.cs index fd3862017230..1b57e2b55402 100644 --- a/src/coredata.cs +++ b/src/coredata.cs @@ -18,7 +18,7 @@ namespace CoreData { /// To be added. [StrongDictionary ("UserInfoKeys")] interface UserInfo { - /// Gets or sets an array that contains the multiple erros that occurred, if multiple errors occurred. + /// Gets or sets an array that contains the multiple errors that occurred, if multiple errors occurred. /// An array of objects that contains the errors that occurred. /// To be added. NSError [] DetailedErrors { get; set; } @@ -53,7 +53,7 @@ interface UserInfo { [Static] interface UserInfoKeys { /// To be added. - /// A key that identifies an array of objects that contains the errors that occured. + /// A key that identifies an array of objects that contains the errors that occurred. /// /// This key corresponds to the property. /// @@ -896,7 +896,7 @@ interface NSFetchRequestExpression { [Export ("initWithExpressionType:")] NativeHandle Constructor (NSExpressionType type); - /// The expression from which to create a new fetch request expresssion. + /// The expression from which to create a new fetch request expression. /// The context in which to create the fetch request expression. /// Whether to create a fetch request expression that counts the matches, rather than returning them. /// Creates a new from the specified expression and context. @@ -1228,7 +1228,7 @@ interface NSFetchedResultsController { NSIndexPath FromObject (NSObject obj); /// To be added. - /// Returns the obect that is located at the specified index . + /// Returns the object that is located at the specified index . /// To be added. /// To be added. [Export ("objectAtIndexPath:")] @@ -1408,7 +1408,7 @@ interface NSIncrementalStore { /// To be added. /// To be added. /// To be added. - /// Returns a for the persisten external values of the identified object and reports any errors in . + /// Returns a for the persistent external values of the identified object and reports any errors in . /// To be added. /// To be added. [Export ("newValuesForObjectWithID:withContext:error:")] @@ -1439,7 +1439,7 @@ interface NSIncrementalStore { /// To be added. /// To be added. - /// Returns an array of permanent identfiers for the provides newly-inserted objects and reports any errors in . + /// Returns an array of permanent identifiers for the provided newly inserted objects and reports any errors in . /// To be added. /// To be added. [Export ("obtainPermanentIDsForObjects:error:")] @@ -1581,7 +1581,7 @@ interface NSManagedObject : NSFetchRequestResult { [Export ("entity", ArgumentSemantic.Strong)] NSEntityDescription Entity { get; } - /// Gets the object identifer. + /// Gets the object identifier. /// To be added. /// This value changes when an unsaved object is saved. [Export ("objectID", ArgumentSemantic.Strong)] @@ -2116,7 +2116,7 @@ interface NSManagedObjectContext : NSCoding /// To be added. /// To be added. - /// Converts the objec identifiers to permanent identifiers for the provided . Returns if all of the identifiers were converted. + /// Converts the object identifiers to permanent identifiers for the provided . Returns if all of the identifiers were converted. /// To be added. /// To be added. [Export ("obtainPermanentIDsForObjects:error:")] @@ -2213,7 +2213,7 @@ interface NSManagedObjectContext : NSCoding [return: NullAllowed] NSManagedObject GetExistingObject (NSManagedObjectID objectID, out NSError error); - /// Gets or sets a Boolean value that controls whether inaccessible faults wil be deleted. + /// Gets or sets a Boolean value that controls whether inaccessible faults will be deleted. /// To be added. /// To be added. [MacCatalyst (13, 1)] @@ -2226,7 +2226,7 @@ interface NSManagedObjectContext : NSCoding /// To be added. /// This parameter can be . /// - /// Returns a Boolean value that controls whether inaccessible faults wil be handled. + /// Returns a Boolean value that controls whether inaccessible faults will be handled. /// To be added. /// To be added. [MacCatalyst (13, 1)] @@ -2242,7 +2242,7 @@ interface NSManagedObjectContext : NSCoding [Export ("mergeChangesFromRemoteContextSave:intoContexts:")] void MergeChangesFromRemoteContextSave (NSDictionary changeNotificationData, NSManagedObjectContext [] contexts); - /// Gets the token that identifes the current query generation behavior. + /// Gets the token that identifies the current query generation behavior. /// /// (More documentation for this node is coming) /// This value can be . @@ -3856,7 +3856,7 @@ partial interface NSPersistentStoreCoordinator [Export ("initWithManagedObjectModel:")] NativeHandle Constructor (NSManagedObjectModel model); - /// Gets the managed objec model for the receiver. + /// Gets the managed object model for the receiver. /// To be added. /// To be added. [Export ("managedObjectModel", ArgumentSemantic.Strong)] @@ -4446,7 +4446,7 @@ interface NSBatchUpdateResult { NSBatchUpdateRequestResultType ResultType { get; } } - /// Class that represents the results of an aysnchronous request that was made of a persistent data store. + /// Class that represents the results of an asynchronous request that was made of a persistent data store. /// To be added. /// Apple documentation for NSPersistentStoreAsynchronousResult [MacCatalyst (13, 1)] @@ -5392,4 +5392,3 @@ interface NSCustomMigrationStage { NativeHandle Constructor (NSManagedObjectModelReference currentModel, NSManagedObjectModelReference nextModel); } } - diff --git a/src/coreimage.cs b/src/coreimage.cs index 34c5d7af0054..ed0494ca9dc2 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -1087,7 +1087,7 @@ interface CIFilter : NSSecureCoding, NSCopying { /// /// Each filter has a set of attributes that control it. You can /// get this list by requesting the Attributes dictionary from the - /// filter. Each fitler, in addition to having a series of + /// filter. Each filter, in addition to having a series of /// configurable properties always includes its name /// ("CIAttributeFilterName" key), a user friendly name /// ("CIAttributeFilterDisplayName" key) and a list of categories @@ -1132,7 +1132,7 @@ string Name { /// To be added. /// This parameter can be . /// - /// Returns an array of strings that specifies the filters taht the system provides for the specified . + /// Returns an array of strings that specifies the filters that the system provides for the specified . /// To be added. /// To be added. [Static] @@ -1691,7 +1691,7 @@ interface CIRawFilterKeys { interface CIRawFilterOptions { /// - /// if draft mode shoud be allowed. (Switching this key is an expensive operation.) + /// if draft mode should be allowed. (Switching this key is an expensive operation.) /// To be added. /// To be added. [MacCatalyst (13, 1)] @@ -5188,7 +5188,7 @@ interface CIVector : NSSecureCoding, NSCopying { NativeHandle Constructor (CGRect r); /// To be added. - /// Creates a new CIVector by flattening the six values in an affine transform into the first six posistions in the new CIVector. + /// Creates a new CIVector by flattening the six values in an affine transform into the first six positions in the new CIVector. /// To be added. [MacCatalyst (13, 1)] [Export ("initWithCGAffineTransform:")] @@ -5561,7 +5561,7 @@ interface CIFaceFeature { bool RightEyeClosed { get; } } - /// A an image space rectange that contains a detected physical rectangle. + /// A describing an image-space rectangle that contains a detected physical rectangle. /// /// Apple documentation for CIRectangleFeature [MacCatalyst (13, 1)] @@ -5715,7 +5715,7 @@ interface CIImageProcessorKernel { /// Developers should set this as necessary. /// Developers should override this method to perform custom processing on the . /// - /// if the processing completed successfuly. + /// if the processing completed successfully. /// To be added. [Static] [Export ("processWithInputs:arguments:output:error:")] @@ -7088,7 +7088,7 @@ interface CILightTunnelProtocol : CIFilterProtocol { [Export ("center", ArgumentSemantic.Assign)] CGPoint InputCenter { get; set; } - /// Gets or sets the initial anlge of the image sample. + /// Gets or sets the initial angle of the image sample. /// To be added. /// To be added. [Abstract] @@ -10923,14 +10923,14 @@ interface CIHighlightShadowAdjustProtocol : CIFilterProtocol { [Export ("radius")] float Radius { get; set; } - /// Gets or sets a value in the range [0,1] that contols by how much to brighten shaded areas. + /// Gets or sets a value in the range [0,1] that controls how much to brighten shaded areas. /// To be added. /// To be added. [Abstract] [Export ("shadowAmount")] float ShadowAmount { get; set; } - /// Gets or sets a value in the range [0,1] that contols by how much to dampen highlights. + /// Gets or sets a value in the range [0,1] that controls how much to dampen highlights. /// To be added. /// To be added. [Abstract] @@ -11741,7 +11741,7 @@ interface CIPdf417BarcodeGeneratorProtocol : CIFilterProtocol { [Export ("compactionMode")] float InputCompactionMode { get; set; } - /// Gets or sets an integer with Boolean semantics that controls whether redunant elements should be omitted to save space. 1 is true. 0 is false. + /// Gets or sets an integer with Boolean semantics that controls whether redundant elements should be omitted to save space. 1 is true. 0 is false. [Abstract] [Export ("compactStyle")] float InputCompactStyle { get; set; } diff --git a/src/corelocation.cs b/src/corelocation.cs index 2f189e60f951..efcdaabe4271 100644 --- a/src/corelocation.cs +++ b/src/corelocation.cs @@ -402,7 +402,7 @@ partial interface CLLocationManager { [Export ("locationServicesEnabled"), Static] bool LocationServicesEnabled { get; } - /// The minimum change in heading, in degreees, necessary to generate a location update. + /// The minimum change in heading, in degrees, necessary to generate a location update. /// The default value is 1 (degree). /// To be added. [NoTV] @@ -1180,7 +1180,7 @@ interface CLPlacemark : NSSecureCoding, NSCopying { [NullAllowed, Export ("ISOcountryCode")] string IsoCountryCode { get; } - /// An array of relevant areas of interest (large parks, miltary bases, attractions, etc). + /// An array of relevant areas of interest (large parks, military bases, attractions, etc). /// To be added. /// To be added. [NullAllowed, Export ("areasOfInterest")] @@ -1556,7 +1556,7 @@ interface CLGeocoder { """)] void GeocodeAddress (NSDictionary addressDictionary, CLGeocodeCompletionHandler completionHandler); - /// Adress that you want to submit. + /// Address that you want to submit. /// Method to invoke when the request completes. /// Request a latitude/longitude location from a human readable address. /// @@ -1590,7 +1590,7 @@ interface CLGeocoder { """)] void GeocodeAddress (string addressString, CLGeocodeCompletionHandler completionHandler); - /// Adress that you want to submit. + /// Address that you want to submit. /// Region to limit the lookup for. /// Method to invoke when the request completes. /// Request a latitude/longitude location from a human readable address and region. diff --git a/src/corespotlight.cs b/src/corespotlight.cs index 8d03ed1c8b37..a06651792445 100644 --- a/src/corespotlight.cs +++ b/src/corespotlight.cs @@ -2380,7 +2380,7 @@ interface CSSearchableItemAttributeSet : NSCopying, NSSecureCoding { [NullAllowed, Export ("containerDisplayName")] string ContainerDisplayName { get; set; } - /// Gets or sets the identifer of the item's container. + /// Gets or sets the identifier of the item's container. /// /// (More documentation for this node is coming) /// This value can be . diff --git a/src/eventkit.cs b/src/eventkit.cs index 4c32906873e6..a949496388a8 100644 --- a/src/eventkit.cs +++ b/src/eventkit.cs @@ -433,7 +433,7 @@ interface EKParticipant : NSCopying { NSPredicate ContactPredicate { get; } } - /// Represents how the EKRecurrence ends. Either by number of ocurrences or using a specific date. + /// Represents how the EKRecurrence ends, either by number of occurrences or by using a specific date. /// /// Apple documentation for EKRecurrenceEnd [BaseType (typeof (NSObject))] diff --git a/src/foundation.cs b/src/foundation.cs index e0d86eb00f09..83e5cd5bfc65 100644 --- a/src/foundation.cs +++ b/src/foundation.cs @@ -136,7 +136,7 @@ namespace Foundation { namespace Foundation { /// To be added. /// To be added. - /// A delegate that defines the comparison function to be used with functins such as . + /// A delegate that defines the comparison function to be used with functions such as . /// To be added. /// To be added. delegate NSComparisonResult NSComparator (NSObject obj1, NSObject obj2); @@ -2235,7 +2235,7 @@ interface NSCoder { /// Low-level: decodes the item with the associated key into a memory block, /// and returns a pointer to it. /// Pointer to the block of memory that contains at least - /// the number of bytes set on the lenght parameter. + /// the number of bytes set on the length parameter. /// /// [Export ("decodeBytesForKey:returnedLength:")] @@ -2245,7 +2245,7 @@ interface NSCoder { /// Low-level: decodes the next item into a memory block, /// and returns a pointer to it. /// Pointer to the block of memory that contains at least - /// the number of bytes set on the lenght parameter. + /// the number of bytes set on the length parameter. /// /// [Export ("decodeBytesWithReturnedLength:")] @@ -7986,7 +7986,7 @@ interface NSUserDefaults { /// /// /// - /// // Retrieve the gloabl NSButtonDelay setting on MacOS: + /// // Retrieve the global NSButtonDelay setting on macOS: /// var global = new NSUserDefaults (NSUserDefaults.GlobalDomain); /// Console.WriteLine ("Delay: " + j.FloatForKey ("NSButtonDelay")); /// @@ -7995,7 +7995,7 @@ interface NSUserDefaults { [Field ("NSGlobalDomain")] NSString GlobalDomain { get; } - /// This is they key used to retrieve the domain associated with the command line arguments passed at startup. + /// This is the key used to retrieve the domain associated with the command line arguments passed at startup. /// /// /// @@ -8012,7 +8012,7 @@ interface NSUserDefaults { /// /// /// - /// // Retrieve the gloabl NSButtonDelay setting on MacOS: + /// // Retrieve the global NSButtonDelay setting on macOS: /// var global = new NSUserDefaults (NSUserDefaults.GlobalDomain); /// Console.WriteLine ("Delay: " + j.FloatForKey ("NSButtonDelay")); /// @@ -12603,7 +12603,7 @@ interface NSStringDrawingContext { [Export ("minimumScaleFactor")] nfloat MinimumScaleFactor { get; set; } - /// Desired tracking adjustement (minimum space to maintain between characteres) desired to be used during the drawing operation. + /// Desired tracking adjustment (minimum space to maintain between characters) to be used during the drawing operation. /// The value is specified in points, typically a value between -0.5f and 0. /// Zero means that standard spacing should be used. Use negative values to adjust the tracking, for example -0.5f allows characters to be closer together by half a point. [NoTV] diff --git a/src/gamekit.cs b/src/gamekit.cs index 5f59ca68c824..ed2a9c4f654e 100644 --- a/src/gamekit.cs +++ b/src/gamekit.cs @@ -1581,7 +1581,7 @@ interface GKMatchDelegate { /// To be added. /// To be added. /// To be added. - /// Method that is called when the recieves data from another . + /// Method that is called when the receives data from another . /// To be added. [MacCatalyst (13, 1)] [Export ("match:didReceiveData:forRecipient:fromRemotePlayer:"), EventArgs ("GKDataReceivedForRecipient", XmlDocs = """ @@ -2257,7 +2257,7 @@ string PlayerID { [Async (XmlDocs = """ To be added. To be added. - Asychronously reports the provided achievements and challenges to Game Center. + Asynchronously reports the provided achievements and challenges to Game Center. To be added. To be added. """)] diff --git a/src/glkit.cs b/src/glkit.cs index 6d9f1b57d428..9d70fa9313a6 100644 --- a/src/glkit.cs +++ b/src/glkit.cs @@ -683,7 +683,7 @@ interface GLKTextureInfo : NSCopying { uint Depth { get; } } - /// The infromation about the texture loaded, or null on error. + /// The information about the texture loaded, or null on error. /// On success, this value is null. Otherwise it contains the error information. /// Signature used by the asynchrous texture loading methods in . delegate void GLKTextureLoaderCallback ([NullAllowed] GLKTextureInfo textureInfo, [NullAllowed] NSError error); @@ -1092,7 +1092,7 @@ interface GLKView { /// Initializes the GLKView with the specified frame. /// /// This constructor is used to programmatically create a new instance of GLKView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/healthkit.cs b/src/healthkit.cs index 2a62320caa15..4ac53aad6eee 100644 --- a/src/healthkit.cs +++ b/src/healthkit.cs @@ -2831,7 +2831,7 @@ enum HKQuantityTypeIdentifier { [Field ("HKQuantityTypeIdentifierBodyFatPercentage")] BodyFatPercentage, - /// Indicates a height measurment. + /// Indicates a height measurement. [Field ("HKQuantityTypeIdentifierHeight")] Height, @@ -3395,7 +3395,7 @@ enum HKCategoryTypeIdentifier { [Field ("HKCategoryTypeIdentifierSexualActivity")] SexualActivity, - /// Indicates a category whose value idicates the user's mindfulness session. + /// Indicates a category whose value indicates the user's mindfulness session. [MacCatalyst (13, 1)] [Field ("HKCategoryTypeIdentifierMindfulSession")] MindfulSession, @@ -4860,7 +4860,7 @@ interface HKActivitySummaryQuery { NativeHandle Constructor ([NullAllowed] NSPredicate predicate, Action handler); } - /// Obect that is used to request permission to read objects. + /// Object that is used to request permission to read objects. /// Developers use the method. /// Apple documentation for HKActivitySummaryType [MacCatalyst (13, 1)] @@ -5061,7 +5061,7 @@ interface HKWorkoutBuilder { [Async (XmlDocs = """ The date and time the workout starts. - Starts the workout at the sepcified time, begins collecting workout data, and returns a task that contains a success status and any error that occurred. + Starts the workout at the specified time, begins collecting workout data, and returns a task that contains a success status and any error that occurred. A task that contains a success status and any error that occurred. To be added. """)] @@ -5111,8 +5111,8 @@ interface HKWorkoutBuilder { [Async (XmlDocs = """ The end time of the workout. - Ends the workout and returns a task that contains a success status and any error that occured. - A task that contains a success status and any error that occured. + Ends the workout and returns a task that contains a success status and any error that occurred. + A task that contains a success status and any error that occurred. To be added. """)] [Export ("endCollectionWithEndDate:completion:")] diff --git a/src/healthkitui.cs b/src/healthkitui.cs index 58597bdb8047..c8115add86cc 100644 --- a/src/healthkitui.cs +++ b/src/healthkitui.cs @@ -17,7 +17,7 @@ interface HKActivityRingView { /// Initializes the HKActivityRingView with the specified frame. /// /// This constructor is used to programmatically create a new instance of HKActivityRingView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [DesignatedInitializer] [Export ("initWithFrame:")] diff --git a/src/homekit.cs b/src/homekit.cs index 76a96600dc2c..7dfeeb07a413 100644 --- a/src/homekit.cs +++ b/src/homekit.cs @@ -2258,7 +2258,7 @@ interface HMCameraView { /// Initializes the HMCameraView with the specified frame. /// /// This constructor is used to programmatically create a new instance of HMCameraView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/intents.cs b/src/intents.cs index 7ed56e07a10f..f8b40a2663eb 100644 --- a/src/intents.cs +++ b/src/intents.cs @@ -392,7 +392,7 @@ public enum INIntentErrorCode : long { InvalidUserVocabularyFileLocation = 4000, /// The extension timed out. ExtensionLaunchingTimeout = 5000, - /// An error occurred while tryig to start communication with an extension. + /// An error occurred while trying to start communication with an extension. ExtensionBringUpFailed = 5001, /// To be added. ImageGeneric = 6000, @@ -794,7 +794,7 @@ public enum INRequestPaymentIntentResponseCode : long { FailurePaymentsCurrencyUnsupported, /// Developers should use this code to indicate a failure because no bank account is configured. FailureNoBankAccount, - /// Developers should use this code to indicate a failure because the user is not eligible to either send or recieve funds via money transfer. + /// Developers should use this code to indicate a failure because the user is not eligible to either send or receive funds via money transfer. [NoMac] [MacCatalyst (13, 1)] FailureNotEligible, @@ -1930,7 +1930,7 @@ public enum INLocationSearchType : long { [MacCatalyst (13, 1)] [Native] public enum INMessageType : long { - /// Inidcates unspecified content. + /// Indicates unspecified content. Unspecified = 0, /// Indicates text. Text, diff --git a/src/mapkit.cs b/src/mapkit.cs index b74e61880d95..993faa6fd4c0 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -124,7 +124,7 @@ interface MKAnnotationView { /// Initializes the MKAnnotationView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKAnnotationView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -291,7 +291,7 @@ interface MKCircleView { /// Initializes the MKCircleView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKCircleView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -531,7 +531,7 @@ interface MKMapView { /// Initializes the MKMapView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKMapView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -1194,7 +1194,7 @@ interface MKPinAnnotationView { /// Initializes the MKPinAnnotationView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKPinAnnotationView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -1421,7 +1421,7 @@ interface MKOverlayView { /// Initializes the MKOverlayView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKOverlayView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -1490,7 +1490,7 @@ interface MKOverlayPathView { /// Initializes the MKOverlayPathView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKOverlayPathView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -1596,7 +1596,7 @@ interface MKPolygonView { /// Initializes the MKPolygonView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKPolygonView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -1680,7 +1680,7 @@ interface MKPolylineView { /// Initializes the MKPolylineView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MKPolylineView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -2618,7 +2618,7 @@ interface MKLocalSearchCompleterDelegate { void DidUpdateResults (MKLocalSearchCompleter completer); /// The search completer to which this delegate belongs. - /// The error that occured. + /// The error that occurred. /// The search completer encountered an error while searching for completions. /// To be added. [Export ("completer:didFailWithError:")] diff --git a/src/mediaplayer.cs b/src/mediaplayer.cs index 9fb399c9fca2..eac5a44edea6 100644 --- a/src/mediaplayer.cs +++ b/src/mediaplayer.cs @@ -2246,7 +2246,7 @@ interface MPMusicPlayerController : MPMediaPlayback { NSString VolumeDidChangeNotification { get; } } - /// A that presents a slider control used to set the system output volume.. + /// A that presents a slider control used to set the system output volume. /// To be added. /// Apple documentation for MPVolumeView [NoMac] @@ -2258,7 +2258,7 @@ interface MPVolumeView { /// Initializes the MPVolumeView with the specified frame. /// /// This constructor is used to programmatically create a new instance of MPVolumeView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/metalperformanceshaders.cs b/src/metalperformanceshaders.cs index 7a3bb42b63e1..a1981f80656f 100644 --- a/src/metalperformanceshaders.cs +++ b/src/metalperformanceshaders.cs @@ -936,7 +936,7 @@ interface MPSImageDilate { NativeHandle Constructor (NSCoder aDecoder, IMTLDevice device); } - /// Finds the mininum value in a region, offset by a corresponding value in a mask. + /// Finds the minimum value in a region, offset by a corresponding value in a mask. /// /// Apple documentation for MPSImageErode [MacCatalyst (13, 1)] @@ -3446,7 +3446,7 @@ interface MPSMatrixDescriptor { [Export ("rows")] nuint Rows { get; set; } - /// Gets the nubmer of columns that are in the matrix. + /// Gets the number of columns that are in the matrix. /// To be added. /// To be added. [Export ("columns")] @@ -3551,7 +3551,7 @@ interface MPSMatrix { [Export ("rows")] nuint Rows { get; } - /// Gets the nubmer of columns that are in the matrix. + /// Gets the number of columns that are in the matrix. /// To be added. /// To be added. [Export ("columns")] diff --git a/src/multipeerconnectivity.cs b/src/multipeerconnectivity.cs index ee8aa60276ac..cded5771adfb 100644 --- a/src/multipeerconnectivity.cs +++ b/src/multipeerconnectivity.cs @@ -441,7 +441,7 @@ partial interface MCNearbyServiceBrowser { [Export ("initWithPeer:serviceType:")] NativeHandle Constructor (MCPeerID myPeerID, string serviceType); - /// Starts browing for local peers advertising for the . + /// Starts browsing for local peers advertising for the . /// To be added. [Export ("startBrowsingForPeers")] void StartBrowsingForPeers (); diff --git a/src/naturallanguage.cs b/src/naturallanguage.cs index fab1e5436233..8a37cfecd707 100644 --- a/src/naturallanguage.cs +++ b/src/naturallanguage.cs @@ -330,8 +330,8 @@ interface NLTagger { /// A character index for the desired range. /// The unit, which covers the , whose range to get. - /// Returns the lexical range of the that contains the spcified . - /// The lexical range of the that contains the spcified . + /// Returns the lexical range of the that contains the specified . + /// The lexical range of the that contains the specified . /// To be added. [Export ("tokenRangeAtIndex:unit:")] NSRange GetTokenRange (nuint characterIndex, NSString unit); diff --git a/src/networkextension.cs b/src/networkextension.cs index f5e4ab06a500..91488a348235 100644 --- a/src/networkextension.cs +++ b/src/networkextension.cs @@ -611,7 +611,7 @@ interface NEAppRule : NSSecureCoding, NSCopying { [NullAllowed, Export ("matchPath")] string MatchPath { get; set; } - /// Gets the siging identifer of the app that the rule matched. + /// Gets the signing identifier of the app that the rule matched. /// To be added. /// To be added. [Export ("matchSigningIdentifier")] @@ -2634,7 +2634,7 @@ interface NEVpnIke2SecurityAssociationParameters : NSSecureCoding, NSCopying { [Export ("diffieHellmanGroup")] NEVpnIke2DiffieHellman DiffieHellmanGroup { get; set; } - /// Gets or sets the Security Association's lifetime, in mintues. + /// Gets or sets the Security Association's lifetime, in minutes. /// To be added. /// To be added. [Export ("lifetimeMinutes")] diff --git a/src/passkit.cs b/src/passkit.cs index 5ff76d9ebd8f..ce4638a9f96e 100644 --- a/src/passkit.cs +++ b/src/passkit.cs @@ -2121,8 +2121,8 @@ interface PKPaymentAuthorizationController { bool CanMakePayments { get; } /// To be added. - /// Gets a value that tells wether the user can make payments in at least one of the specified . - /// A value that tells wether the user can make payments in at least one of the specified . + /// Gets a value that tells whether the user can make payments in at least one of the specified . + /// A value that tells whether the user can make payments in at least one of the specified . /// To be added. [Static] [Export ("canMakePaymentsUsingNetworks:")] @@ -2130,8 +2130,8 @@ interface PKPaymentAuthorizationController { /// To be added. /// To be added. - /// Gets a value that tells wether the user can make payments in at least one of the specified with the specified . - /// A value that tells wether the user can make payments in at least one of the specified with the specified . + /// Gets a value that tells whether the user can make payments in at least one of the specified with the specified . + /// A value that tells whether the user can make payments in at least one of the specified with the specified . /// To be added. [Static] [Export ("canMakePaymentsUsingNetworks:capabilities:")] @@ -2303,7 +2303,7 @@ interface PKPaymentAuthorizationControllerDelegate { /// The controller that owns this delegate. /// The payment method that was selected. /// A handler that takes a list of updated payment summary items. - /// Mehod that is called when the user selects a payment method. + /// Method that is called when the user selects a payment method. /// To be added. [NoMac] [Deprecated (PlatformName.iOS, 11, 0, message: "Use 'DidSelectPaymentMethod' overload with the 'Action' parameter instead.")] @@ -2643,14 +2643,14 @@ interface PKPaymentRequestPaymentMethodUpdate { [Static] // not to enum'ify - exposed as NSString inside NSError interface PKPaymentErrorKeys { - /// Gets a key that identifes the contact field as the source of the error. + /// Gets a key that identifies the contact field as the source of the error. /// To be added. /// To be added. [MacCatalyst (13, 1)] [Field ("PKPaymentErrorContactFieldUserInfoKey")] NSString ContactFieldUserInfoKey { get; } - /// Gets a key that identifes the postal address field as the source of the error. + /// Gets a key that identifies the postal address field as the source of the error. /// To be added. /// To be added. [MacCatalyst (13, 1)] diff --git a/src/pdfkit.cs b/src/pdfkit.cs index def55b79c0ba..e57a8347cd1c 100644 --- a/src/pdfkit.cs +++ b/src/pdfkit.cs @@ -2933,7 +2933,7 @@ interface PdfThumbnailView : NSCoding { /// Initializes the PdfThumbnailView with the specified frame. /// /// This constructor is used to programmatically create a new instance of PdfThumbnailView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); @@ -3048,7 +3048,7 @@ interface PdfView : /// Initializes the PdfView with the specified frame. /// /// This constructor is used to programmatically create a new instance of PdfView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/photos.cs b/src/photos.cs index f65bb182b190..691dffc6cf5f 100644 --- a/src/photos.cs +++ b/src/photos.cs @@ -563,7 +563,7 @@ interface PHObjectChangeDetails { // include the availability attributes to any new member (and don't trust the type-level ones) interface PHChangeRequest { } - /// Enumerates differences between snapshots of the objec at the specified indices. + /// Enumerates differences between snapshots of the object at the specified indices. [MacCatalyst (13, 1)] delegate void PHChangeDetailEnumerator (nuint fromIndex, nuint toIndex); diff --git a/src/photosui.cs b/src/photosui.cs index 8a57b273a878..4dba0aec4e87 100644 --- a/src/photosui.cs +++ b/src/photosui.cs @@ -72,7 +72,7 @@ interface PHLivePhotoView { /// Initializes the PHLivePhotoView with the specified frame. /// /// This constructor is used to programmatically create a new instance of PHLivePhotoView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/replaykit.cs b/src/replaykit.cs index 8d4294ec625c..53428bd4e5a7 100644 --- a/src/replaykit.cs +++ b/src/replaykit.cs @@ -417,7 +417,7 @@ interface IRPBroadcastControllerDelegate { } [Protocol, Model] [BaseType (typeof (NSObject))] interface RPBroadcastControllerDelegate { - /// The controller for the broadcast that finsihed. + /// The controller for the broadcast that finished. /// /// The error, if any, that ended the broadcast. /// This parameter can be . @@ -530,7 +530,7 @@ interface RPBroadcastMP4ClipHandler { void FinishedProcessingMP4Clip ([NullAllowed] RPBroadcastConfiguration broadcastConfiguration, [NullAllowed] NSError error); } - /// Processes ReplayKit buffer obects as they arrive. + /// Processes ReplayKit buffer objects as they arrive. /// /// Apple documentation for RPBroadcastSampleHandler [MacCatalyst (13, 1)] @@ -587,7 +587,7 @@ interface RPSystemBroadcastPickerView : NSCoding { /// Initializes the RPSystemBroadcastPickerView with the specified frame. /// /// This constructor is used to programmatically create a new instance of RPSystemBroadcastPickerView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/safariservices.cs b/src/safariservices.cs index b0074f2f1703..ad1aefa79941 100644 --- a/src/safariservices.cs +++ b/src/safariservices.cs @@ -68,7 +68,7 @@ interface SFContentBlockerManager { /// To be added. /// This parameter can be . /// - /// Relaods the specified content blocker and runs a completion handler when the operation completes. + /// Reloads the specified content blocker and runs a completion handler when the operation completes. /// To be added. [Async (XmlDocs = """ To be added. diff --git a/src/scenekit.cs b/src/scenekit.cs index c6cb97b07c84..560e32db8259 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -2114,13 +2114,13 @@ interface SCNHitTestOptions { /// /// bool BackFaceCulling { get; set; } - /// Control whether hit-testing uses the node's geometry, or if a bounding-box is used to optmize the hit-testing process speed. + /// Controls whether hit-testing uses the node's geometry, or whether a bounding box is used to optimize performance. /// If this value is not specified, the value assumed is false. /// /// By default, the hit-testing will use the node's geometry /// information to determine whether there was a hit. This /// process can be slow, so you can set this property to true to - /// constraint the search space to the bounxing box of the + /// constrain the search space to the bounding box of the /// target. /// bool BoundingBoxOnly { get; set; } @@ -4398,7 +4398,7 @@ interface SCNView : SCNSceneRenderer, SCNTechniqueSupport { /// Initializes the SCNView with the specified frame. /// /// This constructor is used to programmatically create a new instance of SCNView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/security.cs b/src/security.cs index 9964a3b1e9dd..b030b2aeeea2 100644 --- a/src/security.cs +++ b/src/security.cs @@ -340,15 +340,15 @@ enum SecKeyClass { /// To be added. Invalid = -1, - /// Public part of a symetric key. + /// Public part of a symmetric key. [Field ("kSecAttrKeyClassPublic")] Public = 0, - /// Private part of an asymetric key. + /// Private part of an asymmetric key. [Field ("kSecAttrKeyClassPrivate")] Private = 1, - /// A symetric key. + /// A symmetric key. [Field ("kSecAttrKeyClassSymmetric")] Symmetric = 2, } diff --git a/src/social.cs b/src/social.cs index 0071bfd6b038..25acb18e66c0 100644 --- a/src/social.cs +++ b/src/social.cs @@ -83,7 +83,7 @@ interface SLServiceType { } /// Enumeration with the various kinds of social services that can be used. - /// This enumeration is used to map into the underlying set of services offered by the social framework. It is intended to assist code completion while developing and take the gueswork out of using the framework in some entry points that take an NSString as a parameter. + /// This enumeration is used to map into the underlying set of services offered by the social framework. It is intended to assist code completion while developing and take the guesswork out of using the framework in some entry points that take an NSString as a parameter. enum SLServiceKind { /// Facebook services [Deprecated (PlatformName.iOS, 11, 0, message: "Use Facebook SDK instead.")] diff --git a/src/speech.cs b/src/speech.cs index 3192430901c8..157942e6f970 100644 --- a/src/speech.cs +++ b/src/speech.cs @@ -309,7 +309,7 @@ interface SFSpeechRecognizer { /// Gets whether speech recognition is currently available. /// To be added. /// - /// Speech recognition is not supported on all devices and is always relient on Internet access. + /// Speech recognition is not supported on all devices and is always reliant on Internet access. /// [Export ("available")] bool Available { [Bind ("isAvailable")] get; } diff --git a/src/spritekit.cs b/src/spritekit.cs index 5a7035f1ba8e..eb74711e6112 100644 --- a/src/spritekit.cs +++ b/src/spritekit.cs @@ -1605,7 +1605,7 @@ partial interface SKView /// Initializes the SKView with the specified frame. /// /// This constructor is used to programmatically create a new instance of SKView with the specified dimension in the frame. The object will only be displayed once it has been added to a view hierarchy by calling AddSubview in a containing view. - /// This constructor is not invoked when deserializing objects from storyboards or XIB filesinstead the constructor that takes an NSCoder parameter is invoked. + /// This constructor is not invoked when deserializing objects from storyboards or XIB files; instead, the constructor that takes an NSCoder parameter is invoked. /// [Export ("initWithFrame:")] NativeHandle Constructor (CGRect frame); diff --git a/src/storekit.cs b/src/storekit.cs index 08b348ae1226..ddc9f429649b 100644 --- a/src/storekit.cs +++ b/src/storekit.cs @@ -792,7 +792,7 @@ interface StoreProductParameters { [Export ("ProviderToken")] string ProviderToken { get; set; } - /// Gets or sets the ad network's cryptograpic signature. Used for attribution. + /// Gets or sets the ad network's cryptographic signature. Used for attribution. /// To be added. /// To be added. [NoMac] diff --git a/src/uikit.cs b/src/uikit.cs index b430fbc838b5..bf1d36e044cd 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -1342,7 +1342,7 @@ interface UIAccessibilityContainer { NSObject GetAccessibilityElements (); /// To be added. - /// Assigns to the contents of the accessibilty container. + /// Assigns to the contents of the accessibility container. /// To be added. [MacCatalyst (13, 1)] [Export ("setAccessibilityElements:")] @@ -9621,7 +9621,7 @@ interface UITextRange { interface IUITextInput : INativeObject { } - /// IUITextInput works with the inputting of text and allows the manipulaton of features including autocorrection and many other text input features related to document presentation. + /// IUITextInput works with the inputting of text and allows the manipulation of features including autocorrection and many other text input features related to document presentation. /// To be added. [MacCatalyst (13, 1)] [Protocol] @@ -9805,7 +9805,7 @@ interface UITextInput : UIKeyInput { /// Constant indicating layout direction. /// A UITextRange object indicating the range of a document's text. - /// Sets a base directon for writing in the specified range of text. + /// Sets a base direction for writing in the specified range of text. /// To be added. [Abstract] [Export ("setBaseWritingDirection:forRange:")] @@ -14221,7 +14221,7 @@ interface UIPageControl : UIAppearance { void SetIndicatorImage ([NullAllowed] UIImage image, nint page); /// To be added. - /// The size this UIPageControl's Bounds needs to be to accomodate the specified number of pages. + /// The size this UIPageControl's Bounds needs to be to accommodate the specified number of pages. /// To be added. /// To be added. [Export ("sizeForNumberOfPages:")] @@ -16074,7 +16074,7 @@ UIEdgeInsets ScrollIndicatorInsets { [Export ("dragging")] bool Dragging { [Bind ("isDragging")] get; } - /// If this property returns , then scrolling is still occuring in the scroll view but the user is not dragging their finger. + /// If this property returns , then scrolling is still occurring in the scroll view but the user is not dragging their finger. /// /// /// @@ -16628,7 +16628,7 @@ interface UISearchBar : UIBarPositioning, UITextInputTraits, UILookToDictateCapa /// To be added. /// To be added. - /// The divider image used for the specified combination of left and righ t segment states. + /// The divider image used for the specified combination of left and right segment states. /// To be added. /// To be added. [Export ("scopeBarButtonDividerImageForLeftSegmentState:rightSegmentState:")] @@ -17325,7 +17325,7 @@ interface UISegmentedControl /// The segment index to return the title for. /// Allows the title for a particular segment to be retrieved. /// The title for a given segment - /// Retuns null if a title has not been set. + /// Returns null if a title has not been set. [Export ("titleForSegmentAtIndex:")] [return: NullAllowed] string TitleAt (nint segment); @@ -19824,7 +19824,7 @@ interface UITableViewDelegate { /// The table view containing the row/cell accessory that has been tapped. /// The location of the row in the table view. - /// Indictes that the user has tapped the accessory / disclosure buttom at the specified indexPath. + /// Indicates that the user has tapped the accessory/disclosure button at the specified indexPath. /// To be added. [Export ("tableView:accessoryButtonTappedForRowWithIndexPath:")] void AccessoryButtonTapped (UITableView tableView, NSIndexPath indexPath); @@ -24583,7 +24583,7 @@ interface UITextContentType { [Field ("UITextContentTypeNewPassword")] NSString NewPassword { get; } - /// Indicates a text field that acceps a one-time passcode. + /// Indicates a text field that accepts a one-time passcode. /// To be added. /// To be added. [MacCatalyst (13, 1)] @@ -28745,7 +28745,7 @@ interface UIDropSession : UIDragDropSession, NSProgressReporting { UIDropSessionProgressIndicatorStyle ProgressIndicatorStyle { get; set; } /// The class of objects to load. - /// Handler to run after the objecs are loaded. + /// Handler to run after the objects are loaded. /// When implemented by the developer, instantiates every object in the drop session that has the type that is specified by the parameter. /// To be added. /// To be added. @@ -29510,14 +29510,14 @@ interface UITextDragDelegate { [Export ("textDraggableView:willAnimateLiftWithAnimator:session:")] void WillAnimateLift (IUITextDraggable textDraggableView, IUIDragAnimating animator, IUIDragSession session); - /// The orginating view. + /// The originating view. /// The drag session that will begin. /// Method that is called just before a drag session begins. /// To be added. [Export ("textDraggableView:dragSessionWillBegin:")] void DragSessionWillBegin (IUITextDraggable textDraggableView, IUIDragSession session); - /// The orginating view. + /// The originating view. /// The drag session that ended. /// The operation that ended the session. /// Method that is called when the user cancels or completes the drag session. @@ -29812,7 +29812,7 @@ interface UISpringLoadedInteractionBehavior { interface IUISpringLoadedInteractionEffect { } - /// Interface for applying state-based visual styles to spring-loaded interations. + /// Interface for applying state-based visual styles to spring-loaded interactions. [NoTV] [MacCatalyst (13, 1)] [Protocol] @@ -30032,7 +30032,7 @@ interface UITextPasteItem { void SetAttributedStringResult (NSAttributedString @string); /// The new attachment value. - /// Sets the attachement result to the specified attachment. + /// Sets the attachment result to the specified attachment. /// To be added. [Abstract] [Export ("setAttachmentResult:")] @@ -30352,8 +30352,8 @@ interface IUIFocusItemContainer { } [NoMac] [Protocol] interface UIFocusItemContainer { - /// Gets the coordinate space implemenation. - /// The coordinate space implemenation. + /// Gets the coordinate space implementation. + /// The coordinate space implementation. /// To be added. [Abstract] [Export ("coordinateSpace")] diff --git a/src/usernotifications.cs b/src/usernotifications.cs index af6941936718..95c8d110df87 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -813,7 +813,7 @@ interface UNNotificationRequest : NSCopying, NSSecureCoding { [NullAllowed, Export ("trigger", ArgumentSemantic.Copy)] UNNotificationTrigger Trigger { get; } - /// An identifer, unique to the application scope. + /// An identifier, unique to the application scope. /// The content of the notification. /// /// The trigger that activates the notification when the trigger's conditions are met. @@ -855,8 +855,8 @@ interface UNNotificationResponse : NSCopying, NSSecureCoding { [Export ("notification", ArgumentSemantic.Copy)] UNNotification Notification { get; } - /// Gets the action identifer that tells what the user did in response to the notification. - /// The action identifer that tells what the user did in response to the notification. + /// Gets the action identifier that tells what the user did in response to the notification. + /// The action identifier that tells what the user did in response to the notification. /// To be added. [Export ("actionIdentifier")] NSString ActionIdentifier { get; } @@ -1432,4 +1432,3 @@ interface UNNotificationAttributedMessageContext : UNNotificationContentProvidin UNNotificationAttributedMessageContext Create (INSendMessageIntent sendMessageIntent, NSAttributedString attributedContent); } } - diff --git a/src/usernotificationsui.cs b/src/usernotificationsui.cs index 037d9079c60e..3afc78a1c9d1 100644 --- a/src/usernotificationsui.cs +++ b/src/usernotificationsui.cs @@ -23,11 +23,11 @@ namespace UserNotificationsUI { [Unavailable (PlatformName.TvOS)] [Native] public enum UNNotificationContentExtensionMediaPlayPauseButtonType : ulong { - /// Indicates that no playback controls should be overlayed on top of the notification content. + /// Indicates that no playback controls should be overlaid on top of the notification content. None, /// Indicates that the default playback control display method should be used. Default, - /// Indicates that playback controls should be overlayed on top of the notification content. + /// Indicates that playback controls should be overlaid on top of the notification content. Overlay, } diff --git a/src/vision.cs b/src/vision.cs index 971e3b2d170c..56163b68496d 100644 --- a/src/vision.cs +++ b/src/vision.cs @@ -1614,7 +1614,7 @@ interface VNFaceObservationAccepting { VNFaceObservation [] InputFaceObservations { get; set; } } - /// Abstract sub-class of that attemps to align an image with a reference image. + /// Abstract subclass of that attempts to align an image with a reference image. [MacCatalyst (13, 1)] [Abstract] [DisableDefaultCtor] diff --git a/src/webkit.cs b/src/webkit.cs index 024d7fa04c78..3307429c8ab5 100644 --- a/src/webkit.cs +++ b/src/webkit.cs @@ -5701,7 +5701,7 @@ interface WKWebsiteDataType { [Field ("WKWebsiteDataTypeLocalStorage", "WebKit")] NSString LocalStorage { get; } - /// Gets an NSString that signifies a WebSQL databse. + /// Gets an NSString that signifies a WebSQL database. /// The NSString object for "WKWebsiteDataTypeWebSQLDatabases". /// To be added. [Field ("WKWebsiteDataTypeWebSQLDatabases", "WebKit")] diff --git a/src/xkit.cs b/src/xkit.cs index 3cc8fc3c2ec8..bfdefdd30077 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -420,7 +420,7 @@ partial interface NSLayoutManager : NSSecureCoding { /// Invalidates the layout information and glyphs for the specified and any following. /// To be added. /// - /// Application developers will typically not need to call this method unless they have subclassed (for example, creating a subclass that changes shape to accomodate placed graphics). + /// Application developers will typically not need to call this method unless they have subclassed (for example, creating a subclass that changes shape to accommodate placed graphics). /// [Export ("textContainerChangedGeometry:")] void TextContainerChangedGeometry (NSTextContainer container); diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt index 240abedfb046..d72c2afc6991 100644 --- a/tests/cecil-tests/Documentation.KnownFailures.txt +++ b/tests/cecil-tests/Documentation.KnownFailures.txt @@ -15023,7 +15023,6 @@ M:Metal.MTLIOCompressionContext.AppendData(Foundation.NSData) M:Metal.MTLIOCompressionContext.AppendData(System.Byte[]) M:Metal.MTLIOCompressionContext.AppendData(System.ReadOnlySpan{System.Byte}) M:Metal.MTLIOCompressionContext.Create(System.String,Metal.MTLIOCompressionMethod,System.Int64) -M:Metal.MTLIOCompressionContext.Dispose(System.Boolean) M:Metal.MTLIOCompressionContext.FlushAndDestroy M:Metal.MTLLibrary_Extensions.CreateFunctionAsync(Metal.IMTLLibrary,System.String,Metal.MTLFunctionConstantValues) M:Metal.MTLLibrary_Extensions.CreateIntersectionFunction(Metal.IMTLLibrary,Metal.MTLIntersectionFunctionDescriptor,Foundation.NSError@) @@ -17481,7 +17480,6 @@ M:SearchKit.SKSummary.GetParagraphSummaryInfo(System.IntPtr,System.IntPtr[],Syst M:SearchKit.SKSummary.GetSentence(System.IntPtr) M:SearchKit.SKSummary.GetSentenceSummary(System.IntPtr) M:SearchKit.SKSummary.GetSentenceSummaryInfo(System.Int32,System.IntPtr[],System.IntPtr[],System.IntPtr[]) -M:Security.Authorization.Dispose(System.Boolean) M:Security.AuthorizationEnvironment.#ctor M:Security.AuthorizationParameters.#ctor M:Security.SecIdentity2.AccessCertificates(System.Action{Security.SecCertificate2}) @@ -17738,7 +17736,6 @@ M:StoreKit.SKStoreProductViewController.LoadProduct(StoreKit.StoreProductParamet M:StoreKit.SKStoreProductViewController.LoadProductAsync(Foundation.NSDictionary,StoreKit.SKAdImpression) M:StoreKit.SKStoreProductViewController.LoadProductAsync(StoreKit.StoreProductParameters,StoreKit.SKAdImpression) M:StoreKit.SKStoreProductViewController.remove_Finished(System.EventHandler) -M:SystemConfiguration.NetworkReachability.Dispose(System.Boolean) M:ThreadNetwork.THClient.CheckPreferredNetworkAsync(Foundation.NSData) M:ThreadNetwork.THClient.DeleteCredentialsForBorderAgentAsync(Foundation.NSData) M:ThreadNetwork.THClient.IsPreferredNetworkAvailableAsync @@ -19131,8 +19128,6 @@ M:VideoSubscriberAccount.VSUserAccountManager.UpdateUserAccountAsync(VideoSubscr M:VideoToolbox.IVTFrameProcessorConfiguration.GetMaximumDimensions``1 M:VideoToolbox.IVTFrameProcessorConfiguration.GetMinimumDimensions``1 M:VideoToolbox.IVTFrameProcessorConfiguration.GetProcessorSupported``1 -M:VideoToolbox.VTCompressionSession.Dispose(System.Boolean) -M:VideoToolbox.VTDecompressionSession.Dispose(System.Boolean) M:VideoToolbox.VTFrameProcessor.EndSession M:VideoToolbox.VTFrameProcessor.Process(Metal.IMTLCommandBuffer,VideoToolbox.IVTFrameProcessorParameters) M:VideoToolbox.VTFrameProcessor.Process(VideoToolbox.IVTFrameProcessorParameters,Foundation.NSError@) @@ -19151,18 +19146,15 @@ M:VideoToolbox.VTLowLatencySuperResolutionScalerConfiguration.GetSupportedScaleF M:VideoToolbox.VTLowLatencySuperResolutionScalerParameters.#ctor(VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTFrameProcessorFrame) M:VideoToolbox.VTMotionBlurConfiguration.#ctor(System.IntPtr,System.IntPtr,System.Boolean,VideoToolbox.VTMotionBlurConfigurationQualityPrioritization,VideoToolbox.VTMotionBlurConfigurationRevision) M:VideoToolbox.VTMotionBlurParameters.#ctor(VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTFrameProcessorOpticalFlow,VideoToolbox.VTFrameProcessorOpticalFlow,System.IntPtr,VideoToolbox.VTMotionBlurParametersSubmissionMode,VideoToolbox.VTFrameProcessorFrame) -M:VideoToolbox.VTMotionEstimationSession.Dispose(System.Boolean) M:VideoToolbox.VTOpticalFlowConfiguration.#ctor(System.IntPtr,System.IntPtr,VideoToolbox.VTOpticalFlowConfigurationQualityPrioritization,VideoToolbox.VTOpticalFlowConfigurationRevision) M:VideoToolbox.VTOpticalFlowParameters.#ctor(VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTFrameProcessorFrame,VideoToolbox.VTOpticalFlowParametersSubmissionMode,VideoToolbox.VTFrameProcessorOpticalFlow) M:VideoToolbox.VTPixelRotationSession.Create M:VideoToolbox.VTPixelRotationSession.Create(CoreFoundation.CFAllocator) -M:VideoToolbox.VTPixelRotationSession.Dispose(System.Boolean) M:VideoToolbox.VTPixelRotationSession.GetTypeID M:VideoToolbox.VTPixelRotationSession.RotateImage(CoreVideo.CVPixelBuffer,CoreVideo.CVPixelBuffer) M:VideoToolbox.VTPixelRotationSession.SetRotationProperties(VideoToolbox.VTPixelRotationProperties) M:VideoToolbox.VTPixelTransferSession.Create M:VideoToolbox.VTPixelTransferSession.Create(CoreFoundation.CFAllocator) -M:VideoToolbox.VTPixelTransferSession.Dispose(System.Boolean) M:VideoToolbox.VTPixelTransferSession.GetTypeID M:VideoToolbox.VTPixelTransferSession.SetTransferProperties(VideoToolbox.VTPixelTransferProperties) M:VideoToolbox.VTPixelTransferSession.TransferImage(CoreVideo.CVPixelBuffer,CoreVideo.CVPixelBuffer) diff --git a/tests/common/MonoTouch.Dialog/DialogViewController.cs b/tests/common/MonoTouch.Dialog/DialogViewController.cs index b876ac9bff3a..798e6c9ee3e0 100644 --- a/tests/common/MonoTouch.Dialog/DialogViewController.cs +++ b/tests/common/MonoTouch.Dialog/DialogViewController.cs @@ -21,11 +21,11 @@ namespace MonoTouch.Dialog { /// public class DialogViewController : UITableViewController { public UITableViewStyle Style = UITableViewStyle.Grouped; - public event Action OnSelection; + public event Action? OnSelection; #if !__TVOS__ - UISearchBar searchBar; + UISearchBar? searchBar; #endif - UITableView tableView; + UITableView? tableView; RootElement root; bool pushing; bool dirty; @@ -50,7 +50,7 @@ public RootElement Root { } } - EventHandler refreshRequested; + EventHandler? refreshRequested; /// /// If you assign a handler to this event before the view is shown, the /// DialogViewController will have support for pull-to-refresh UI. @@ -87,7 +87,7 @@ public bool EnableSearch { // the user manually pulls it down. public bool AutoHideSearch { get; set; } - public string SearchPlaceholder { get; set; } + public string? SearchPlaceholder { get; set; } /// /// Invoke this method to trigger a data refresh. @@ -126,7 +126,7 @@ public void ReloadComplete () reloading = false; #if !__TVOS__ - RefreshControl.EndRefreshing (); + RefreshControl?.EndRefreshing (); #endif } @@ -150,8 +150,8 @@ public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation) } #endif - Section [] originalSections; - Element [] [] originalElements; + Section []? originalSections; + Element [] []? originalElements; /// /// Allows caller to programatically activate the search bar and start the search process @@ -162,7 +162,7 @@ public void StartSearch () return; #if !__TVOS__ - searchBar.BecomeFirstResponder (); + searchBar?.BecomeFirstResponder (); #endif originalSections = Root.Sections.ToArray (); originalElements = new Element [originalSections.Length] []; @@ -182,33 +182,24 @@ public virtual void FinishSearch () originalSections = null; originalElements = null; #if !__TVOS__ - searchBar.ResignFirstResponder (); + searchBar?.ResignFirstResponder (); #endif ReloadData (); } - public delegate void SearchTextEventHandler (object sender, SearchChangedEventArgs args); - public event SearchTextEventHandler SearchTextChanged; - - public virtual void OnSearchTextChanged (string text) - { - if (SearchTextChanged is not null) - SearchTextChanged (this, new SearchChangedEventArgs (text)); - } - public void PerformFilter (string text) { - if (originalSections is null) + var sections = originalSections; + var elementsBySection = originalElements; + if (sections is null || elementsBySection is null) return; - OnSearchTextChanged (text); - var newSections = new List
(); - for (int sidx = 0; sidx < originalSections.Length; sidx++) { - Section newSection = null; - var section = originalSections [sidx]; - Element [] elements = originalElements [sidx]; + for (int sidx = 0; sidx < sections.Length; sidx++) { + Section? newSection = null; + var section = sections [sidx]; + Element [] elements = elementsBySection [sidx]; for (int eidx = 0; eidx < elements.Length; eidx++) { if (elements [eidx].Matches (text)) { @@ -229,10 +220,6 @@ public void PerformFilter (string text) ReloadData (); } - public virtual void SearchButtonClicked (string text) - { - } - class SearchDelegate : UISearchBarDelegate { DialogViewController container; @@ -266,7 +253,8 @@ public override void TextChanged (UISearchBar searchBar, string searchText) public override void CancelButtonClicked (UISearchBar searchBar) { searchBar.ShowsCancelButton = false; - container.searchBar.Text = ""; + if (container.searchBar is not null) + container.searchBar.Text = ""; container.FinishSearch (); searchBar.ResignFirstResponder (); } @@ -274,14 +262,13 @@ public override void CancelButtonClicked (UISearchBar searchBar) public override void SearchButtonClicked (UISearchBar searchBar) { - container.SearchButtonClicked (searchBar.Text); } } public class Source : UITableViewSource { const float yboundary = 65; WeakReference container; - protected DialogViewController Container => container.TryGetTarget (out var result) ? result : null; + protected DialogViewController? Container => container.TryGetTarget (out var result) ? result : null; protected RootElement Root; public Source (DialogViewController container) @@ -311,12 +298,12 @@ public override nint NumberOfSections (UITableView tableView) return Root.Sections.Count; } - public override string TitleForHeader (UITableView tableView, nint section) + public override string? TitleForHeader (UITableView tableView, nint section) { return Root.Sections [(int) section].Caption; } - public override string TitleForFooter (UITableView tableView, nint section) + public override string? TitleForFooter (UITableView tableView, nint section) { return Root.Sections [(int) section].Footer; } @@ -342,21 +329,26 @@ public override void WillDisplay (UITableView tableView, UITableViewCell cell, N public override void RowDeselected (UITableView tableView, NSIndexPath indexPath) { - Container.Deselected (indexPath); + var container = Container; + if (container is not null) + container.Deselected (indexPath); } public override void RowSelected (UITableView tableView, NSIndexPath indexPath) { - var onSelection = Container.OnSelection; + var container = Container; + if (container is null) + return; + var onSelection = container.OnSelection; if (onSelection is not null) onSelection (indexPath); - Container.Selected (indexPath); + container.Selected (indexPath); } public override UIView GetViewForHeader (UITableView tableView, nint sectionIdx) { var section = Root.Sections [(int) sectionIdx]; - return section.HeaderView; + return section.HeaderView!; } public override nfloat GetHeightForHeader (UITableView tableView, nint sectionIdx) @@ -370,7 +362,7 @@ public override nfloat GetHeightForHeader (UITableView tableView, nint sectionId public override UIView GetViewForFooter (UITableView tableView, nint sectionIdx) { var section = Root.Sections [(int) sectionIdx]; - return section.FooterView; + return section.FooterView!; } public override nfloat GetHeightForFooter (UITableView tableView, nint sectionIdx) @@ -466,13 +458,14 @@ void SetupSearch () // Can't create a UISearchBar in tvOS, you can only use one from a UISearchController, // which require bigger changes, so just skip this for now. #else - if (enableSearch) { - searchBar = new UISearchBar (new CGRect (0, 0, tableView.Bounds.Width, 44)) { + var tv = tableView; + if (enableSearch && tv is not null) { + searchBar = new UISearchBar (new CGRect (0, 0, tv.Bounds.Width, 44)) { Delegate = new SearchDelegate (this) }; if (SearchPlaceholder is not null) searchBar.Placeholder = this.SearchPlaceholder; - tableView.TableHeaderView = searchBar; + tv.TableHeaderView = searchBar; } else { // Does not work with current Monotouch, will work with 3.0 // tableView.TableHeaderView = null; @@ -482,6 +475,8 @@ void SetupSearch () public virtual void Deselected (NSIndexPath indexPath) { + if (tableView is null) + return; var section = root.Sections [(int) indexPath.Section]; var element = section.Elements [(int) indexPath.Row]; @@ -490,6 +485,8 @@ public virtual void Deselected (NSIndexPath indexPath) public virtual void Selected (NSIndexPath indexPath) { + if (tableView is null) + return; var section = root.Sections [(int) indexPath.Section]; var element = section.Elements [(int) indexPath.Row]; @@ -531,7 +528,7 @@ void ConfigureTableView () #endif } - public event EventHandler ViewAppearing; + public event EventHandler? ViewAppearing; public override void ViewWillAppear (bool animated) { @@ -553,7 +550,7 @@ public override void ViewWillAppear (bool animated) if (root.Caption is not null) NavigationItem.Title = root.Caption; if (dirty) { - tableView.ReloadData (); + tableView?.ReloadData (); dirty = false; } @@ -579,11 +576,11 @@ public virtual Source CreateSizingSource (bool unevenRows) return unevenRows ? new SizingSource (this) : new Source (this); } - Source TableSource; + Source? TableSource; void UpdateSource () { - if (root is null) + if (root is null || tableView is null) return; TableSource = CreateSizingSource (root.UnevenRows); @@ -606,7 +603,7 @@ public void ReloadData () dirty = false; } - public event EventHandler ViewDisappearing; + public event EventHandler? ViewDisappearing; [Obsolete ("Use the ViewDisappearing event instead")] public event EventHandler ViewDissapearing { diff --git a/tests/common/MonoTouch.Dialog/Elements.cs b/tests/common/MonoTouch.Dialog/Elements.cs index e6dad909b5f3..15c5a9fd959d 100644 --- a/tests/common/MonoTouch.Dialog/Elements.cs +++ b/tests/common/MonoTouch.Dialog/Elements.cs @@ -24,8 +24,6 @@ using Foundation; using CoreAnimation; using ObjCRuntime; -using MonoTouch.Dialog.Utilities; - using NSAction = global::System.Action; namespace MonoTouch.Dialog { @@ -41,12 +39,12 @@ public partial class Element : IDisposable { /// other object this points to a Section and it is null /// for the root RootElement. /// - public Element Parent; + public Element? Parent; /// /// The caption to display for this given element /// - public string Caption; + public string? Caption; /// /// Initializes the element with the given caption. @@ -54,7 +52,7 @@ public partial class Element : IDisposable { /// /// The caption. /// - public Element (string caption) + public Element (string? caption) { this.Caption = caption; } @@ -152,7 +150,7 @@ public virtual void Selected (DialogViewController dvc, UITableView tableView, N /// /// If the cell is attached will return the immediate RootElement /// - public RootElement GetImmediateRootElement () + public RootElement? GetImmediateRootElement () { var section = Parent as Section; if (section is null) @@ -165,7 +163,7 @@ public RootElement GetImmediateRootElement () /// /// Returns the UITableView associated with this element, or null if this cell is not currently attached to a UITableView /// - public UITableView GetContainerTableView () + public UITableView? GetContainerTableView () { var root = GetImmediateRootElement (); if (root is null) @@ -176,7 +174,7 @@ public UITableView GetContainerTableView () /// /// Returns the currently active UITableViewCell for this element, or null if the element is not currently visible /// - public UITableViewCell GetActiveCell () + public UITableViewCell? GetActiveCell () { var tv = GetContainerTableView (); if (tv is null) @@ -192,7 +190,7 @@ public UITableViewCell GetActiveCell () /// it does not work for a toplevel RootElement or a Section of if the Element has /// not been attached yet. /// - public NSIndexPath IndexPath { + public NSIndexPath? IndexPath { get { var section = Parent as Section; if (section is null) @@ -242,7 +240,7 @@ public virtual bool Value { ValueChanged (this, EventArgs.Empty); } } - public event EventHandler ValueChanged; + public event EventHandler? ValueChanged; public BoolElement (string caption, bool value) : base (caption) { @@ -261,7 +259,7 @@ public override string Summary () public partial class BooleanElement : BoolElement { static NSString bkey = new NSString ("BooleanElement"); #if !__TVOS__ - UISwitch sw; + UISwitch? sw; #endif // !__TVOS__ public BooleanElement (string caption, bool value) : base (caption, value) @@ -318,7 +316,8 @@ public override void Selected (DialogViewController dvc, UITableView tableView, { Value = !Value; var cell = tableView.CellAt (path); - ConfigCell (cell); + if (cell is not null) + ConfigCell (cell); base.Selected (dvc, tableView, path); } #endif // !__TVOS__ @@ -351,234 +350,15 @@ public override bool Value { } } - /// - /// This class is used to render a string + a state in the form - /// of an image. - /// - /// - /// It is abstract to avoid making this element - /// keep two pointers for the state images, saving 8 bytes per - /// slot. The more derived class "BooleanImageElement" shows - /// one way to implement this by keeping two pointers, a better - /// implementation would return pointers to images that were - /// preloaded and are static. - /// - /// A subclass only needs to implement the GetImage method. - /// - public abstract partial class BaseBooleanImageElement : BoolElement { - static NSString key = new NSString ("BooleanImageElement"); - - public class TextWithImageCellView : UITableViewCell { - const int fontSize = 17; - static UIFont font = UIFont.BoldSystemFontOfSize (fontSize); - BaseBooleanImageElement parent; - UILabel label; - UIButton button; - const int ImageSpace = 32; - const int Padding = 8; - - public TextWithImageCellView (BaseBooleanImageElement parent_) : base (UITableViewCellStyle.Value1, parent_.CellKey) - { - parent = parent_; - label = new UILabel () { - TextAlignment = UITextAlignment.Left, - Text = parent.Caption, - Font = font, - BackgroundColor = UIColor.Clear - }; - button = UIButton.FromType (UIButtonType.Custom); - button.TouchDown += delegate - { - parent.Value = !parent.Value; - UpdateImage (); - if (parent.Tapped is not null) - parent.Tapped (); - }; - ContentView.Add (label); - ContentView.Add (button); - UpdateImage (); - } - - void UpdateImage () - { - button.SetImage (parent.GetImage (), UIControlState.Normal); - } - - public override void LayoutSubviews () - { - base.LayoutSubviews (); - var full = ContentView.Bounds; - var frame = full; - frame.Height = 22; - frame.X = Padding; - frame.Y = (full.Height - frame.Height) / 2; - frame.Width -= ImageSpace + Padding; - label.Frame = frame; - - button.Frame = new CGRect (full.Width - ImageSpace, -3, ImageSpace, 48); - } - - public void UpdateFrom (BaseBooleanImageElement newParent) - { - parent = newParent; - UpdateImage (); - label.Text = parent.Caption; - SetNeedsDisplay (); - } - } - - public BaseBooleanImageElement (string caption, bool value) - : base (caption, value) - { - } - - public event NSAction Tapped; - - protected abstract UIImage GetImage (); - - protected override NSString CellKey { - get { - return key; - } - } - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (CellKey) as TextWithImageCellView; - if (cell is null) - cell = new TextWithImageCellView (this); - else - cell.UpdateFrom (this); - return cell; - } - } - - public partial class BooleanImageElement : BaseBooleanImageElement { - UIImage onImage, offImage; - - public BooleanImageElement (string caption, bool value, UIImage onImage, UIImage offImage) : base (caption, value) - { - this.onImage = onImage; - this.offImage = offImage; - } - - protected override UIImage GetImage () - { - if (Value) - return onImage; - else - return offImage; - } - - protected override void Dispose (bool disposing) - { - base.Dispose (disposing); - onImage = offImage = null; - } - } - - /// - /// Used to display a slider on the screen. - /// - public partial class FloatElement : Element { - public bool ShowCaption; - public float Value; - public float MinValue, MaxValue; - static NSString skey = new NSString ("FloatElement"); - //UIImage Left, Right; -#if !__TVOS__ - // There is no UISlider in tvOS, so make this read-only for now. - UISlider slider; -#endif // !__TVOS__ - - public FloatElement (float value) : this (null, null, value) - { - } - - public FloatElement (UIImage left, UIImage right, float value) : base (null) - { - //Left = left; - //Right = right; - MinValue = 0; - MaxValue = 1; - Value = value; - } - - protected override NSString CellKey { - get { - return skey; - } - } - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (CellKey); - if (cell is null) { - cell = new UITableViewCell (UITableViewCellStyle.Default, CellKey); - cell.SelectionStyle = UITableViewCellSelectionStyle.None; - } else - RemoveTag (cell, 1); - -#if __TVOS__ - if (Caption is not null && ShowCaption) - cell.TextLabel.Text = Caption; - - cell.DetailTextLabel.Text = string.Format ("[{0}...{2}]: {1}]", MinValue, Value, MaxValue); -#else - CGSize captionSize = new CGSize (0, 0); - if (Caption is not null && ShowCaption) { - cell.TextLabel.Text = Caption; - captionSize = Caption.StringSize (UIFont.FromName (cell.TextLabel.Font.Name, UIFont.LabelFontSize)); - captionSize.Width += 10; // Spacing - } - if (slider is null) { - slider = new UISlider (new CGRect (10f + captionSize.Width, UIDevice.CurrentDevice.CheckSystemVersion (7, 0) ? 18f : 12f, cell.ContentView.Bounds.Width - 20 - captionSize.Width, 7f)) { - BackgroundColor = UIColor.Clear, - MinValue = this.MinValue, - MaxValue = this.MaxValue, - Continuous = true, - Value = this.Value, - Tag = 1, - AutoresizingMask = UIViewAutoresizing.FlexibleWidth - }; - slider.ValueChanged += delegate - { - Value = slider.Value; - }; - } else { - slider.Value = Value; - } - - cell.ContentView.AddSubview (slider); -#endif // __TVOS__ - return cell; - } - - public override string Summary () - { - return Value.ToString (); - } - - protected override void Dispose (bool disposing) - { - if (disposing) { -#if !__TVOS__ - if (slider is not null) { - slider.Dispose (); - slider = null; - } -#endif // !__TVOS__ - } - } - } - /// /// Used to display a cell that will launch a web browser when selected. /// public partial class HtmlElement : Element { - NSUrl nsUrl; + NSUrl? nsUrl; static NSString hkey = new NSString ("HtmlElement"); #if !__TVOS__ && !__MACCATALYST__ // There is no UIWebView in tvOS, so we can't launch anything. - UIWebView web; + UIWebView? web; #endif // !__TVOS__ && !__MACCATALYST__ public HtmlElement (string caption, string url) : base (caption) @@ -598,7 +378,7 @@ protected override NSString CellKey { } public string Url { get { - return nsUrl.ToString (); + return nsUrl?.ToString () ?? ""; } set { nsUrl = new NSUrl (value); @@ -690,11 +470,15 @@ public override void Selected (DialogViewController dvc, UITableView tableView, }; vc.NavigationItem.Title = Caption; - vc.View.AutosizesSubviews = true; - vc.View.AddSubview (web); + var view = vc.View; + if (view is not null) { + view.AutosizesSubviews = true; + view.AddSubview (web); + } dvc.ActivateController (vc); - web.LoadRequest (NSUrlRequest.FromUrl (nsUrl)); + if (nsUrl is not null) + web.LoadRequest (NSUrlRequest.FromUrl (nsUrl)); } #endif // !__TVOS__ && !__MACCATALYST__ } @@ -707,21 +491,21 @@ public partial class StringElement : Element { static NSString skey = new NSString ("StringElement"); static NSString skeyvalue = new NSString ("StringElementValue"); public UITextAlignment Alignment = UITextAlignment.Left; - public string Value; + public string? Value; - public StringElement (string caption) : base (caption) { } + public StringElement (string? caption) : base (caption) { } - public StringElement (string caption, string value) : base (caption) + public StringElement (string? caption, string? value) : base (caption) { this.Value = value; } - public StringElement (string caption, NSAction tapped) : base (caption) + public StringElement (string? caption, NSAction tapped) : base (caption) { Tapped += tapped; } - public event NSAction Tapped; + public event NSAction? Tapped; public override UITableViewCell GetCell (UITableView tv) { @@ -744,7 +528,7 @@ public override UITableViewCell GetCell (UITableView tv) public override string Summary () { - return Caption; + return Caption ?? ""; } public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath indexPath) @@ -768,6 +552,16 @@ public override bool Matches (string text) public partial class StyledStringElement : StringElement, IColorizeBackground { static NSString [] skey = { new NSString (".1"), new NSString (".2"), new NSString (".3"), new NSString (".4") }; + internal static UIFont GetBoldFont (nfloat size) + { + return UIFont.BoldSystemFontOfSize (size) ?? throw new InvalidOperationException ("Unable to create a bold system font."); + } + + internal static UIFont GetSystemFont (nfloat size) + { + return UIFont.SystemFontOfSize (size) ?? throw new InvalidOperationException ("Unable to create a system font."); + } + public StyledStringElement (string caption) : base (caption) { } public StyledStringElement (string caption, NSAction tapped) : base (caption, tapped) { } public StyledStringElement (string caption, string value) : base (caption, value) @@ -780,20 +574,20 @@ public StyledStringElement (string caption, string value, UITableViewCellStyle s } protected UITableViewCellStyle style; - public event NSAction AccessoryTapped; - public UIFont Font; - public UIFont SubtitleFont; - public UIColor TextColor; + public event NSAction? AccessoryTapped; + public UIFont? Font; + public UIFont? SubtitleFont; + public UIColor? TextColor; public UILineBreakMode LineBreakMode = UILineBreakMode.WordWrap; public int Lines = 0; public UITableViewCellAccessory Accessory = UITableViewCellAccessory.None; // To keep the size down for a StyleStringElement, we put all the image information // on a separate structure, and create this on demand. - ExtraInfo extraInfo; + ExtraInfo? extraInfo; class ExtraInfo { - public UIColor BackgroundColor, DetailColor; + public UIColor? BackgroundColor, DetailColor; } ExtraInfo OnImageInfo () @@ -803,7 +597,7 @@ ExtraInfo OnImageInfo () return extraInfo; } - public UIColor BackgroundColor { + public UIColor? BackgroundColor { get { return extraInfo is null ? null : extraInfo.BackgroundColor; } @@ -812,7 +606,7 @@ public UIColor BackgroundColor { } } - public UIColor DetailColor { + public UIColor? DetailColor { get { return extraInfo is null ? null : extraInfo.DetailColor; } @@ -845,7 +639,7 @@ protected void PrepareCell (UITableViewCell cell) tl.Text = Caption; tl.TextAlignment = Alignment; tl.TextColor = TextColor ?? UIColor.Black; - tl.Font = Font ?? UIFont.BoldSystemFontOfSize (17); + tl.Font = Font ?? GetBoldFont (17); tl.LineBreakMode = LineBreakMode; tl.Lines = Lines; @@ -863,7 +657,7 @@ protected void PrepareCell (UITableViewCell cell) if (cell.DetailTextLabel is not null) { cell.DetailTextLabel.Lines = Lines; cell.DetailTextLabel.LineBreakMode = LineBreakMode; - cell.DetailTextLabel.Font = SubtitleFont ?? UIFont.SystemFontOfSize (14); + cell.DetailTextLabel.Font = SubtitleFont ?? GetSystemFont (14); cell.DetailTextLabel.TextColor = (extraInfo is null || extraInfo.DetailColor is null) ? UIColor.Gray : extraInfo.DetailColor; } } @@ -890,7 +684,7 @@ void IColorizeBackground.WillDisplay (UITableView tableView, UITableViewCell cel internal void AccessoryTap () { - NSAction tapped = AccessoryTapped; + var tapped = AccessoryTapped; if (tapped is not null) tapped (); } @@ -983,17 +777,17 @@ public virtual nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) if (this.Accessory != UITableViewCellAccessory.None) maxSize.Width -= 20; - string c = Caption; - string v = Value; + string? c = Caption; + string? v = Value; // ensure the (multi-line) Value will be rendered inside the cell when no Caption is present if (String.IsNullOrEmpty (c)) c = " "; - var captionFont = Font ?? UIFont.BoldSystemFontOfSize (17); + var captionFont = Font ?? StyledStringElement.GetBoldFont (17); var height = c.StringSize (captionFont, maxSize, LineBreakMode).Height; if (!String.IsNullOrEmpty (v)) { - var subtitleFont = SubtitleFont ?? UIFont.SystemFontOfSize (14); + var subtitleFont = SubtitleFont ?? StyledStringElement.GetSystemFont (14); if (this.style == UITableViewCellStyle.Subtitle) { height += v.StringSize (subtitleFont, maxSize, LineBreakMode).Height; } else { @@ -1052,99 +846,15 @@ public virtual nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) { float margin = UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone ? 40f : 110f; CGSize size = new CGSize (tableView.Bounds.Width - margin, float.MaxValue); - UIFont font = UIFont.BoldSystemFontOfSize (17); - string c = Caption; + var font = StyledStringElement.GetBoldFont (17); + string? c = Caption; // ensure the (single-line) Value will be rendered inside the cell if (String.IsNullOrEmpty (c) && !String.IsNullOrEmpty (Value)) c = " "; - return c.StringSize (font, size, UILineBreakMode.WordWrap).Height + 10; + return (c ?? "").StringSize (font, size, UILineBreakMode.WordWrap).Height + 10; } } - public partial class RadioElement : StringElement { - public string Group; - internal int RadioIdx; - - public RadioElement (string caption, string group) : base (caption) - { - Group = group; - } - - public RadioElement (string caption) : base (caption) - { - } - - public override UITableViewCell GetCell (UITableView tv) - { - var cell = base.GetCell (tv); - var root = (RootElement) Parent.Parent; - - if (!(root.group is RadioGroup)) - throw new Exception ("The RootElement's Group is null or is not a RadioGroup"); - - bool selected = RadioIdx == ((RadioGroup) (root.group)).Selected; - cell.Accessory = selected ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; - - return cell; - } - - public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath indexPath) - { - RootElement root = (RootElement) Parent.Parent; - if (RadioIdx != root.RadioSelected) { - UITableViewCell cell; - var selectedIndex = root.PathForRadio (root.RadioSelected); - if (selectedIndex is not null) { - cell = tableView.CellAt (selectedIndex); - if (cell is not null) - cell.Accessory = UITableViewCellAccessory.None; - } - cell = tableView.CellAt (indexPath); - if (cell is not null) - cell.Accessory = UITableViewCellAccessory.Checkmark; - root.RadioSelected = RadioIdx; - } - - base.Selected (dvc, tableView, indexPath); - } - } - - public partial class CheckboxElement : StringElement { - public new bool Value; - public string Group; - - public CheckboxElement (string caption) : base (caption) { } - public CheckboxElement (string caption, bool value) : base (caption) - { - Value = value; - } - - public CheckboxElement (string caption, bool value, string group) : this (caption, value) - { - Group = group; - } - - UITableViewCell ConfigCell (UITableViewCell cell) - { - cell.Accessory = Value ? UITableViewCellAccessory.Checkmark : UITableViewCellAccessory.None; - return cell; - } - - public override UITableViewCell GetCell (UITableView tv) - { - return ConfigCell (base.GetCell (tv)); - } - - public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) - { - Value = !Value; - var cell = tableView.CellAt (path); - ConfigCell (cell); - base.Selected (dvc, tableView, path); - } - - } - /// /// An element that can be used to enter text. /// @@ -1157,7 +867,7 @@ public partial class EntryElement : Element { /// /// The value of the EntryElement /// - public string Value { + public string? Value { get { if (entry is null) return val; @@ -1176,7 +886,7 @@ public string Value { entry.Text = value; } } - protected string val; + protected string? val; /// /// The key used for reusable UITableViewCells. @@ -1291,14 +1001,14 @@ public UITextAlignment TextAlignment { UITextAutocorrectionType autocorrectionType = UITextAutocorrectionType.Default; UITextFieldViewMode clearButtonMode = UITextFieldViewMode.Never; bool isPassword, becomeResponder; - UITextField entry; - string placeholder; - static UIFont font = UIFont.BoldSystemFontOfSize (17); - - public event EventHandler Changed; - public event Func ShouldReturn; - public EventHandler EntryStarted { get; set; } - public EventHandler EntryEnded { get; set; } + UITextField? entry; + string? placeholder; + static UIFont font = StyledStringElement.GetBoldFont (17); + + public event EventHandler? Changed; + public event Func? ShouldReturn; + public EventHandler? EntryStarted { get; set; } + public EventHandler? EntryEnded { get; set; } /// /// Constructs an EntryElement with the given caption, placeholder and initial value. /// @@ -1311,7 +1021,7 @@ public UITextAlignment TextAlignment { /// /// Initial value. /// - public EntryElement (string caption, string placeholder, string value) : base (caption) + public EntryElement (string caption, string? placeholder, string? value) : base (caption) { Value = value; this.placeholder = placeholder; @@ -1332,7 +1042,7 @@ public EntryElement (string caption, string placeholder, string value) : base (c /// /// True if this should be used to enter a password. /// - public EntryElement (string caption, string placeholder, string value, bool isPassword) : base (caption) + public EntryElement (string caption, string? placeholder, string? value, bool isPassword) : base (caption) { Value = value; this.isPassword = isPassword; @@ -1341,7 +1051,7 @@ public EntryElement (string caption, string placeholder, string value, bool isPa public override string Summary () { - return Value; + return Value ?? ""; } // @@ -1353,7 +1063,15 @@ CGSize ComputeEntryPosition (UITableView tv, UITableViewCell cell) nfloat maxHeight = font.LineHeight; // Determine if we should calculate accross all sections or just the current section. - var sections = AlignEntryWithAllSections ? (Parent.Parent as RootElement).Sections : (new [] { Parent as Section }).AsEnumerable (); + IEnumerable
sections; + if (AlignEntryWithAllSections) { + var root = Parent?.Parent as RootElement; + sections = root is not null ? root.Sections : Enumerable.Empty
(); + } else if (Parent is Section section) { + sections = new [] { section }; + } else { + sections = Enumerable.Empty
(); + } foreach (Section s in sections) { @@ -1397,7 +1115,7 @@ protected override NSString CellKey { } } - UITableViewCell cell; + UITableViewCell? cell; public override UITableViewCell GetCell (UITableView tv) { if (cell is null) { @@ -1439,7 +1157,7 @@ public override UITableViewCell GetCell (UITableView tv) { FetchValue (); if (EntryEnded is not null) { - EntryEnded (this, null); + EntryEnded (this, EventArgs.Empty); } }; entry.ShouldReturn += delegate @@ -1448,8 +1166,8 @@ public override UITableViewCell GetCell (UITableView tv) if (ShouldReturn is not null) return ShouldReturn (); - RootElement root = GetImmediateRootElement (); - EntryElement focus = null; + RootElement? root = GetImmediateRootElement (); + EntryElement? focus = null; if (root is null) return true; @@ -1469,34 +1187,37 @@ public override UITableViewCell GetCell (UITableView tv) } if (focus != this) - focus.BecomeFirstResponder (true); + focus?.BecomeFirstResponder (true); else - focus.ResignFirstResponder (true); + focus?.ResignFirstResponder (true); return true; }; entry.Started += delegate { - EntryElement self = null; + EntryElement? self = null; if (EntryStarted is not null) { - EntryStarted (this, null); + EntryStarted (this, EventArgs.Empty); } - if (!returnKeyType.HasValue) { + if (!returnKeyType.HasValue && Parent is Section parentSection) { var returnType = UIReturnKeyType.Default; - foreach (var e in (Parent as Section).Elements) { + foreach (var e in parentSection.Elements) { if (e == this) self = this; else if (self is not null && e is EntryElement) returnType = UIReturnKeyType.Next; } entry.ReturnKeyType = returnType; - } else + } else if (returnKeyType.HasValue) { entry.ReturnKeyType = returnKeyType.Value; + } - tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, true); + var path = IndexPath; + if (path is not null) + tv.ScrollToRow (path, UITableViewScrollPosition.Middle, true); }; cell.ContentView.AddSubview (entry); } @@ -1565,7 +1286,9 @@ public virtual void BecomeFirstResponder (bool animated) var tv = GetContainerTableView (); if (tv is null) return; - tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, animated); + var path = IndexPath; + if (path is not null) + tv.ScrollToRow (path, UITableViewScrollPosition.Middle, animated); if (entry is not null) { entry.BecomeFirstResponder (); becomeResponder = false; @@ -1578,310 +1301,14 @@ public virtual void ResignFirstResponder (bool animated) var tv = GetContainerTableView (); if (tv is null) return; - tv.ScrollToRow (IndexPath, UITableViewScrollPosition.Middle, animated); + var path = IndexPath; + if (path is not null) + tv.ScrollToRow (path, UITableViewScrollPosition.Middle, animated); if (entry is not null) entry.ResignFirstResponder (); } } - public partial class DateTimeElement : StringElement { - public DateTime DateValue; - // There's no UIDatePicker for tvOS, so this is a read-only element for now -#if !__TVOS__ - public UIDatePicker datePicker; -#endif - public int MinuteInterval = 1; -#pragma warning disable 67 // The event 'X' is never used - public event Action DateSelected; -#pragma warning restore 67 - public UIColor BackgroundColor = (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) ? UIColor.White : UIColor.Black; - - protected internal NSDateFormatter fmt = new NSDateFormatter () { - DateStyle = NSDateFormatterStyle.Short - }; - - public DateTimeElement (string caption, DateTime date) : base (caption) - { - DateValue = date; - Value = FormatDate (date); - } - - public override UITableViewCell GetCell (UITableView tv) - { - Value = FormatDate (DateValue); - var cell = base.GetCell (tv); - cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; - cell.SelectionStyle = UITableViewCellSelectionStyle.Blue; - return cell; - } - - protected override void Dispose (bool disposing) - { - base.Dispose (disposing); - if (disposing) { - if (fmt is not null) { - fmt.Dispose (); - fmt = null; - } -#if !__TVOS__ - if (datePicker is not null) { - datePicker.Dispose (); - datePicker = null; - } -#endif // !__TVOS__ - } - } - - protected DateTime GetDateWithKind (DateTime dt) - { - if (dt.Kind == DateTimeKind.Unspecified) - return DateTime.SpecifyKind (dt, DateTimeKind.Local); - - return dt; - } - - public virtual string FormatDate (DateTime dt) - { - dt = GetDateWithKind (dt); - return fmt.ToString ((NSDate) dt) + " " + dt.ToLocalTime ().ToShortTimeString (); - } - -#if !__TVOS__ - public virtual UIDatePicker CreatePicker () - { - var picker = new UIDatePicker (CGRect.Empty) { - AutoresizingMask = UIViewAutoresizing.FlexibleMargins, - Mode = UIDatePickerMode.DateAndTime, - Date = (NSDate) GetDateWithKind (DateValue), - MinuteInterval = MinuteInterval - }; - return picker; - } - - class MyViewController : UIViewController { - DateTimeElement container; - - public MyViewController (DateTimeElement container) - { - this.container = container; - } - - public override void ViewWillDisappear (bool animated) - { - base.ViewWillDisappear (animated); - container.DateValue = (DateTime) container.datePicker.Date; - if (container.DateSelected is not null) - container.DateSelected (container); - } - - public override void DidRotate (UIInterfaceOrientation fromInterfaceOrientation) - { - base.DidRotate (fromInterfaceOrientation); - container.datePicker.Center = this.View.Center; - } - - public bool Autorotate { get; set; } - - public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation) - { - return Autorotate; - } - } - - public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) - { - var vc = new MyViewController (this) { - Autorotate = dvc.Autorotate - }; - datePicker = CreatePicker (); - - vc.View.BackgroundColor = BackgroundColor; - vc.View.AddSubview (datePicker); - dvc.ActivateController (vc); - - datePicker.Center = vc.View.Center; - } -#endif // !__TVOS__ - } - - public partial class DateElement : DateTimeElement { - public DateElement (string caption, DateTime date) : base (caption, date) - { - fmt.DateStyle = NSDateFormatterStyle.Medium; - } - - public override string FormatDate (DateTime dt) - { - return fmt.ToString ((NSDate) GetDateWithKind (dt)); - } - -#if !__TVOS__ - public override UIDatePicker CreatePicker () - { - var picker = base.CreatePicker (); - picker.Mode = UIDatePickerMode.Date; - return picker; - } -#endif // !__TVOS__ - } - - public partial class TimeElement : DateTimeElement { - public TimeElement (string caption, DateTime date) : base (caption, date) - { - } - - public override string FormatDate (DateTime dt) - { - return GetDateWithKind (dt).ToLocalTime ().ToShortTimeString (); - } - -#if !__TVOS__ - public override UIDatePicker CreatePicker () - { - var picker = base.CreatePicker (); - picker.Mode = UIDatePickerMode.Time; - picker.MinuteInterval = MinuteInterval; - return picker; - } -#endif // !__TVOS__ - } - - /// - /// This element can be used to insert an arbitrary UIView - /// - /// - /// There is no cell reuse here as we have a 1:1 mapping - /// in this case from the UIViewElement to the cell that - /// holds our view. - /// - public partial class UIViewElement : Element, IElementSizing { - static int count; - public UIView ContainerView; - NSString key; - protected UIView View; - public CellFlags Flags; - UIEdgeInsets insets; - - public UIEdgeInsets Insets { - get { - return insets; - } - set { - var viewFrame = View.Frame; - var dx = value.Left - insets.Left; - var dy = value.Top - insets.Top; - var ow = insets.Left + insets.Right; - var oh = insets.Top + insets.Bottom; - var w = value.Left + value.Right; - var h = value.Top + value.Bottom; - - ContainerView.Frame = new CGRect (0, 0, ContainerView.Frame.Width + w - ow, ContainerView.Frame.Height + h - oh); - viewFrame.X += dx; - viewFrame.Y += dy; - View.Frame = viewFrame; - - insets = value; - - // Height changed, notify UITableView - if (dy != 0 || h != oh) - GetContainerTableView ().ReloadData (); - - } - } - - [Flags] - public enum CellFlags { - Transparent = 1, - DisableSelection = 2 - } - - - /// - /// Constructor - /// - /// - /// The caption, only used for RootElements that might want to summarize results - /// - /// - /// The view to display - /// - /// - /// If this is set, then the view is responsible for painting the entire area, - /// otherwise the default cell paint code will be used. - /// - public UIViewElement (string caption, UIView view, bool transparent, UIEdgeInsets insets) : base (caption) - { - this.insets = insets; - var oframe = view.Frame; - var frame = oframe; - frame.Width += insets.Left + insets.Right; - frame.Height += insets.Top + insets.Bottom; - - ContainerView = new UIView (frame); - if ((Flags & CellFlags.Transparent) != 0) - ContainerView.BackgroundColor = UIColor.Clear; - - if (insets.Left != 0 || insets.Top != 0) - view.Frame = new CGRect (insets.Left + frame.X, insets.Top + frame.Y, frame.Width, frame.Height); - - ContainerView.AddSubview (view); - this.View = view; - this.Flags = transparent ? CellFlags.Transparent : 0; - key = new NSString ("UIViewElement" + count++); - } - - public UIViewElement (string caption, UIView view, bool transparent) : this (caption, view, transparent, UIEdgeInsets.Zero) - { - } - - protected override NSString CellKey { - get { - return key; - } - } - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (CellKey); - if (cell is null) { - cell = new UITableViewCell (UITableViewCellStyle.Default, CellKey); - if ((Flags & CellFlags.Transparent) != 0) { - cell.BackgroundColor = UIColor.Clear; - - // - // This trick is necessary to keep the background clear, otherwise - // it gets painted as black - // - cell.BackgroundView = new UIView (CGRect.Empty) { - BackgroundColor = UIColor.Clear - }; - } - if ((Flags & CellFlags.DisableSelection) != 0) - cell.SelectionStyle = UITableViewCellSelectionStyle.None; - - if (Caption is not null) - cell.TextLabel.Text = Caption; - cell.ContentView.AddSubview (ContainerView); - } - return cell; - } - - public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) - { - return ContainerView.Bounds.Height + 1; - } - - protected override void Dispose (bool disposing) - { - base.Dispose (disposing); - if (disposing) { - if (View is not null) { - View.Dispose (); - View = null; - } - } - } - } - /// /// Sections contain individual Element instances that are rendered by MonoTouch.Dialog /// @@ -1898,7 +1325,7 @@ protected override void Dispose (bool disposing) /// this uses the same storage, so you can only show one or the other. /// public class Section : Element, IEnumerable { - object header, footer; + object? header, footer; public List Elements = new List (); // X corresponds to the alignment, Y to the height of the password @@ -1915,7 +1342,7 @@ public Section () : base (null) { } /// /// The header to display /// - public Section (string caption) : base (caption) + public Section (string? caption) : base (caption) { } @@ -1928,7 +1355,7 @@ public Section (string caption) : base (caption) /// /// The footer to display. /// - public Section (string caption, string footer) : base (caption) + public Section (string? caption, string? footer) : base (caption) { Footer = footer; } @@ -1947,7 +1374,7 @@ public Section (UIView header, UIView footer) : base (null) /// /// The section header, as a string /// - public string Header { + public string? Header { get { return header as string; } @@ -1959,7 +1386,7 @@ public string Header { /// /// The section footer, as a string. /// - public string Footer { + public string? Footer { get { return footer as string; } @@ -1972,7 +1399,7 @@ public string Footer { /// /// The section's header view. /// - public UIView HeaderView { + public UIView? HeaderView { get { return header as UIView; } @@ -1984,7 +1411,7 @@ public UIView HeaderView { /// /// The section's footer view. /// - public UIView FooterView { + public UIView? FooterView { get { return footer as UIView; } @@ -2048,29 +1475,6 @@ public int Add (IEnumerable elements) return AddAll (elements); } - /// - /// Use to add a UIView to a section, it makes the section opaque, to - /// get a transparent one, you must manually call UIViewElement - public void Add (UIView view) - { - if (view is null) - return; - Add (new UIViewElement (null, view, false)); - } - - /// - /// Adds the UIViews to the section. - /// - /// - /// An enumarable list that can be produced by something like: - /// from x in ... select (UIView) new UIFoo (); - /// - public void Add (IEnumerable views) - { - foreach (var v in views) - Add (v); - } - /// /// Inserts a series of elements into the Section using the specified animation /// @@ -2094,7 +1498,7 @@ public void Insert (int idx, UITableViewRowAnimation anim, params Element [] new e.Parent = this; } var root = Parent as RootElement; - if (Parent is not null && root.TableView is not null) { + if (root is not null && root.TableView is not null) { if (anim == UITableViewRowAnimation.None) root.TableView.ReloadData (); else @@ -2271,7 +1675,6 @@ protected override void Dispose (bool disposing) if (disposing) { Parent = null; Clear (); - Elements = null; } base.Dispose (disposing); } @@ -2290,32 +1693,12 @@ public override UITableViewCell GetCell (UITableView tv) /// render a summary (Checkbox count or selected radio group). /// public class Group { - public string Key; - public Group (string key) + public string? Key; + public Group (string? key) { Key = key; } } - /// - /// Captures the information about mutually exclusive elements in a RootElement - /// - public class RadioGroup : Group { - int selected; - public virtual int Selected { - get { return selected; } - set { selected = value; } - } - - public RadioGroup (string key, int selected) : base (key) - { - this.selected = selected; - } - - public RadioGroup (int selected) : base (null) - { - this.selected = selected; - } - } /// /// RootElements are responsible for showing a full configuration page. @@ -2346,10 +1729,10 @@ public partial class RootElement : Element, IEnumerable, IEnumerable
{ static NSString rkey1 = new NSString ("RootElement1"); static NSString rkey2 = new NSString ("RootElement2"); int summarySection, summaryElement; - internal Group group; + internal Group? group; public bool UnevenRows; - public Func createOnSelected; - public UITableView TableView; + public Func? createOnSelected; + public UITableView? TableView; // This is used to indicate that we need the DVC to dispatch calls to // WillDisplayCell so we can prepare the color of the cell before @@ -2418,31 +1801,6 @@ public RootElement (string caption, Group group) : base (caption) internal List
Sections = new List
(); - internal NSIndexPath PathForRadio (int idx) - { - RadioGroup radio = group as RadioGroup; - if (radio is null) - return null; - - uint current = 0, section = 0; - foreach (Section s in Sections) { - uint row = 0; - - foreach (Element e in s.Elements) { - if (!(e is RadioElement)) - continue; - - if (current == idx) { - return NSIndexPath.Create (section, row); - } - row++; - current++; - } - section++; - } - return null; - } - public int Count { get { return Sections.Count; @@ -2468,12 +1826,8 @@ internal int IndexOf (Section target) public void Prepare () { - int current = 0; foreach (Section s in Sections) { foreach (Element e in s.Elements) { - var re = e as RadioElement; - if (re is not null) - re.RadioIdx = current++; if (UnevenRows == false && e is IElementSizing) UnevenRows = true; if (NeedColorUpdate == false && e is IColorizeBackground) @@ -2646,7 +2000,6 @@ protected override void Dispose (bool disposing) TableView = null; Clear (); - Sections = null; } } @@ -2668,23 +2021,6 @@ IEnumerator
IEnumerable
.GetEnumerator () yield return s; } - /// - /// The currently selected Radio item in the whole Root. - /// - public int RadioSelected { - get { - var radio = group as RadioGroup; - if (radio is not null) - return radio.Selected; - return -1; - } - set { - var radio = group as RadioGroup; - if (radio is not null) - radio.Selected = value; - } - } - public override UITableViewCell GetCell (UITableView tv) { NSString key = summarySection == -1 ? rkey1 : rkey2; @@ -2697,34 +2033,11 @@ public override UITableViewCell GetCell (UITableView tv) } cell.TextLabel.Text = Caption; - var radio = group as RadioGroup; - if (radio is not null) { - int selected = radio.Selected; - int current = 0; - - foreach (var s in Sections) { - foreach (var e in s.Elements) { - if (!(e is RadioElement)) - continue; - - if (current == selected) { - cell.DetailTextLabel.Text = e.Summary (); - goto le; - } - current++; - } - } - } else if (group is not null) { + if (group is not null) { int count = 0; foreach (var s in Sections) { foreach (var e in s.Elements) { - var ce = e as CheckboxElement; - if (ce is not null) { - if (ce.Value) - count++; - continue; - } var be = e as BoolElement; if (be is not null) { if (be.Value) @@ -2739,7 +2052,6 @@ public override UITableViewCell GetCell (UITableView tv) if (summaryElement < s.Elements.Count && cell.DetailTextLabel is not null) cell.DetailTextLabel.Text = s.Elements [summaryElement].Summary (); } - le: cell.Accessory = UITableViewCellAccessory.DisclosureIndicator; return cell; @@ -2784,6 +2096,8 @@ public void Reload (Section section, UITableViewRowAnimation animation) int idx = 0; foreach (var sect in Sections) { if (sect == section) { + if (TableView is null) + return; TableView.ReloadSections (new NSIndexSet ((uint) idx), animation); return; } @@ -2802,7 +2116,7 @@ public void Reload (Element element, UITableViewRowAnimation animation) if (root is null) throw new ArgumentException ("Element is not attached to this root"); var path = element.IndexPath; - if (path is null) + if (path is null || TableView is null) return; TableView.ReloadRows (new NSIndexPath [] { path }, animation); } diff --git a/tests/common/MonoTouch.Dialog/Elements/ActivityElement.cs b/tests/common/MonoTouch.Dialog/Elements/ActivityElement.cs deleted file mode 100644 index f9cfd0133a16..000000000000 --- a/tests/common/MonoTouch.Dialog/Elements/ActivityElement.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Drawing; - -using UIKit; -using CoreGraphics; -using Foundation; - -namespace MonoTouch.Dialog { - public class ActivityElement : Element { - public ActivityElement () : base ("") - { - } - - UIActivityIndicatorView indicator; - - public bool Animating { - get { - return indicator.IsAnimating; - } - set { - if (value) - indicator.StartAnimating (); - else - indicator.StopAnimating (); - } - } - - static NSString ikey = new NSString ("ActivityElement"); - - protected override NSString CellKey { - get { - return ikey; - } - } - - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (CellKey); - if (cell is null) { - cell = new UITableViewCell (UITableViewCellStyle.Default, CellKey); - } - - indicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray); - var sbounds = tv.Frame; - var vbounds = indicator.Bounds; - - indicator.Frame = new CGRect ((sbounds.Width - vbounds.Width) / 2, 12, vbounds.Width, vbounds.Height); - indicator.StartAnimating (); - - cell.Add (indicator); - - return cell; - } - - protected override void Dispose (bool disposing) - { - if (disposing) { - if (indicator is not null) { - indicator.Dispose (); - indicator = null; - } - } - base.Dispose (disposing); - } - } -} - diff --git a/tests/common/MonoTouch.Dialog/Elements/MessageElement.cs b/tests/common/MonoTouch.Dialog/Elements/MessageElement.cs deleted file mode 100644 index c17e9f242818..000000000000 --- a/tests/common/MonoTouch.Dialog/Elements/MessageElement.cs +++ /dev/null @@ -1,192 +0,0 @@ -using System; -using System.Drawing; - -using UIKit; -using Foundation; -using CoreGraphics; -using ObjCRuntime; - -namespace MonoTouch.Dialog { - - public partial class MessageSummaryView : UIView { - static UIFont SenderFont = UIFont.BoldSystemFontOfSize (19); - static UIFont SubjectFont = UIFont.SystemFontOfSize (14); - static UIFont TextFont = UIFont.SystemFontOfSize (13); - static UIFont CountFont = UIFont.BoldSystemFontOfSize (13); - public string Sender { get; private set; } - public string Body { get; private set; } - public string Subject { get; private set; } - public DateTime Date { get; private set; } - public bool NewFlag { get; private set; } - public int MessageCount { get; private set; } - - static CGGradient gradient; - - static MessageSummaryView () - { - using (var colorspace = CGColorSpace.CreateDeviceRGB ()) { - gradient = new CGGradient (colorspace, new nfloat [] { /* first */ .52f, .69f, .96f, 1, /* second */ .12f, .31f, .67f, 1 }, null); //new float [] { 0, 1 }); - } - } - - public MessageSummaryView () - { - BackgroundColor = UIColor.White; - } - - public void Update (string sender, string body, string subject, DateTime date, bool newFlag, int messageCount) - { - Sender = sender; - Body = body; - Subject = subject; - Date = date; - NewFlag = newFlag; - MessageCount = messageCount; - SetNeedsDisplay (); - } - - public override void Draw (CGRect rect) - { - const int padright = 21; - var ctx = UIGraphics.GetCurrentContext (); - nfloat boxWidth; - CGSize ssize; - - if (MessageCount > 0) { - var ms = MessageCount.ToString (); - ssize = ms.StringSize (CountFont); - boxWidth = (nfloat) Math.Min (22 + ssize.Width, 18); - var crect = new CGRect (Bounds.Width - 20 - boxWidth, 32, boxWidth, 16); - - UIColor.Gray.SetFill (); - GraphicsUtil.FillRoundedRect (ctx, crect, 3); - UIColor.White.SetColor (); - crect.X += 5; - ms.DrawString (crect, CountFont); - - boxWidth += padright; - } else - boxWidth = 0; - - UIColor.FromRGB (36, 112, 216).SetColor (); - var diff = DateTime.Now - Date; - var now = DateTime.Now; - string label; - if (now.Day == Date.Day && now.Month == Date.Month && now.Year == Date.Year) - label = Date.ToShortTimeString (); - else if (diff <= TimeSpan.FromHours (24)) - label = "Yesterday".GetText (); - else if (diff < TimeSpan.FromDays (6)) - label = Date.ToString ("dddd"); - else - label = Date.ToShortDateString (); - ssize = label.StringSize (SubjectFont); - nfloat dateSize = ssize.Width + padright + 5; - label.DrawString (new CGRect (Bounds.Width - dateSize, 6, dateSize, 14), SubjectFont, UILineBreakMode.Clip, UITextAlignment.Left); - - const int offset = 33; - nfloat bw = Bounds.Width - offset; - - UIColor.Black.SetColor (); - Sender.DrawString (new CGPoint (offset, 2), (float) (bw - dateSize), SenderFont, UILineBreakMode.TailTruncation); - Subject.DrawString (new CGPoint (offset, 23), (float) (bw - offset - boxWidth), SubjectFont, UILineBreakMode.TailTruncation); - - //UIColor.Black.SetFill (); - //ctx.FillRect (new CGRect (offset, 40, bw-boxWidth, 34)); - UIColor.Gray.SetColor (); - Body.DrawString (new CGRect (offset, 40, bw - boxWidth, 34), TextFont, UILineBreakMode.TailTruncation, UITextAlignment.Left); - - if (NewFlag) { - ctx.SaveState (); - ctx.AddEllipseInRect (new CGRect (10, 32, 12, 12)); - ctx.Clip (); - ctx.DrawLinearGradient (gradient, new CGPoint (10, 32), new CGPoint (22, 44), CGGradientDrawingOptions.DrawsAfterEndLocation); - ctx.RestoreState (); - } - -#if WANT_SHADOWS - ctx.SaveState (); - UIColor.FromRGB (78, 122, 198).SetStroke (); - ctx.SetShadow (new CGSize (1, 1), 3); - ctx.StrokeEllipseInRect (new CGRect (10, 32, 12, 12)); - ctx.RestoreState (); -#endif - } - } - - public class MessageElement : Element, IElementSizing { - static NSString mKey = new NSString ("MessageElement"); - - public string Sender, Body, Subject; - public DateTime Date; - public bool NewFlag; - public int MessageCount; - - class MessageCell : UITableViewCell { - MessageSummaryView view; - - public MessageCell () : base (UITableViewCellStyle.Default, mKey) - { - view = new MessageSummaryView (); - ContentView.Add (view); - Accessory = UITableViewCellAccessory.DisclosureIndicator; - } - - public void Update (MessageElement me) - { - view.Update (me.Sender, me.Body, me.Subject, me.Date, me.NewFlag, me.MessageCount); - } - - public override void LayoutSubviews () - { - base.LayoutSubviews (); - view.Frame = ContentView.Bounds; - view.SetNeedsDisplay (); - } - } - - public MessageElement () : base ("") - { - } - - public MessageElement (Action tapped) : base ("") - { - Tapped += tapped; - } - - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (mKey) as MessageCell; - if (cell is null) - cell = new MessageCell (); - cell.Update (this); - return cell; - } - - public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) - { - return 78; - } - - public event Action Tapped; - - public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) - { - if (Tapped is not null) - Tapped (dvc, tableView, path); - } - - public override bool Matches (string text) - { - if (Sender is not null && Sender.IndexOf (text, StringComparison.CurrentCultureIgnoreCase) != -1) - return true; - if (Body is not null && Body.IndexOf (text, StringComparison.CurrentCultureIgnoreCase) != -1) - return true; - if (Subject is not null && Subject.IndexOf (text, StringComparison.CurrentCultureIgnoreCase) != -1) - return true; - - return false; - } - } -} - diff --git a/tests/common/MonoTouch.Dialog/Elements/OwnerDrawnElement.cs b/tests/common/MonoTouch.Dialog/Elements/OwnerDrawnElement.cs deleted file mode 100644 index fdbdb37726ac..000000000000 --- a/tests/common/MonoTouch.Dialog/Elements/OwnerDrawnElement.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System; -using System.Drawing; - -using UIKit; -using CoreFoundation; -using CoreGraphics; -using Foundation; -using ObjCRuntime; - -namespace MonoTouch.Dialog { - public abstract partial class OwnerDrawnElement : Element, IElementSizing { - public string CellReuseIdentifier { - get; set; - } - - public UITableViewCellStyle Style { - get; set; - } - - public OwnerDrawnElement (UITableViewCellStyle style, string cellIdentifier) : base (null) - { - this.CellReuseIdentifier = cellIdentifier; - this.Style = style; - } - - public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) - { - return Height (tableView.Bounds); - } - - public override UITableViewCell GetCell (UITableView tv) - { - OwnerDrawnCell cell = tv.DequeueReusableCell (this.CellReuseIdentifier) as OwnerDrawnCell; - - if (cell is null) { - cell = new OwnerDrawnCell (this, this.Style, this.CellReuseIdentifier); - } else { - cell.Element = this; - } - - cell.Update (); - return cell; - } - - public abstract void Draw (CGRect bounds, CGContext context, UIView view); - - public abstract nfloat Height (CGRect bounds); - - class OwnerDrawnCell : UITableViewCell { - OwnerDrawnCellView view; - - public OwnerDrawnCell (OwnerDrawnElement element, UITableViewCellStyle style, string cellReuseIdentifier) : base (style, cellReuseIdentifier) - { - Element = element; - } - - public OwnerDrawnElement Element { - get { - return view.Element; - } - set { - if (view is null) { - view = new OwnerDrawnCellView (value); - ContentView.Add (view); - } else { - view.Element = value; - } - } - } - - - - public void Update () - { - SetNeedsDisplay (); - view.SetNeedsDisplay (); - } - - public override void LayoutSubviews () - { - base.LayoutSubviews (); - - view.Frame = ContentView.Bounds; - } - } - - class OwnerDrawnCellView : UIView { - OwnerDrawnElement element; - - public OwnerDrawnCellView (OwnerDrawnElement element) - { - this.element = element; - } - - - public OwnerDrawnElement Element { - get { return element; } - set { - element = value; - } - } - - public void Update () - { - SetNeedsDisplay (); - - } - - public override void Draw (CGRect rect) - { - CGContext context = UIGraphics.GetCurrentContext (); - element.Draw (rect, context, this); - } - } - } -} - diff --git a/tests/common/MonoTouch.Dialog/OldElements/LoadMoreElement.cs b/tests/common/MonoTouch.Dialog/OldElements/LoadMoreElement.cs deleted file mode 100644 index 59730f5cb7ec..000000000000 --- a/tests/common/MonoTouch.Dialog/OldElements/LoadMoreElement.cs +++ /dev/null @@ -1,162 +0,0 @@ -// -// This cell does not perform cell recycling, do not use as -// sample code for new elements. -// -using System; -using System.Drawing; -using System.Threading; - -using CoreFoundation; -using Foundation; -using UIKit; -using CoreGraphics; -using ObjCRuntime; - -namespace MonoTouch.Dialog { - public partial class LoadMoreElement : Element, IElementSizing { - static NSString key = new NSString ("LoadMoreElement"); - public string NormalCaption { get; set; } - public string LoadingCaption { get; set; } - public UIColor TextColor { get; set; } - public UIColor BackgroundColor { get; set; } - public event Action Tapped = null; - public UIFont Font; - public float? Height; - UITextAlignment alignment = UITextAlignment.Center; - bool animating; - - public LoadMoreElement () : base ("") - { - } - - public LoadMoreElement (string normalCaption, string loadingCaption, Action tapped) : this (normalCaption, loadingCaption, tapped, UIFont.BoldSystemFontOfSize (16), UIColor.Black) - { - } - - public LoadMoreElement (string normalCaption, string loadingCaption, Action tapped, UIFont font, UIColor textColor) : base ("") - { - NormalCaption = normalCaption; - LoadingCaption = loadingCaption; - Tapped += tapped; - Font = font; - TextColor = textColor; - } - - public override UITableViewCell GetCell (UITableView tv) - { - var cell = tv.DequeueReusableCell (key); - UIActivityIndicatorView activityIndicator; - UILabel caption; - - if (cell is null) { - cell = new UITableViewCell (UITableViewCellStyle.Default, key); - - activityIndicator = new UIActivityIndicatorView () { - ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray, - Tag = 1 - }; - caption = new UILabel () { - AdjustsFontSizeToFitWidth = false, - AutoresizingMask = UIViewAutoresizing.FlexibleWidth, - Tag = 2 - }; - cell.ContentView.AddSubview (caption); - cell.ContentView.AddSubview (activityIndicator); - } else { - activityIndicator = cell.ContentView.ViewWithTag (1) as UIActivityIndicatorView; - caption = cell.ContentView.ViewWithTag (2) as UILabel; - } - if (Animating) { - caption.Text = LoadingCaption; - activityIndicator.Hidden = false; - activityIndicator.StartAnimating (); - } else { - caption.Text = NormalCaption; - activityIndicator.Hidden = true; - activityIndicator.StopAnimating (); - } - if (BackgroundColor is not null) { - cell.ContentView.BackgroundColor = BackgroundColor ?? UIColor.Clear; - } else { - cell.ContentView.BackgroundColor = null; - } - caption.BackgroundColor = UIColor.Clear; - caption.TextColor = TextColor ?? UIColor.Black; - caption.Font = Font ?? UIFont.BoldSystemFontOfSize (16); - caption.TextAlignment = Alignment; - Layout (cell, activityIndicator, caption); - return cell; - } - - public bool Animating { - get { - return animating; - } - set { - if (animating == value) - return; - animating = value; - var cell = GetActiveCell (); - if (cell is null) - return; - var activityIndicator = cell.ContentView.ViewWithTag (1) as UIActivityIndicatorView; - var caption = cell.ContentView.ViewWithTag (2) as UILabel; - if (value) { - caption.Text = LoadingCaption; - activityIndicator.Hidden = false; - activityIndicator.StartAnimating (); - } else { - activityIndicator.StopAnimating (); - activityIndicator.Hidden = true; - caption.Text = NormalCaption; - } - Layout (cell, activityIndicator, caption); - } - } - - public override void Selected (DialogViewController dvc, UITableView tableView, NSIndexPath path) - { - tableView.DeselectRow (path, true); - - if (Animating) - return; - - if (Tapped is not null) { - Animating = true; - Tapped (this); - } - } - - CGSize GetTextSize (string text) - { - return new NSString (text).StringSize (Font, (float) UIScreen.MainScreen.Bounds.Width, UILineBreakMode.TailTruncation); - } - - const int pad = 10; - const int isize = 20; - - public nfloat GetHeight (UITableView tableView, NSIndexPath indexPath) - { - return Height ?? GetTextSize (Animating ? LoadingCaption : NormalCaption).Height + 2 * pad; - } - - void Layout (UITableViewCell cell, UIActivityIndicatorView activityIndicator, UILabel caption) - { - var sbounds = cell.ContentView.Bounds; - - var size = GetTextSize (Animating ? LoadingCaption : NormalCaption); - - if (!activityIndicator.Hidden) - activityIndicator.Frame = new CGRect ((sbounds.Width - size.Width) / 2 - isize * 2, pad, isize, isize); - - caption.Frame = new CGRect (10, pad, sbounds.Width - 20, size.Height); - } - - public UITextAlignment Alignment { - get { return alignment; } - set { alignment = value; } - } - public UITableViewCellAccessory Accessory { get; set; } - } -} - diff --git a/tests/common/MonoTouch.Dialog/Utilities/Controls.cs b/tests/common/MonoTouch.Dialog/Utilities/Controls.cs index 452af0ce9045..4d514a190aef 100644 --- a/tests/common/MonoTouch.Dialog/Utilities/Controls.cs +++ b/tests/common/MonoTouch.Dialog/Utilities/Controls.cs @@ -9,8 +9,6 @@ using Foundation; using CoreAnimation; -using MonoTouch.Dialog.Utilities; - namespace MonoTouch.Dialog { public enum RefreshViewStatus { ReleaseToReload, @@ -21,7 +19,7 @@ public enum RefreshViewStatus { // This cute method will be added to UIImage.FromResource, but for old installs // make a copy here internal static class Util { - public static UIImage FromResource (Assembly assembly, string name) + public static UIImage? FromResource (Assembly assembly, string name) { if (name is null) throw new ArgumentNullException ("name"); @@ -31,20 +29,14 @@ public static UIImage FromResource (Assembly assembly, string name) return null; try { - using (var data = NSData.FromStream (stream)) + using (var data = NSData.FromStream (stream)) { + if (data is null) + return null; return UIImage.LoadFromData (data); + } } finally { stream.Dispose (); } } - - } - - public class SearchChangedEventArgs : EventArgs { - public SearchChangedEventArgs (string text) - { - Text = text; - } - public string Text { get; set; } } } diff --git a/tests/common/MonoTouch.Dialog/Utilities/GlassButton.cs b/tests/common/MonoTouch.Dialog/Utilities/GlassButton.cs deleted file mode 100644 index 47a280ef2de6..000000000000 --- a/tests/common/MonoTouch.Dialog/Utilities/GlassButton.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Drawing; - -using UIKit; -using CoreGraphics; -using Foundation; -using CoreAnimation; -using ObjCRuntime; - -namespace MonoTouch.Dialog { - - /// - /// GlassButton is a glossy/glass button. User code can use either - /// targets or can subscribe to the Tapped event. Colors are customized - /// by asssigning to the NormalColor, HighlightedColor and DisabledColor - /// properties - /// - public class GlassButton : UIButton { - bool pressed; - - public UIColor NormalColor, HighlightedColor, DisabledColor; - - /// - /// Invoked when the user touches - /// - public event Action Tapped; - - /// - /// Creates a new instance of the GlassButton using the specified dimensions - /// - public GlassButton (CGRect frame) : base (frame) - { - NormalColor = new UIColor (0.55f, 0.04f, 0.02f, 1); - HighlightedColor = UIColor.Black; - DisabledColor = UIColor.Gray; - } - - /// - /// Whether the button is rendered enabled or not. - /// - public override bool Enabled { - get { - return base.Enabled; - } - set { - base.Enabled = value; - SetNeedsDisplay (); - } - } - - public override bool BeginTracking (UITouch uitouch, UIEvent uievent) - { - SetNeedsDisplay (); - pressed = true; - return base.BeginTracking (uitouch, uievent); - } - - public override void EndTracking (UITouch uitouch, UIEvent uievent) - { - if (pressed && Enabled) { - if (Tapped is not null) - Tapped (this); - } - pressed = false; - SetNeedsDisplay (); - base.EndTracking (uitouch, uievent); - } - - public override bool ContinueTracking (UITouch uitouch, UIEvent uievent) - { - var touch = uievent.AllTouches.AnyObject as UITouch; - if (Bounds.Contains (touch.LocationInView (this))) - pressed = true; - else - pressed = false; - return base.ContinueTracking (uitouch, uievent); - } - - public override void Draw (CGRect rect) - { - var context = UIGraphics.GetCurrentContext (); - var bounds = Bounds; - - UIColor background = Enabled ? pressed ? HighlightedColor : NormalColor : DisabledColor; - float alpha = 1; - - CGPath container; - container = GraphicsUtil.MakeRoundedRectPath (bounds, 14); - context.AddPath (container); - context.Clip (); - - using (var cs = CGColorSpace.CreateDeviceRGB ()) { - var topCenter = new CGPoint (bounds.GetMidX (), 0); - var midCenter = new CGPoint (bounds.GetMidX (), bounds.GetMidY ()); - var bottomCenter = new CGPoint (bounds.GetMidX (), bounds.GetMaxY ()); - - using (var gradient = new CGGradient (cs, new nfloat [] { 0.23f, 0.23f, 0.23f, alpha, 0.47f, 0.47f, 0.47f, alpha }, new nfloat [] { 0, 1 })) { - context.DrawLinearGradient (gradient, topCenter, bottomCenter, 0); - } - - container = GraphicsUtil.MakeRoundedRectPath (bounds.Inset (1, 1), 13); - context.AddPath (container); - context.Clip (); - using (var gradient = new CGGradient (cs, new nfloat [] { 0.05f, 0.05f, 0.05f, alpha, 0.15f, 0.15f, 0.15f, alpha }, new nfloat [] { 0, 1 })) { - context.DrawLinearGradient (gradient, topCenter, bottomCenter, 0); - } - - var nb = bounds.Inset (4, 4); - container = GraphicsUtil.MakeRoundedRectPath (nb, 10); - context.AddPath (container); - context.Clip (); - - background.SetFill (); - context.FillRect (nb); - - using (var gradient = new CGGradient (cs, new nfloat [] { 1, 1, 1, .35f, 1, 1, 1, 0.06f }, new nfloat [] { 0, 1 })) { - context.DrawLinearGradient (gradient, topCenter, midCenter, 0); - } - context.SetLineWidth (2); - context.AddPath (container); - context.ReplacePathWithStrokedPath (); - context.Clip (); - - using (var gradient = new CGGradient (cs, new nfloat [] { 1, 1, 1, 0.5f, 0.5f, 0.5f, 0.5f, 0.5f }, new nfloat [] { 0, 1 })) { - context.DrawLinearGradient (gradient, topCenter, bottomCenter, 0); - } - } - } - } -} - diff --git a/tests/common/MonoTouch.Dialog/Utilities/Graphics.cs b/tests/common/MonoTouch.Dialog/Utilities/Graphics.cs deleted file mode 100644 index a2d81835ac0b..000000000000 --- a/tests/common/MonoTouch.Dialog/Utilities/Graphics.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; - -using CoreGraphics; -using ObjCRuntime; - -namespace MonoTouch.Dialog { - public static class GraphicsUtil { - - /// - /// Creates a path for a rectangle with rounded corners - /// - /// - /// The rectangle bounds - /// - /// - /// The size of the rounded corners - /// - /// - /// A that can be used to stroke the rounded rectangle - /// - public static CGPath MakeRoundedRectPath (CGRect rect, nfloat radius) - { - nfloat minx = rect.Left; - nfloat midx = rect.Left + (rect.Width) / 2; - nfloat maxx = rect.Right; - nfloat miny = rect.Top; - nfloat midy = rect.Y + rect.Size.Height / 2; - nfloat maxy = rect.Bottom; - - var path = new CGPath (); - path.MoveToPoint (minx, midy); - path.AddArcToPoint (minx, miny, midx, miny, radius); - path.AddArcToPoint (maxx, miny, maxx, midy, radius); - path.AddArcToPoint (maxx, maxy, midx, maxy, radius); - path.AddArcToPoint (minx, maxy, minx, midy, radius); - path.CloseSubpath (); - - return path; - } - - public static void FillRoundedRect (CGContext ctx, CGRect rect, nfloat radius) - { - var p = GraphicsUtil.MakeRoundedRectPath (rect, radius); - ctx.AddPath (p); - ctx.FillPath (); - } - - public static CGPath MakeRoundedPath (float size, float radius) - { - float hsize = size / 2; - - var path = new CGPath (); - path.MoveToPoint (size, hsize); - path.AddArcToPoint (size, size, hsize, size, radius); - path.AddArcToPoint (0, size, 0, hsize, radius); - path.AddArcToPoint (0, 0, hsize, 0, radius); - path.AddArcToPoint (size, 0, size, hsize, radius); - path.CloseSubpath (); - - return path; - } - } -} - diff --git a/tests/common/MonoTouch.Dialog/Utilities/LRUCache.cs b/tests/common/MonoTouch.Dialog/Utilities/LRUCache.cs deleted file mode 100644 index cdfcf360a04e..000000000000 --- a/tests/common/MonoTouch.Dialog/Utilities/LRUCache.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// A simple LRU cache used for tracking the images -// -// Authors: -// Miguel de Icaza (miguel@gnome.org) -// -// Copyright 2010 Miguel de Icaza -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -using System; -using System.Collections.Generic; - -namespace MonoTouch.Dialog.Utilities { - - public class LRUCache where TValue : class, IDisposable { - Dictionary> dict; - Dictionary, TKey> revdict; - LinkedList list; - int entryLimit, sizeLimit, currentSize; - Func slotSizeFunc; - - public LRUCache (int entryLimit) : this (entryLimit, 0, null) - { - } - - public LRUCache (int entryLimit, int sizeLimit, Func slotSizer) - { - list = new LinkedList (); - dict = new Dictionary> (); - revdict = new Dictionary, TKey> (); - - if (sizeLimit != 0 && slotSizer is null) - throw new ArgumentNullException ("If sizeLimit is set, the slotSizer must be provided"); - - this.entryLimit = entryLimit; - this.sizeLimit = sizeLimit; - this.slotSizeFunc = slotSizer; - } - - void Evict () - { - var last = list.Last; - var key = revdict [last]; - - if (sizeLimit > 0) { - int size = slotSizeFunc (last.Value); - currentSize -= size; - } - - dict.Remove (key); - revdict.Remove (last); - list.RemoveLast (); - last.Value.Dispose (); - } - - public void Purge () - { - foreach (var element in list) - element.Dispose (); - - dict.Clear (); - revdict.Clear (); - list.Clear (); - currentSize = 0; - } - - public TValue this [TKey key] { - get { - LinkedListNode node; - - if (dict.TryGetValue (key, out node)) { - list.Remove (node); - list.AddFirst (node); - - return node.Value; - } - return null; - } - - set { - LinkedListNode node; - int size = sizeLimit > 0 ? slotSizeFunc (value) : 0; - - if (dict.TryGetValue (key, out node)) { - if (sizeLimit > 0 && node.Value is not null) { - int repSize = slotSizeFunc (node.Value); - currentSize -= repSize; - currentSize += size; - } - - // If we already have a key, move it to the front - list.Remove (node); - list.AddFirst (node); - - // Remove the old value - if (node.Value is not null) - node.Value.Dispose (); - node.Value = value; - while (sizeLimit > 0 && currentSize > sizeLimit && list.Count > 1) - Evict (); - return; - } - if (sizeLimit > 0) { - while (sizeLimit > 0 && currentSize + size > sizeLimit && list.Count > 0) - Evict (); - } - if (dict.Count >= entryLimit) - Evict (); - // Adding new node - node = new LinkedListNode (value); - list.AddFirst (node); - dict [key] = node; - revdict [node] = key; - currentSize += size; - } - } - - public override string ToString () - { - return "LRUCache dict={0} revdict={1} list={2}"; - } - } -} diff --git a/tests/common/MonoTouch.Dialog/shared.csproj b/tests/common/MonoTouch.Dialog/shared.csproj index 57d76949c7d6..dbb2c9e2083c 100644 --- a/tests/common/MonoTouch.Dialog/shared.csproj +++ b/tests/common/MonoTouch.Dialog/shared.csproj @@ -12,6 +12,8 @@ $(NoWarn);CA1422 + enable + Nullable diff --git a/tests/common/shared-dotnet.mk b/tests/common/shared-dotnet.mk index 98236b97b959..cf10c1811ad1 100644 --- a/tests/common/shared-dotnet.mk +++ b/tests/common/shared-dotnet.mk @@ -71,6 +71,10 @@ ifeq ($(TEST_TFM),) TEST_TFM=$(DOTNET_TFM) endif +ifeq ($(findstring |release|,|$(TEST_VARIATION)|),|release|) +CONFIG=Release +endif + ifeq ($(CONFIG),) CONFIG=Debug else diff --git a/tests/common/test-variations.csproj b/tests/common/test-variations.csproj index 6826b694f495..b3c26ed15647 100644 --- a/tests/common/test-variations.csproj +++ b/tests/common/test-variations.csproj @@ -6,17 +6,20 @@ + - + + + @@ -39,6 +42,11 @@ <_TestVariationApplied>true + + true + <_TestVariationApplied>true + + true <_TestVariationApplied>true @@ -52,6 +60,7 @@ true <_IsPublishing>true + full <_TestVariationApplied>true @@ -75,6 +84,11 @@ <_TestVariationApplied>true + + dynamic + <_TestVariationApplied>true + + static <_TestVariationApplied>true @@ -103,6 +117,11 @@ <_TestVariationApplied>true + + managed-static + <_TestVariationApplied>true + + $(AppBundleExtraOptions) --optimize:all managed-static diff --git a/tests/dotnet/UnitTests/MlaunchTest.cs b/tests/dotnet/UnitTests/MlaunchTest.cs index 012cf76ba6a7..fb7c3b9ba8b5 100644 --- a/tests/dotnet/UnitTests/MlaunchTest.cs +++ b/tests/dotnet/UnitTests/MlaunchTest.cs @@ -29,7 +29,13 @@ public void GetMlaunchInstallArguments (ApplePlatform platform, string runtimeId DotNet.Execute ("build", project_path, properties, target: "_DetectSdkLocations;_DetectAppManifest;_CompileAppManifest;_WriteAppManifest"); properties ["MlaunchInstallScript"] = outputPath; - var rv = DotNet.Execute ("build", project_path, properties, target: "ComputeMlaunchInstallArguments"); + var rv = DotNet.Execute ("build", project_path, properties, assert_success: false, target: "ComputeMlaunchInstallArguments"); + + if (rv.ExitCode != 0) { + var errors = BinLog.GetBuildLogErrors (rv.BinLogPath).Select (v => v.Message).OfType ().ToArray (); + Assert.That (string.Join ("\n", errors), Does.Contain ("No applicable and available devices found.")); + return; + } if (!BinLog.TryFindPropertyValue (rv.BinLogPath, "MlaunchInstallArguments", out var mlaunchInstallArguments)) Assert.Fail ("Could not find the property 'MlaunchInstallArguments' in the binlog."); @@ -52,9 +58,9 @@ public void GetMlaunchInstallArguments (ApplePlatform platform, string runtimeId public static object [] GetMlaunchRunArgumentsTestCases () { return new object [] { - new object [] {ApplePlatform.iOS, "iossimulator-x64;iossimulator-arm64", $":v2:runtime=com.apple.CoreSimulator.SimRuntime.iOS-{SdkVersions.iOS.Replace('.', '-')},devicetype=com.apple.CoreSimulator.SimDeviceType.iPhone-.*" }, + new object [] {ApplePlatform.iOS, "iossimulator-x64;iossimulator-arm64", @":v2:udid=[A-F0-9-]+" }, new object [] {ApplePlatform.iOS, "ios-arm64", "" }, - new object [] {ApplePlatform.TVOS, "tvossimulator-arm64", $":v2:runtime=com.apple.CoreSimulator.SimRuntime.tvOS-{SdkVersions.TVOS.Replace('.', '-')},devicetype=com.apple.CoreSimulator.SimDeviceType.Apple-TV-.*" }, + new object [] {ApplePlatform.TVOS, "tvossimulator-arm64", @":v2:udid=[A-F0-9-]+" }, }; } @@ -75,7 +81,13 @@ public void GetMlaunchRunArguments (ApplePlatform platform, string runtimeIdenti DotNet.Execute ("build", project_path, properties, target: "_DetectSdkLocations;_DetectAppManifest;_CompileAppManifest;_WriteAppManifest"); properties ["MlaunchRunScript"] = outputPath; - var rv = DotNet.Execute ("build", project_path, properties, target: "ComputeMlaunchRunArguments"); + var rv = DotNet.Execute ("build", project_path, properties, assert_success: false, target: "ComputeMlaunchRunArguments"); + + if (rv.ExitCode != 0) { + var errors = BinLog.GetBuildLogErrors (rv.BinLogPath).Select (v => v.Message).OfType ().ToArray (); + Assert.That (string.Join ("\n", errors), Does.Contain ("No applicable and available devices found.")); + return; + } if (!BinLog.TryFindPropertyValue (rv.BinLogPath, "MlaunchRunArguments", out var mlaunchRunArguments)) Assert.Fail ("Could not find the property 'MlaunchRunArguments' in the binlog."); diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt index bae1a53527ef..3166fc0d9998 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt @@ -202,6 +202,7 @@ Microsoft.MacCatalyst.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandl Microsoft.MacCatalyst.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.MacCatalyst.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.ToString() Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -732,6 +733,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runt Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -861,6 +863,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(S Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector Microsoft.MacCatalyst.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..cctor() Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -916,6 +919,7 @@ Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1170,6 +1174,7 @@ Microsoft.MacCatalyst.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.I Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5421,7 +5426,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8248,6 +8287,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16215,7 +16255,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt index 52296732607c..1188b2ae0ed2 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 10,462,655 bytes (10,217.4 KB = 10.0 MB) +AppBundleSize: 10,463,475 bytes (10,218.2 KB = 10.0 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 4,951 bytes (4.8 KB = 0.0 MB) -Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 242,304 bytes (236.6 KB = 0.2 MB) +Contents/Info.plist: 1,099 bytes (1.1 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 242,128 bytes (236.5 KB = 0.2 MB) Contents/MonoBundle/libcoreclr.dylib: 6,386,608 bytes (6,236.9 KB = 6.1 MB) Contents/MonoBundle/libSystem.Globalization.Native.dylib: 110,432 bytes (107.8 KB = 0.1 MB) Contents/MonoBundle/libSystem.IO.Compression.Native.dylib: 1,442,208 bytes (1,408.4 KB = 1.4 MB) @@ -16,7 +16,7 @@ Contents/MonoBundle/System.Collections.Immutable.dll: 14,848 bytes (14.5 KB = 0. Contents/MonoBundle/System.Diagnostics.StackTrace.dll: 8,192 bytes (8.0 KB = 0.0 MB) Contents/MonoBundle/System.IO.Compression.dll: 22,528 bytes (22.0 KB = 0.0 MB) Contents/MonoBundle/System.IO.MemoryMappedFiles.dll: 22,016 bytes (21.5 KB = 0.0 MB) -Contents/MonoBundle/System.Private.CoreLib.dll: 1,575,936 bytes (1,539.0 KB = 1.5 MB) +Contents/MonoBundle/System.Private.CoreLib.dll: 1,576,960 bytes (1,540.0 KB = 1.5 MB) Contents/MonoBundle/System.Reflection.Metadata.dll: 84,480 bytes (82.5 KB = 0.1 MB) Contents/MonoBundle/System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) Contents/MonoBundle/System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt index bae1a53527ef..3166fc0d9998 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt @@ -202,6 +202,7 @@ Microsoft.MacCatalyst.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandl Microsoft.MacCatalyst.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.MacCatalyst.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.ToString() Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -732,6 +733,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runt Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -861,6 +863,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(S Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector Microsoft.MacCatalyst.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..cctor() Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -916,6 +919,7 @@ Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1170,6 +1174,7 @@ Microsoft.MacCatalyst.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.I Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5421,7 +5426,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8248,6 +8287,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16215,7 +16255,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt index a8ee0d849612..25f95b4add07 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 19,318,489 bytes (18,865.7 KB = 18.4 MB) +AppBundleSize: 19,324,509 bytes (18,871.6 KB = 18.4 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 5,105 bytes (5.0 KB = 0.0 MB) -Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 242,336 bytes (236.7 KB = 0.2 MB) +Contents/Info.plist: 1,099 bytes (1.1 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 242,176 bytes (236.5 KB = 0.2 MB) Contents/MonoBundle/libcoreclr.dylib: 6,386,608 bytes (6,236.9 KB = 6.1 MB) Contents/MonoBundle/libSystem.Globalization.Native.dylib: 110,432 bytes (107.8 KB = 0.1 MB) Contents/MonoBundle/libSystem.IO.Compression.Native.dylib: 1,442,208 bytes (1,408.4 KB = 1.4 MB) @@ -12,12 +12,12 @@ Contents/MonoBundle/libSystem.Security.Cryptography.Native.Apple.dylib: 204,768 Contents/MonoBundle/Microsoft.MacCatalyst.dll: 101,888 bytes (99.5 KB = 0.1 MB) Contents/MonoBundle/runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) Contents/MonoBundle/SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) -Contents/MonoBundle/SizeTestApp.r2r.dylib: 8,841,824 bytes (8,634.6 KB = 8.4 MB) +Contents/MonoBundle/SizeTestApp.r2r.dylib: 8,847,008 bytes (8,639.7 KB = 8.4 MB) Contents/MonoBundle/System.Collections.Immutable.dll: 13,824 bytes (13.5 KB = 0.0 MB) Contents/MonoBundle/System.Diagnostics.StackTrace.dll: 7,680 bytes (7.5 KB = 0.0 MB) Contents/MonoBundle/System.IO.Compression.dll: 22,016 bytes (21.5 KB = 0.0 MB) Contents/MonoBundle/System.IO.MemoryMappedFiles.dll: 21,504 bytes (21.0 KB = 0.0 MB) -Contents/MonoBundle/System.Private.CoreLib.dll: 1,594,368 bytes (1,557.0 KB = 1.5 MB) +Contents/MonoBundle/System.Private.CoreLib.dll: 1,595,392 bytes (1,558.0 KB = 1.5 MB) Contents/MonoBundle/System.Reflection.Metadata.dll: 83,968 bytes (82.0 KB = 0.1 MB) Contents/MonoBundle/System.Runtime.dll: 4,096 bytes (4.0 KB = 0.0 MB) Contents/MonoBundle/System.Runtime.InteropServices.dll: 7,680 bytes (7.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt index fcd8fc077754..e4e8281db97c 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt @@ -168,6 +168,7 @@ Microsoft.MacCatalyst.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandl Microsoft.MacCatalyst.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.MacCatalyst.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.MacCatalyst.dll:Foundation.NSObject.ToString() Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.MacCatalyst.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -559,6 +560,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.ObjCException.get_Reason() Microsoft.MacCatalyst.dll:ObjCRuntime.ObjCException.ToString() Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol..cctor() Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Protocol.get_Handle() @@ -706,6 +708,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterEntryAssembly(System.Refle Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.RetainNativeObject(System.IntPtr) @@ -784,6 +787,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(S Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector Microsoft.MacCatalyst.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..cctor() Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -1208,6 +1212,7 @@ Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.MacCatalyst.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1597,6 +1602,7 @@ Microsoft.MacCatalyst.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.I Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -4053,7 +4059,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -6179,6 +6219,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -12261,7 +12302,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt index d32b6ab9da0e..3828d79e6957 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt @@ -1,13 +1,13 @@ -AppBundleSize: 5,810,794 bytes (5,674.6 KB = 5.5 MB) +AppBundleSize: 5,814,166 bytes (5,677.9 KB = 5.5 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 3,310 bytes (3.2 KB = 0.0 MB) -Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 4,568,080 bytes (4,461.0 KB = 4.4 MB) -Contents/MonoBundle/Microsoft.MacCatalyst.dll: 157,184 bytes (153.5 KB = 0.1 MB) +Contents/Info.plist: 1,099 bytes (1.1 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 4,569,408 bytes (4,462.3 KB = 4.4 MB) +Contents/MonoBundle/Microsoft.MacCatalyst.dll: 157,696 bytes (154.0 KB = 0.2 MB) Contents/MonoBundle/runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB) Contents/MonoBundle/SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) -Contents/MonoBundle/System.Private.CoreLib.aotdata.arm64: 41,344 bytes (40.4 KB = 0.0 MB) -Contents/MonoBundle/System.Private.CoreLib.dll: 1,017,344 bytes (993.5 KB = 1.0 MB) +Contents/MonoBundle/System.Private.CoreLib.aotdata.arm64: 41,368 bytes (40.4 KB = 0.0 MB) +Contents/MonoBundle/System.Private.CoreLib.dll: 1,018,880 bytes (995.0 KB = 1.0 MB) Contents/MonoBundle/System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) Contents/MonoBundle/System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) Contents/PkgInfo: 8 bytes (0.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt index ecf93e2db870..7d60ba11ece8 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt @@ -613,6 +613,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(S Microsoft.MacCatalyst.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector Microsoft.MacCatalyst.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..cctor() Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -902,6 +903,7 @@ Microsoft.MacCatalyst.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.I Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.MacCatalyst.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -3218,7 +3220,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -5328,6 +5364,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -9926,7 +9963,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt index 3f1eea8d165c..f69e6829026d 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt @@ -1,16 +1,16 @@ -AppBundleSize: 16,519,582 bytes (16,132.4 KB = 15.8 MB) +AppBundleSize: 16,525,506 bytes (16,138.2 KB = 15.8 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 4,134 bytes (4.0 KB = 0.0 MB) -Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 13,980,208 bytes (13,652.5 KB = 13.3 MB) +Contents/Info.plist: 1,099 bytes (1.1 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 13,984,464 bytes (13,656.7 KB = 13.3 MB) Contents/MonoBundle/aot-instances.aotdata.arm64: 1,037,632 bytes (1,013.3 KB = 1.0 MB) -Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 35,896 bytes (35.1 KB = 0.0 MB) -Contents/MonoBundle/Microsoft.MacCatalyst.dll: 50,688 bytes (49.5 KB = 0.0 MB) +Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 35,976 bytes (35.1 KB = 0.0 MB) +Contents/MonoBundle/Microsoft.MacCatalyst.dll: 51,200 bytes (50.0 KB = 0.0 MB) Contents/MonoBundle/runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -Contents/MonoBundle/SizeTestApp.aotdata.arm64: 1,544 bytes (1.5 KB = 0.0 MB) +Contents/MonoBundle/SizeTestApp.aotdata.arm64: 1,552 bytes (1.5 KB = 0.0 MB) Contents/MonoBundle/SizeTestApp.dll: 7,168 bytes (7.0 KB = 0.0 MB) -Contents/MonoBundle/System.Private.CoreLib.aotdata.arm64: 844,752 bytes (825.0 KB = 0.8 MB) -Contents/MonoBundle/System.Private.CoreLib.dll: 540,672 bytes (528.0 KB = 0.5 MB) +Contents/MonoBundle/System.Private.CoreLib.aotdata.arm64: 844,824 bytes (825.0 KB = 0.8 MB) +Contents/MonoBundle/System.Private.CoreLib.dll: 541,696 bytes (529.0 KB = 0.5 MB) Contents/MonoBundle/System.Runtime.aotdata.arm64: 472 bytes (0.5 KB = 0.0 MB) Contents/MonoBundle/System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) Contents/MonoBundle/System.Runtime.InteropServices.aotdata.arm64: 488 bytes (0.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt index f7f8b17f8ef6..2c53322aefb9 100644 --- a/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt +++ b/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-size.txt @@ -1,7 +1,7 @@ -AppBundleSize: 2,484,597 bytes (2,426.4 KB = 2.4 MB) +AppBundleSize: 2,815,241 bytes (2,749.3 KB = 2.7 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 2,358 bytes (2.3 KB = 0.0 MB) -Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 2,479,296 bytes (2,421.2 KB = 2.4 MB) +Contents/Info.plist: 1,099 bytes (1.1 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 2,809,968 bytes (2,744.1 KB = 2.7 MB) Contents/MonoBundle/runtimeconfig.bin: 1,808 bytes (1.8 KB = 0.0 MB) Contents/PkgInfo: 8 bytes (0.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt index 86d3abbce79f..38ac47ac2bbc 100644 --- a/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 246,987,190 bytes (241,198.4 KB = 235.5 MB) +AppBundleSize: 246,986,938 bytes (241,198.2 KB = 235.5 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 54,948 bytes (53.7 KB = 0.1 MB) -Contents/Info.plist: 758 bytes (0.7 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 7,964,176 bytes (7,777.5 KB = 7.6 MB) +Contents/Info.plist: 730 bytes (0.7 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 7,963,952 bytes (7,777.3 KB = 7.6 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.CSharp.dll: 884,224 bytes (863.5 KB = 0.8 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Caching.Abstractions.dll: 56,320 bytes (55.0 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Configuration.Abstractions.dll: 28,160 bytes (27.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-R2R-size.txt index 50a019e41ebb..ddb515429633 100644 --- a/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-R2R-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 313,860,022 bytes (306,503.9 KB = 299.3 MB) +AppBundleSize: 313,861,306 bytes (306,505.2 KB = 299.3 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 54,948 bytes (53.7 KB = 0.1 MB) -Contents/Info.plist: 758 bytes (0.7 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 7,964,176 bytes (7,777.5 KB = 7.6 MB) +Contents/Info.plist: 730 bytes (0.7 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 7,963,952 bytes (7,777.3 KB = 7.6 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.CSharp.dll: 884,224 bytes (863.5 KB = 0.8 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Caching.Abstractions.dll: 56,320 bytes (55.0 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Configuration.Abstractions.dll: 28,160 bytes (27.5 KB = 0.0 MB) @@ -13,7 +13,7 @@ Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Hosting.Abstractions Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Logging.Abstractions.dll: 147,456 bytes (144.0 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Options.dll: 133,632 bytes (130.5 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Primitives.dll: 70,144 bytes (68.5 KB = 0.1 MB) -Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.macOS.dll: 75,899,904 bytes (74,121.0 KB = 72.4 MB) +Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.macOS.dll: 75,900,928 bytes (74,122.0 KB = 72.4 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.VisualBasic.Core.dll: 1,324,544 bytes (1,293.5 KB = 1.3 MB) Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Win32.Registry.dll: 24,064 bytes (23.5 KB = 0.0 MB) Contents/MonoBundle/.xamarin/osx-arm64/SizeTestApp.dll: 10,240 bytes (10.0 KB = 0.0 MB) @@ -116,7 +116,7 @@ Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Hosting.Abstractions.d Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Logging.Abstractions.dll: 132,096 bytes (129.0 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Options.dll: 118,272 bytes (115.5 KB = 0.1 MB) Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Primitives.dll: 63,488 bytes (62.0 KB = 0.1 MB) -Contents/MonoBundle/.xamarin/osx-x64/Microsoft.macOS.dll: 64,387,072 bytes (62,878.0 KB = 61.4 MB) +Contents/MonoBundle/.xamarin/osx-x64/Microsoft.macOS.dll: 64,387,584 bytes (62,878.5 KB = 61.4 MB) Contents/MonoBundle/.xamarin/osx-x64/Microsoft.VisualBasic.Core.dll: 1,155,072 bytes (1,128.0 KB = 1.1 MB) Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Win32.Registry.dll: 24,064 bytes (23.5 KB = 0.0 MB) Contents/MonoBundle/.xamarin/osx-x64/SizeTestApp.dll: 9,728 bytes (9.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt index 69e2ea91eb8f..0a5e2c42e299 100644 --- a/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt +++ b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 5,331,129 bytes (5,206.2 KB = 5.1 MB) +AppBundleSize: 6,087,693 bytes (5,945.0 KB = 5.8 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: Contents/_CodeSignature/CodeResources: 2,644 bytes (2.6 KB = 0.0 MB) -Contents/Info.plist: 758 bytes (0.7 KB = 0.0 MB) -Contents/MacOS/SizeTestApp: 5,325,712 bytes (5,200.9 KB = 5.1 MB) +Contents/Info.plist: 730 bytes (0.7 KB = 0.0 MB) +Contents/MacOS/SizeTestApp: 6,082,304 bytes (5,939.8 KB = 5.8 MB) Contents/MonoBundle/runtimeconfig.bin: 1,766 bytes (1.7 KB = 0.0 MB) Contents/PkgInfo: 8 bytes (0.0 KB = 0.0 MB) Contents/Resources/archived-expanded-entitlements.xcent: 241 bytes (0.2 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt index 09ce87f7100d..a8f9cd53db1a 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt @@ -194,6 +194,7 @@ Microsoft.tvOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.tvOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.ToString() Microsoft.tvOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.tvOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -726,6 +727,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runtime/Ini Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.tvOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.tvOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.tvOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -855,6 +857,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.R Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector Microsoft.tvOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.tvOS.dll:ObjCRuntime.Selector..cctor() Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -909,6 +912,7 @@ Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1161,6 +1165,7 @@ Microsoft.tvOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, S Microsoft.tvOS.dll:UIKit.UIApplicationDelegate Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5410,7 +5415,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8198,6 +8237,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16157,7 +16197,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt index 4f15e6a6995f..d0985c362b6c 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt @@ -1,24 +1,24 @@ -AppBundleSize: 9,185,218 bytes (8,969.9 KB = 8.8 MB) +AppBundleSize: 9,187,098 bytes (8,971.8 KB = 8.8 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 9,851 bytes (9.6 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 817 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 789 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,216,464 bytes (5,094.2 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,776 bytes (107.2 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 833 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,536 bytes (1,405.8 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/Info.plist: 803 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Native.framework/libSystem.Native: 162,480 bytes (158.7 KB = 0.2 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 887 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 195,232 bytes (190.7 KB = 0.2 MB) -Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) -Microsoft.tvOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) +Info.plist: 1,117 bytes (1.1 KB = 0.0 MB) +Microsoft.tvOS.dll: 99,328 bytes (97.0 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) SizeTestApp: 197,024 bytes (192.4 KB = 0.2 MB) @@ -27,7 +27,7 @@ System.Collections.Immutable.dll: 14,848 bytes (14.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 8,192 bytes (8.0 KB = 0.0 MB) System.IO.Compression.dll: 22,528 bytes (22.0 KB = 0.0 MB) System.IO.MemoryMappedFiles.dll: 22,016 bytes (21.5 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,566,720 bytes (1,530.0 KB = 1.5 MB) +System.Private.CoreLib.dll: 1,568,256 bytes (1,531.5 KB = 1.5 MB) System.Reflection.Metadata.dll: 84,480 bytes (82.5 KB = 0.1 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt index 09ce87f7100d..a8f9cd53db1a 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt @@ -194,6 +194,7 @@ Microsoft.tvOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.tvOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.ToString() Microsoft.tvOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.tvOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -726,6 +727,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runtime/Ini Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.tvOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.tvOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.tvOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -855,6 +857,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.R Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector Microsoft.tvOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.tvOS.dll:ObjCRuntime.Selector..cctor() Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -909,6 +912,7 @@ Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1161,6 +1165,7 @@ Microsoft.tvOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, S Microsoft.tvOS.dll:UIKit.UIApplicationDelegate Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5410,7 +5415,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8198,6 +8237,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16157,7 +16197,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt index bab1f12350a2..805b44955d1f 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt @@ -1,26 +1,26 @@ -AppBundleSize: 12,627,234 bytes (12,331.3 KB = 12.0 MB) +AppBundleSize: 12,628,622 bytes (12,332.6 KB = 12.0 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 10,705 bytes (10.5 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 817 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 789 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,216,464 bytes (5,094.2 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,776 bytes (107.2 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 861 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 833 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,536 bytes (1,405.8 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 831 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/Info.plist: 803 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Native.framework/libSystem.Native: 162,480 bytes (158.7 KB = 0.2 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 887 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 859 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 195,232 bytes (190.7 KB = 0.2 MB) Frameworks/SizeTestApp.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/Info.plist: 820 bytes (0.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/SizeTestApp: 3,424,640 bytes (3,344.4 KB = 3.3 MB) -Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/Info.plist: 792 bytes (0.8 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/SizeTestApp: 3,424,688 bytes (3,344.4 KB = 3.3 MB) +Info.plist: 1,117 bytes (1.1 KB = 0.0 MB) Microsoft.tvOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) @@ -30,7 +30,7 @@ System.Collections.Immutable.dll: 13,824 bytes (13.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 7,680 bytes (7.5 KB = 0.0 MB) System.IO.Compression.dll: 22,016 bytes (21.5 KB = 0.0 MB) System.IO.MemoryMappedFiles.dll: 21,504 bytes (21.0 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,585,152 bytes (1,548.0 KB = 1.5 MB) +System.Private.CoreLib.dll: 1,586,688 bytes (1,549.5 KB = 1.5 MB) System.Reflection.Metadata.dll: 83,968 bytes (82.0 KB = 0.1 MB) System.Runtime.dll: 4,096 bytes (4.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 7,680 bytes (7.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt index 222b8602f014..3affd336a1fe 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt @@ -160,6 +160,7 @@ Microsoft.tvOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.tvOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.tvOS.dll:Foundation.NSObject.ToString() Microsoft.tvOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.tvOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -554,6 +555,7 @@ Microsoft.tvOS.dll:ObjCRuntime.ObjCException.get_Reason() Microsoft.tvOS.dll:ObjCRuntime.ObjCException.ToString() Microsoft.tvOS.dll:ObjCRuntime.Protocol Microsoft.tvOS.dll:ObjCRuntime.Protocol._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.tvOS.dll:ObjCRuntime.Protocol..cctor() Microsoft.tvOS.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:ObjCRuntime.Protocol.get_Handle() @@ -702,6 +704,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterEntryAssembly(System.Reflection.A Microsoft.tvOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.tvOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.tvOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.tvOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.tvOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) Microsoft.tvOS.dll:ObjCRuntime.Runtime.RetainNativeObject(System.IntPtr) @@ -780,6 +783,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.R Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector Microsoft.tvOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.tvOS.dll:ObjCRuntime.Selector..cctor() Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -1200,6 +1204,7 @@ Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.tvOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.tvOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.tvOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1585,6 +1590,7 @@ Microsoft.tvOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, S Microsoft.tvOS.dll:UIKit.UIApplicationDelegate Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -4038,7 +4044,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -6120,6 +6160,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -12186,7 +12227,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt index 384ad734243a..8fd6cd4deab4 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt @@ -1,14 +1,14 @@ -AppBundleSize: 3,636,285 bytes (3,551.1 KB = 3.5 MB) +AppBundleSize: 3,637,817 bytes (3,552.6 KB = 3.5 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 3,999 bytes (3.9 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,117 bytes (1.1 KB = 0.0 MB) Microsoft.tvOS.dll: 154,624 bytes (151.0 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB) SizeTestApp: 2,404,688 bytes (2,348.3 KB = 2.3 MB) SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 41,424 bytes (40.5 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,007,616 bytes (984.0 KB = 1.0 MB) +System.Private.CoreLib.aotdata.arm64: 41,448 bytes (40.5 KB = 0.0 MB) +System.Private.CoreLib.dll: 1,009,152 bytes (985.5 KB = 1.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt index 4d307e99a8b2..966bd5c2ebca 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt @@ -609,6 +609,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.R Microsoft.tvOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector Microsoft.tvOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.tvOS.dll:ObjCRuntime.Selector..cctor() Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -895,6 +896,7 @@ Microsoft.tvOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, S Microsoft.tvOS.dll:UIKit.UIApplicationDelegate Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.tvOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -3208,7 +3210,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -5275,6 +5311,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -9862,7 +9899,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt index 329c025207ce..76e4c9384a09 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt @@ -1,18 +1,18 @@ -AppBundleSize: 9,502,243 bytes (9,279.5 KB = 9.1 MB) +AppBundleSize: 9,503,383 bytes (9,280.6 KB = 9.1 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 5,233 bytes (5.1 KB = 0.0 MB) aot-instances.aotdata.arm64: 818,536 bytes (799.4 KB = 0.8 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) -Microsoft.tvOS.aotdata.arm64: 22,552 bytes (22.0 KB = 0.0 MB) +Info.plist: 1,117 bytes (1.1 KB = 0.0 MB) +Microsoft.tvOS.aotdata.arm64: 22,584 bytes (22.1 KB = 0.0 MB) Microsoft.tvOS.dll: 49,152 bytes (48.0 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 7,377,120 bytes (7,204.2 KB = 7.0 MB) -SizeTestApp.aotdata.arm64: 1,456 bytes (1.4 KB = 0.0 MB) +SizeTestApp: 7,377,152 bytes (7,204.2 KB = 7.0 MB) +SizeTestApp.aotdata.arm64: 1,464 bytes (1.4 KB = 0.0 MB) SizeTestApp.dll: 7,168 bytes (7.0 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 665,512 bytes (649.9 KB = 0.6 MB) -System.Private.CoreLib.dll: 537,600 bytes (525.0 KB = 0.5 MB) +System.Private.CoreLib.aotdata.arm64: 665,584 bytes (650.0 KB = 0.6 MB) +System.Private.CoreLib.dll: 538,624 bytes (526.0 KB = 0.5 MB) System.Runtime.aotdata.arm64: 784 bytes (0.8 KB = 0.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.aotdata.arm64: 800 bytes (0.8 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt index 92237dc4ef63..daacc6d7e0dc 100644 --- a/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt +++ b/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 2,500,494 bytes (2,441.9 KB = 2.4 MB) +AppBundleSize: 2,849,442 bytes (2,782.7 KB = 2.7 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 2,589 bytes (2.5 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,145 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,117 bytes (1.1 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,808 bytes (1.8 KB = 0.0 MB) -SizeTestApp: 2,494,560 bytes (2,436.1 KB = 2.4 MB) +SizeTestApp: 2,843,536 bytes (2,776.9 KB = 2.7 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt index ff567cb5e6f0..56bf48e17967 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt @@ -194,6 +194,7 @@ Microsoft.iOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.iOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.ToString() Microsoft.iOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.iOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -726,6 +727,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runtime/Init Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.iOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.iOS.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.iOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.iOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -855,6 +857,7 @@ Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.Ru Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector Microsoft.iOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.iOS.dll:ObjCRuntime.Selector..cctor() Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -909,6 +912,7 @@ Microsoft.iOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.iOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.iOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1161,6 +1165,7 @@ Microsoft.iOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, Sy Microsoft.iOS.dll:UIKit.UIApplicationDelegate Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.iOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5410,7 +5415,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8198,6 +8237,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16157,7 +16197,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt index 7c475d83d770..612738da6cc9 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt @@ -1,27 +1,27 @@ -AppBundleSize: 9,253,485 bytes (9,036.6 KB = 8.8 MB) +AppBundleSize: 9,255,337 bytes (9,038.4 KB = 8.8 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 10,847 bytes (10.6 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 841 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 813 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,203,936 bytes (5,082.0 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 883 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 855 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,232 bytes (106.7 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 885 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 857 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,280 bytes (1,397.7 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 855 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/Info.plist: 827 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Native.framework/libSystem.Native: 162,256 bytes (158.5 KB = 0.2 MB) Frameworks/libSystem.Net.Security.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 881 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 853 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,000 bytes (85.9 KB = 0.1 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 911 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 883 bytes (0.9 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 194,256 bytes (189.7 KB = 0.2 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) -Microsoft.iOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) +Info.plist: 1,141 bytes (1.1 KB = 0.0 MB) +Microsoft.iOS.dll: 99,328 bytes (97.0 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) SizeTestApp: 196,000 bytes (191.4 KB = 0.2 MB) @@ -30,7 +30,7 @@ System.Collections.Immutable.dll: 14,848 bytes (14.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 8,192 bytes (8.0 KB = 0.0 MB) System.IO.Compression.dll: 22,528 bytes (22.0 KB = 0.0 MB) System.IO.MemoryMappedFiles.dll: 22,016 bytes (21.5 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,566,720 bytes (1,530.0 KB = 1.5 MB) +System.Private.CoreLib.dll: 1,568,256 bytes (1,531.5 KB = 1.5 MB) System.Reflection.Metadata.dll: 84,480 bytes (82.5 KB = 0.1 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt index ff567cb5e6f0..56bf48e17967 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt @@ -194,6 +194,7 @@ Microsoft.iOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.iOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.ToString() Microsoft.iOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.iOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -726,6 +727,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterDelegates(ObjCRuntime.Runtime/Init Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.iOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.iOS.dll:ObjCRuntime.Runtime.ResolvingEventHandler(System.Runtime.Loader.AssemblyLoadContext, System.Reflection.AssemblyName) Microsoft.iOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.iOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) @@ -855,6 +857,7 @@ Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.Ru Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector Microsoft.iOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.iOS.dll:ObjCRuntime.Selector..cctor() Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -909,6 +912,7 @@ Microsoft.iOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.iOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.iOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1161,6 +1165,7 @@ Microsoft.iOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, Sy Microsoft.iOS.dll:UIKit.UIApplicationDelegate Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.iOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -5410,7 +5415,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -8198,6 +8237,7 @@ System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/BinderState::_origi System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ System.Private.CoreLib.dll:System.Int32 System.Delegate/InvocationListEnumerator`1::_index System.Private.CoreLib.dll:System.Int32 System.DelegateBindingFlags::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.Contracts.ContractFailureKind::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.StackFrame::_columnNumber @@ -16157,7 +16197,9 @@ System.Private.CoreLib.dll:System.String System.Boolean::TrueString System.Private.CoreLib.dll:System.String System.Byte::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.Char::System.IBinaryIntegerParseAndFormatInfo.OverflowMessage() System.Private.CoreLib.dll:System.String System.CharEnumerator::_str +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_condition System.Private.CoreLib.dll:System.String System.Diagnostics.Contracts.ContractException::_userMessage System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt index f64e6452c0a2..7256e3308504 100644 --- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt @@ -1,29 +1,29 @@ -AppBundleSize: 12,675,685 bytes (12,378.6 KB = 12.1 MB) +AppBundleSize: 12,677,045 bytes (12,379.9 KB = 12.1 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 11,701 bytes (11.4 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) Frameworks/libcoreclr.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libcoreclr.framework/Info.plist: 841 bytes (0.8 KB = 0.0 MB) +Frameworks/libcoreclr.framework/Info.plist: 813 bytes (0.8 KB = 0.0 MB) Frameworks/libcoreclr.framework/libcoreclr: 5,203,936 bytes (5,082.0 KB = 5.0 MB) Frameworks/libSystem.Globalization.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Globalization.Native.framework/Info.plist: 883 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Globalization.Native.framework/Info.plist: 855 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Globalization.Native.framework/libSystem.Globalization.Native: 109,232 bytes (106.7 KB = 0.1 MB) Frameworks/libSystem.IO.Compression.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 885 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.IO.Compression.Native.framework/Info.plist: 857 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,280 bytes (1,397.7 KB = 1.4 MB) Frameworks/libSystem.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Native.framework/Info.plist: 855 bytes (0.8 KB = 0.0 MB) +Frameworks/libSystem.Native.framework/Info.plist: 827 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Native.framework/libSystem.Native: 162,256 bytes (158.5 KB = 0.2 MB) Frameworks/libSystem.Net.Security.Native.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 881 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Net.Security.Native.framework/Info.plist: 853 bytes (0.8 KB = 0.0 MB) Frameworks/libSystem.Net.Security.Native.framework/libSystem.Net.Security.Native: 88,000 bytes (85.9 KB = 0.1 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 911 bytes (0.9 KB = 0.0 MB) +Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/Info.plist: 883 bytes (0.9 KB = 0.0 MB) Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 194,256 bytes (189.7 KB = 0.2 MB) Frameworks/SizeTestApp.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/Info.plist: 844 bytes (0.8 KB = 0.0 MB) -Frameworks/SizeTestApp.framework/SizeTestApp: 3,404,832 bytes (3,325.0 KB = 3.2 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/Info.plist: 816 bytes (0.8 KB = 0.0 MB) +Frameworks/SizeTestApp.framework/SizeTestApp: 3,404,880 bytes (3,325.1 KB = 3.2 MB) +Info.plist: 1,141 bytes (1.1 KB = 0.0 MB) Microsoft.iOS.dll: 98,816 bytes (96.5 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) @@ -33,7 +33,7 @@ System.Collections.Immutable.dll: 13,824 bytes (13.5 KB = 0.0 MB) System.Diagnostics.StackTrace.dll: 7,680 bytes (7.5 KB = 0.0 MB) System.IO.Compression.dll: 22,016 bytes (21.5 KB = 0.0 MB) System.IO.MemoryMappedFiles.dll: 21,504 bytes (21.0 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,585,152 bytes (1,548.0 KB = 1.5 MB) +System.Private.CoreLib.dll: 1,586,688 bytes (1,549.5 KB = 1.5 MB) System.Reflection.Metadata.dll: 83,968 bytes (82.0 KB = 0.1 MB) System.Runtime.dll: 4,096 bytes (4.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 7,680 bytes (7.5 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt index fae406a0f5d9..be41c525fbb5 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt @@ -160,6 +160,7 @@ Microsoft.iOS.dll:Foundation.NSObject.set_handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_Handle(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:Foundation.NSObject.set_HasManagedRef(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.set_IsDirectBinding(System.Boolean) +Microsoft.iOS.dll:Foundation.NSObject.set_RemoveFromObjectMap(System.Boolean) Microsoft.iOS.dll:Foundation.NSObject.ToString() Microsoft.iOS.dll:Foundation.NSObject.xamarin_release_managed_ref(System.IntPtr, System.Byte) Microsoft.iOS.dll:Foundation.NSObject.xamarin_set_gchandle_with_flags_safe(System.IntPtr, System.IntPtr, Foundation.NSObject/XamarinGCHandleFlags, System.IntPtr) @@ -554,6 +555,7 @@ Microsoft.iOS.dll:ObjCRuntime.ObjCException.get_Reason() Microsoft.iOS.dll:ObjCRuntime.ObjCException.ToString() Microsoft.iOS.dll:ObjCRuntime.Protocol Microsoft.iOS.dll:ObjCRuntime.Protocol._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.iOS.dll:ObjCRuntime.Protocol..cctor() Microsoft.iOS.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:ObjCRuntime.Protocol..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:ObjCRuntime.Protocol.get_Handle() @@ -702,6 +704,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterEntryAssembly(System.Reflection.As Microsoft.iOS.dll:ObjCRuntime.Runtime.RegisterNSObject(Foundation.NSObject, System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockOnMainThread(System.IntPtr) Microsoft.iOS.dll:ObjCRuntime.Runtime.ReleaseBlockWhenDelegateIsCollected(System.IntPtr, System.Delegate) +Microsoft.iOS.dll:ObjCRuntime.Runtime.RemoveFromObjectMap(Foundation.NSObject) Microsoft.iOS.dll:ObjCRuntime.Runtime.retain_nativeobject(System.IntPtr, System.IntPtr*) Microsoft.iOS.dll:ObjCRuntime.Runtime.RetainNativeObject(ObjCRuntime.INativeObject) Microsoft.iOS.dll:ObjCRuntime.Runtime.RetainNativeObject(System.IntPtr) @@ -780,6 +783,7 @@ Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.Ru Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector Microsoft.iOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.iOS.dll:ObjCRuntime.Selector..cctor() Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -1200,6 +1204,7 @@ Microsoft.iOS.dll:System.Boolean Foundation.NSObject::HasManagedRef() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::InFinalizerQueue() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsDirectBinding() Microsoft.iOS.dll:System.Boolean Foundation.NSObject::IsRegisteredToggleRef() +Microsoft.iOS.dll:System.Boolean Foundation.NSObject::RemoveFromObjectMap() Microsoft.iOS.dll:System.Boolean Foundation.NSObject/NSObject_Disposer::draining Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::invalidated Microsoft.iOS.dll:System.Boolean Foundation.NSObjectDataHandle::IsInvalid() @@ -1585,6 +1590,7 @@ Microsoft.iOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, Sy Microsoft.iOS.dll:UIKit.UIApplicationDelegate Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.iOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -4038,7 +4044,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -6120,6 +6160,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -12186,7 +12227,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt index 5f8d1fde0231..53977d8b9561 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt @@ -1,14 +1,14 @@ -AppBundleSize: 3,622,723 bytes (3,537.8 KB = 3.5 MB) +AppBundleSize: 3,624,255 bytes (3,539.3 KB = 3.5 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 3,997 bytes (3.9 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,141 bytes (1.1 KB = 0.0 MB) Microsoft.iOS.dll: 154,624 bytes (151.0 KB = 0.1 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,405 bytes (1.4 KB = 0.0 MB) SizeTestApp: 2,391,104 bytes (2,335.1 KB = 2.3 MB) SizeTestApp.dll: 7,680 bytes (7.5 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 41,424 bytes (40.5 KB = 0.0 MB) -System.Private.CoreLib.dll: 1,007,616 bytes (984.0 KB = 1.0 MB) +System.Private.CoreLib.aotdata.arm64: 41,448 bytes (40.5 KB = 0.0 MB) +System.Private.CoreLib.dll: 1,009,152 bytes (985.5 KB = 1.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.dll: 8,192 bytes (8.0 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt index 920fc831287f..def307947551 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt @@ -609,6 +609,7 @@ Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.Equals(System.Ru Microsoft.iOS.dll:ObjCRuntime.RuntimeTypeHandleEqualityComparer.GetHashCode(System.RuntimeTypeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector Microsoft.iOS.dll:ObjCRuntime.Selector._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) +Microsoft.iOS.dll:ObjCRuntime.Selector..cctor() Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:ObjCRuntime.Selector..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:ObjCRuntime.Selector.Equals(ObjCRuntime.Selector) @@ -895,6 +896,7 @@ Microsoft.iOS.dll:UIKit.UIApplication.xamarin_UIApplicationMain(System.Int32, Sy Microsoft.iOS.dll:UIKit.UIApplicationDelegate Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructINativeObject(ObjCRuntime.NativeHandle, System.Boolean) Microsoft.iOS.dll:UIKit.UIApplicationDelegate._Xamarin_ConstructNSObject(ObjCRuntime.NativeHandle) +Microsoft.iOS.dll:UIKit.UIApplicationDelegate..cctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor() Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(ObjCRuntime.NativeHandle) Microsoft.iOS.dll:UIKit.UIApplicationDelegate..ctor(System.IntPtr, ObjCRuntime.IManagedRegistrar) @@ -3208,7 +3210,41 @@ System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttri System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute.set_Max(System.Object) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DisallowNullAttribute..ctor() +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::All +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::AllProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::Interfaces +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::None +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicEventsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicFieldsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicMethodsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::NonPublicPropertiesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructors +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicConstructorsWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicEvents +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicFields +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicMethods +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypes +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicNestedTypesWithInherited +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicParameterlessConstructor +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::PublicProperties +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes, System.Type) +System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.String, System.String) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute..ctor(System.String, System.Type) System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute System.Private.CoreLib.dll:System.Diagnostics.CodeAnalysis.MaybeNullAttribute..ctor() @@ -5275,6 +5311,7 @@ System.Private.CoreLib.dll:System.Int32 System.DateTimeOffset::_offsetMinutes System.Private.CoreLib.dll:System.Int32 System.DayOfWeek::value__ System.Private.CoreLib.dll:System.Int32 System.Decimal::_flags System.Private.CoreLib.dll:System.Int32 System.DefaultBinder/Primitives::value__ +System.Private.CoreLib.dll:System.Int32 System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.DebuggableAttribute/DebuggingModes::value__ System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::columnNumber System.Private.CoreLib.dll:System.Int32 System.Diagnostics.MonoStackFrame::ilOffset @@ -9862,7 +9899,9 @@ System.Private.CoreLib.dll:System.String System.CharEnumerator::_str System.Private.CoreLib.dll:System.String System.DateTime::DateDataField System.Private.CoreLib.dll:System.String System.DateTime::TicksField System.Private.CoreLib.dll:System.String System.DelegateData::method_name +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField +System.Private.CoreLib.dll:System.String System.Diagnostics.CodeAnalysis.DynamicDependencyAttribute::k__BackingField System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::fileName System.Private.CoreLib.dll:System.String System.Diagnostics.MonoStackFrame::internalMethodName System.Private.CoreLib.dll:System.String System.Diagnostics.StackFrame::_fileName diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt index 1b7f9cbe3c5d..85c091554a05 100644 --- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt @@ -1,18 +1,18 @@ -AppBundleSize: 9,459,495 bytes (9,237.8 KB = 9.0 MB) +AppBundleSize: 9,460,643 bytes (9,238.9 KB = 9.0 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 5,229 bytes (5.1 KB = 0.0 MB) aot-instances.aotdata.arm64: 818,536 bytes (799.4 KB = 0.8 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) -Microsoft.iOS.aotdata.arm64: 22,904 bytes (22.4 KB = 0.0 MB) +Info.plist: 1,141 bytes (1.1 KB = 0.0 MB) +Microsoft.iOS.aotdata.arm64: 22,944 bytes (22.4 KB = 0.0 MB) Microsoft.iOS.dll: 49,152 bytes (48.0 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,481 bytes (1.4 KB = 0.0 MB) -SizeTestApp: 7,334,000 bytes (7,162.1 KB = 7.0 MB) -SizeTestApp.aotdata.arm64: 1,456 bytes (1.4 KB = 0.0 MB) +SizeTestApp: 7,334,032 bytes (7,162.1 KB = 7.0 MB) +SizeTestApp.aotdata.arm64: 1,464 bytes (1.4 KB = 0.0 MB) SizeTestApp.dll: 7,168 bytes (7.0 KB = 0.0 MB) -System.Private.CoreLib.aotdata.arm64: 665,512 bytes (649.9 KB = 0.6 MB) -System.Private.CoreLib.dll: 537,600 bytes (525.0 KB = 0.5 MB) +System.Private.CoreLib.aotdata.arm64: 665,584 bytes (650.0 KB = 0.6 MB) +System.Private.CoreLib.dll: 538,624 bytes (526.0 KB = 0.5 MB) System.Runtime.aotdata.arm64: 784 bytes (0.8 KB = 0.0 MB) System.Runtime.dll: 5,120 bytes (5.0 KB = 0.0 MB) System.Runtime.InteropServices.aotdata.arm64: 800 bytes (0.8 KB = 0.0 MB) diff --git a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt index 3c8f282b5ef2..931608ccc372 100644 --- a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt +++ b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt @@ -1,8 +1,8 @@ -AppBundleSize: 2,486,198 bytes (2,427.9 KB = 2.4 MB) +AppBundleSize: 2,849,802 bytes (2,783.0 KB = 2.7 MB) # The following list of files and their sizes is just informational / for review, and isn't used in the test: _CodeSignature/CodeResources: 2,589 bytes (2.5 KB = 0.0 MB) archived-expanded-entitlements.xcent: 384 bytes (0.4 KB = 0.0 MB) -Info.plist: 1,169 bytes (1.1 KB = 0.0 MB) +Info.plist: 1,141 bytes (1.1 KB = 0.0 MB) PkgInfo: 8 bytes (0.0 KB = 0.0 MB) runtimeconfig.bin: 1,808 bytes (1.8 KB = 0.0 MB) -SizeTestApp: 2,480,240 bytes (2,422.1 KB = 2.4 MB) +SizeTestApp: 2,843,872 bytes (2,777.2 KB = 2.7 MB) diff --git a/tests/linker/link sdk/DllImportTest.cs b/tests/linker/link sdk/DllImportTest.cs index 23c59e77a317..1c014a4fe788 100644 --- a/tests/linker/link sdk/DllImportTest.cs +++ b/tests/linker/link sdk/DllImportTest.cs @@ -8,6 +8,9 @@ // using System.Net.NetworkInformation; +using System.Linq; +using System.Threading.Tasks; + #if !__MACOS__ using UIKit; #endif @@ -78,10 +81,17 @@ public void Sqlite3 () [Test] public void PingSend () { - var p = new Ping (); // support was implemented with https://github.com/dotnet/runtime/pull/52240 - var reply = p.Send ("localhost"); - Assert.That (reply.Status, Is.EqualTo (IPStatus.Success), "Pong"); + var hosts = new string [] { + "localhost", + "www.microsoft.com", + "microsoft.com", + }; + var timeout = TimeSpan.FromSeconds (10); + var tasks = hosts.Select (host => (new Ping ()).SendPingAsync (host, timeout)).ToArray (); + Assert.IsTrue (Task.WaitAll (tasks, timeout.Add (TimeSpan.FromSeconds (10))), "One or more of the ping requests timed out."); + var results = tasks.Select (task => task.Result.Status).ToArray (); + Assert.That (results, Has.Some.EqualTo (IPStatus.Success), "Pong any host"); } } } diff --git a/tests/monotouch-test/AppKit/NSToolbar.cs b/tests/monotouch-test/AppKit/NSToolbar.cs index f77f29feddbf..50955368c02a 100644 --- a/tests/monotouch-test/AppKit/NSToolbar.cs +++ b/tests/monotouch-test/AppKit/NSToolbar.cs @@ -1,6 +1,7 @@ #if __MACOS__ using AppKit; +using Foundation; namespace Xamarin.Mac.Tests { [Preserve (AllMembers = true)] @@ -23,6 +24,39 @@ public void NSToolbarShouldChangeAllowsExtensionItems () Assert.IsFalse (toolbar.AllowsExtensionItems == allows, "NSToolbarShouldChangeAllowsExtensionItems - Failed to set the AllowsExtensionItems property"); } + + [Test] + public void ItemEventArgs () + { + TestRuntime.AssertXcodeVersion (14, 0); // macOS 13.0 + + using (var item = new NSToolbarItem ()) + using (var userInfo = new NSMutableDictionary ()) { + userInfo.Add (NSToolbar.NSToolbarItemKey, item); + + using (var notification = NSNotification.FromName (NSToolbar.NSToolbarWillAddItemNotification, toolbar, userInfo)) { + var args = new NSToolbarItemEventArgs (notification); + var actual = args.Item; + + Assert.That (actual, Is.Not.Null, "WillAddItem"); + if (actual is null) + return; + + Assert.That (actual.Handle, Is.EqualTo (item.Handle), "WillAddItemHandle"); + } + + using (var notification = NSNotification.FromName (NSToolbar.NSToolbarDidRemoveItemNotification, toolbar, userInfo)) { + var args = new NSToolbarItemEventArgs (notification); + var actual = args.Item; + + Assert.That (actual, Is.Not.Null, "DidRemoveItem"); + if (actual is null) + return; + + Assert.That (actual.Handle, Is.EqualTo (item.Handle), "DidRemoveItemHandle"); + } + } + } } } #endif // __MACOS__ diff --git a/tests/monotouch-test/Security/RecordTest.cs b/tests/monotouch-test/Security/RecordTest.cs index af4a398bb6d4..73eb44135dc5 100644 --- a/tests/monotouch-test/Security/RecordTest.cs +++ b/tests/monotouch-test/Security/RecordTest.cs @@ -332,8 +332,8 @@ public void DeskCase_83099_InmutableDictionary () Assert.IsTrue (StringUtil.StringsEqual (test4, "testValue2", false)); //TEST 5: Clear the keychain values - var test5 = ClearUserPassword (testUsername); - Assert.IsTrue (test5, "Password could not be cleared from keychain"); + var test5 = ClearUserPassword (testUsername, out queryCode, out var removeCode); + Assert.IsTrue (test5, $"Password could not be cleared from keychain. queryCode: {queryCode} removeCode: {removeCode}"); //TEST 6: Verify no keychain value var test6 = GetUserPassword (testUsername); @@ -401,19 +401,20 @@ public static void ForceRemoveUserPassword (string username) SecKeyChain.Remove (searchRecord); } - public static bool ClearUserPassword (string username) + public static bool ClearUserPassword (string username, out SecStatusCode queryCode, out SecStatusCode? removeCode) { var success = false; var searchRecord = CreateSecRecord (SecKind.InternetPassword, server: "Test1", account: username.ToLower () ); - SecStatusCode queryCode; var record = SecKeyChain.QueryAsRecord (searchRecord, out queryCode); if (queryCode == SecStatusCode.Success && record is not null) { - var removeCode = SecKeyChain.Remove (searchRecord); + removeCode = SecKeyChain.Remove (searchRecord); success = (removeCode == SecStatusCode.Success); + } else { + removeCode = null; } return success; } diff --git a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs index 1fc228d068ae..0aae018e0d7d 100644 --- a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs +++ b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs @@ -113,10 +113,8 @@ void TestNSUrlSessionHandlerCookiesImpl (NSUrlSessionHandler nativeHandler) Assert.IsNull (ex, "Exception"); Assert.IsTrue (managedCookieResult, $"Failed to get managed cookies"); Assert.IsTrue (nativeCookieResult, $"Failed to get native cookies"); - Assert.AreEqual (1, managedCookies.Count (), $"Managed Cookie Count"); - Assert.AreEqual (1, nativeCookies.Count (), $"Native Cookie Count"); - Assert.That (nativeCookies.First (), Does.StartWith ("cookie=chocolate-chip;"), $"Native Cookie Value"); - Assert.That (managedCookies.First (), Does.StartWith ("cookie=chocolate-chip;"), $"Managed Cookie Value"); + Assert.That (managedCookies.Any (v => v.StartsWith ("cookie=chocolate-chip;", StringComparison.Ordinal)), Is.True, $"Managed Cookie Value"); + Assert.That (nativeCookies.Any (v => v.StartsWith ("cookie=chocolate-chip;", StringComparison.Ordinal)), Is.True, $"Native Cookie Value"); } // ensure that we can use a cookie container to set the cookies for a url @@ -174,7 +172,8 @@ void TestNSUrlSessionHandlerCookieContainerImpl (NSUrlSessionHandler nativeHandl Assert.IsNull (ex, "Exception"); Assert.IsNotNull (managedCookieResult, "Managed cookies result"); Assert.IsNotNull (nativeCookieResult, "Native cookies result"); - Assert.AreEqual (managedCookieResult, nativeCookieResult, "Cookies"); + Assert.That (managedCookieResult, Does.Contain ("\"cookie\": \"chocolate-chip\""), "Managed cookies"); + Assert.That (nativeCookieResult, Does.Contain ("\"cookie\": \"chocolate-chip\""), "Native cookies"); } // ensure that the Set-Cookie headers do update the CookieContainer @@ -202,9 +201,7 @@ public void TestNSurlSessionHandlerCookieContainerSetCookie () Assert.IsNull (ex, "Exception"); Assert.IsNotNull (nativeCookieResult, "Native cookies result"); var cookiesFromServer = cookieContainer.GetCookies (new Uri (url)); - if (cookiesFromServer.Count != 1) - TestRuntime.IgnoreInCI ("Unexpected network failure in CI"); - Assert.AreEqual (1, cookiesFromServer.Count, "Cookies received from server."); + Assert.That (cookiesFromServer.Cast ().Any (v => v.Name == "cookie" && v.Value == "chocolate-chip"), Is.True, "Cookies received from server."); } [Test] @@ -909,6 +906,32 @@ public void GHIssue8342 (HttpStatusCode expectedStatus, string validUsername, st } } + [TestCase (HttpStatusCode.OK, "mandel", "12345678", "mandel", "12345678")] + [TestCase (HttpStatusCode.Unauthorized, "mandel", "12345678", "mandel", "87654321")] + [TestCase (HttpStatusCode.Unauthorized, "mandel", "12345678", "", "")] + public void SupportsDigestAuthentication (HttpStatusCode expectedStatus, string validUsername, string validPassword, string username, string password) + { + var handler = new NSUrlSessionHandler () { + Credentials = new NetworkCredential (username, password, "") + }; + + var client = new HttpClient (handler); + + HttpStatusCode httpStatus = HttpStatusCode.NotFound; + var done = TestRuntime.TryRunAsync (TimeSpan.FromSeconds (30), async () => { + var result = await client.GetAsync (NetworkResources.Httpbin.GetDigestAuthUrl (validUsername, validPassword)); + httpStatus = result.StatusCode; + }, out var ex); + + if (!done) { + Assert.Inconclusive ("Request timedout."); + } else { + TestRuntime.IgnoreInCIIfBadNetwork (httpStatus); + Assert.IsNull (ex, "Exception not null"); + Assert.AreEqual (expectedStatus, httpStatus, "Status not ok"); + } + } + [TestCase] public void GHIssue8344 () { diff --git a/tests/monotouch-test/System.Net.Http/NetworkResources.cs b/tests/monotouch-test/System.Net.Http/NetworkResources.cs index 86813569df98..085a36039118 100644 --- a/tests/monotouch-test/System.Net.Http/NetworkResources.cs +++ b/tests/monotouch-test/System.Net.Http/NetworkResources.cs @@ -102,6 +102,7 @@ public static class Httpbin { public static string GetStatusCodeUrl (HttpStatusCode status) => $"{HttpUrl}/status/{(int) status}"; public static string GetSetCookieUrl (string cookie, string value) => $"{Url}/cookies/set?{cookie}={value}"; public static string GetBasicAuthUrl (string username, string password) => $"{Url}/basic-auth/{username}/{password}"; + public static string GetDigestAuthUrl (string username, string password) => $"{Url}/digest-auth/auth/{username}/{password}"; } } diff --git a/tests/monotouch-test/dotnet/shared.csproj b/tests/monotouch-test/dotnet/shared.csproj index a68206c4621d..282d2a42e265 100644 --- a/tests/monotouch-test/dotnet/shared.csproj +++ b/tests/monotouch-test/dotnet/shared.csproj @@ -12,7 +12,6 @@ $(RootTestsDirectory)\test-libraries $(RootTestsDirectory)\monotouch-test - None true diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetMlaunchArgumentsTaskTests.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetMlaunchArgumentsTaskTests.cs new file mode 100644 index 000000000000..9042df3d7196 --- /dev/null +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetMlaunchArgumentsTaskTests.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.IO; +using System.Linq; +using System.Text; + +using Microsoft.Build.Utilities; + +using NUnit.Framework; + +using Xamarin.Tests; +using Xamarin.Utils; + +#nullable enable + +namespace Xamarin.MacDev.Tasks { + [TestFixture] + public class GetMlaunchArgumentsTaskTests : TestBase { + + [Test] + public void SelectSimulatorDeviceUsesFirstAvailableSimulator () + { + var task = CreateTask (); + task.TargetFrameworkMoniker = TargetFramework.GetTargetFramework (ApplePlatform.iOS).ToString (); + task.AppManifestPath = CreateAppManifest (1, 2); + task.Devices = CreateDevices ( + ("DEVICE-1", "Connected iPhone", "Device"), + ("SIM-2", "Preferred Simulator", "Simulator"), + ("SIM-1", "Another Simulator", "Simulator") + ); + task.LaunchApp = "MySimpleApp.app"; + task.MlaunchPath = "/usr/bin/false"; + task.SdkIsSimulator = true; + task.SdkVersion = "26.2"; + task.WaitForExit = true; + + ExecuteTask (task); + + Assert.That (task.MlaunchArguments, Does.Contain ("--device :v2:udid=SIM-2")); + } + + [Test] + public void ErrorsIfDevicesItemGroupIsEmpty () + { + var task = CreateTask (); + task.TargetFrameworkMoniker = TargetFramework.GetTargetFramework (ApplePlatform.iOS).ToString (); + task.AppManifestPath = CreateAppManifest (1, 2); + task.Devices = CreateDevices ( + ("DEVICE-2", "Connected iPhone", "Device") + ); + task.DiscardedDevices = CreateDiscardedDevices ( + ("SIM-1", "Unsupported Simulator", "Simulator", "Device is not an iPad, but the app only supports iPads"), + ("DEVICE-1", "Old Phone", "Device", "Device OS version '17.0' is lower than the app's minimum OS version '18.0'") + ); + task.LaunchApp = "MySimpleApp.app"; + task.MlaunchPath = "/usr/bin/false"; + task.SdkIsSimulator = true; + task.SdkVersion = "26.2"; + task.WaitForExit = true; + + ExecuteTask (task, expectedErrorCount: 1); + + Assert.That (Engine.Logger.ErrorEvents [0].Message, Does.Contain ("No applicable and available devices found.")); + Assert.That (Engine.Logger.ErrorEvents [0].Message, Does.Contain ("Unsupported Simulator (SIM-1): Device is not an iPad, but the app only supports iPads")); + Assert.That (Engine.Logger.ErrorEvents [0].Message, Does.Not.Contain ("Connected iPhone")); + Assert.That (Engine.Logger.ErrorEvents [0].Message, Does.Not.Contain ("Old Phone")); + } + + [Test] + public void HelpListsDiscardedDevicesWhenNoDevicesAreAvailable () + { + var task = CreateTask (); + task.TargetFrameworkMoniker = TargetFramework.GetTargetFramework (ApplePlatform.iOS).ToString (); + task.AppManifestPath = CreateAppManifest (1, 2); + task.Devices = CreateDevices ( + ("DEVICE-2", "Connected iPhone", "Device") + ); + task.DiscardedDevices = CreateDiscardedDevices ( + ("SIM-1", "Unsupported Simulator", "Simulator", "Device is not an iPad, but the app only supports iPads"), + ("DEVICE-1", "Old Phone", "Device", "Device OS version '17.0' is lower than the app's minimum OS version '18.0'") + ); + task.Help = "true"; + task.MlaunchPath = "/usr/bin/false"; + task.SdkIsSimulator = true; + task.SdkVersion = "26.2"; + + ExecuteTask (task); + + Assert.That (Engine.Logger.WarningsEvents [0].Message, Does.Contain ("The following devices were discarded:")); + Assert.That (Engine.Logger.WarningsEvents [0].Message, Does.Contain ("Unsupported Simulator (SIM-1): Device is not an iPad, but the app only supports iPads")); + Assert.That (Engine.Logger.WarningsEvents [0].Message, Does.Contain ("Connected iPhone")); + Assert.That (Engine.Logger.WarningsEvents [0].Message, Does.Contain ("Old Phone (DEVICE-1): Device OS version '17.0' is lower than the app's minimum OS version '18.0'")); + } + + static TaskItem [] CreateDevices (params (string Udid, string Name, string Type) [] devices) + { + return devices.Select (v => { + return CreateDevice (v.Udid, v.Name, v.Type); + }).ToArray (); + } + + static TaskItem [] CreateDiscardedDevices (params (string Udid, string Name, string Type, string DiscardedReason) [] devices) + { + return devices.Select (v => CreateDevice (v.Udid, v.Name, v.Type, v.DiscardedReason)).ToArray (); + } + + static TaskItem CreateDevice (string udid, string name, string type, string? discardedReason = null) + { + var item = new TaskItem (udid); + item.SetMetadata ("Description", name); + item.SetMetadata ("Name", name); + item.SetMetadata ("Type", type); + item.SetMetadata ("UDID", udid); + if (!string.IsNullOrEmpty (discardedReason)) + item.SetMetadata ("DiscardedReason", discardedReason); + return item; + } + + static string CreateAppManifest (params int [] deviceFamilies) + { + var appManifestPath = Path.Combine (Cache.CreateTemporaryDirectory ("msbuild-tests"), "Info.plist"); + var plist = new StringBuilder (); + plist.AppendLine (@""); + plist.AppendLine (@""); + plist.AppendLine (@""); + plist.AppendLine (""); + plist.AppendLine ("\tUIDeviceFamily"); + plist.AppendLine ("\t"); + foreach (var family in deviceFamilies) + plist.AppendLine ($"\t\t{family}"); + plist.AppendLine ("\t"); + plist.AppendLine (""); + plist.AppendLine (""); + File.WriteAllText (appManifestPath, plist.ToString ()); + return appManifestPath; + } + } +} diff --git a/tests/xharness/.vscode/launch.json b/tests/xharness/.vscode/launch.json deleted file mode 100644 index f3c709410174..000000000000 --- a/tests/xharness/.vscode/launch.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "C#: xharness Debug Site", - "preLaunchTask": "dotnet: build", - "type": "coreclr", - "request": "launch", - "program": "${workspaceFolder}/bin/Debug/xharness.dll", - "args": [ - "--verbose", - "--jenkins:server", - "--rootdir", - "..", - ], - "cwd": "${workspaceFolder}", - } - ] -} \ No newline at end of file diff --git a/tests/xharness/.vscode/tasks.json b/tests/xharness/.vscode/tasks.json deleted file mode 100644 index b1c79f68e643..000000000000 --- a/tests/xharness/.vscode/tasks.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "dotnet", - "task": "build", - "group": "build", - "problemMatcher": [], - "label": "dotnet: build" - } - ] -} \ No newline at end of file diff --git a/tests/xharness/AppBundleLocator.cs b/tests/xharness/AppBundleLocator.cs index 3257b5f01250..9add4d86f504 100644 --- a/tests/xharness/AppBundleLocator.cs +++ b/tests/xharness/AppBundleLocator.cs @@ -31,7 +31,7 @@ public AppBundleLocator (IProcessManager processManager, Func getLog, stri this.dotnetPath = dotnetPath; } - public async Task LocateAppBundle (XmlDocument projectFile, string projectFilePath, TestTarget target, string buildConfiguration) + public async Task LocateAppBundle (XmlDocument projectFile, string projectFilePath, TestTarget target, string buildConfiguration) { string platform = string.Empty; if (target != TestTarget.None) @@ -47,7 +47,7 @@ public async Task LocateAppBundle (XmlDocument projectFile, string proje return await GetPropertyByMSBuildEvaluationAsync (projectFile, projectFilePath, "OutputPath", "_GenerateBundleName", properties); } else { - return projectFile.GetOutputPath (platform, buildConfiguration).Replace ('\\', Path.DirectorySeparatorChar); + return projectFile.GetOutputPath (platform, buildConfiguration)?.Replace ('\\', Path.DirectorySeparatorChar); } } @@ -56,7 +56,7 @@ public async Task LocateAppBundle (XmlDocument projectFile, string proje // * Will import the project file we're inspecting // * Has a target that will print a given property // and then executing MSBuild on this custom MSBuild file. - private async Task GetPropertyByMSBuildEvaluationAsync (XmlDocument csproj, string projectPath, string evaluateProperty, string dependsOnTargets = "", Dictionary properties = null) + async Task GetPropertyByMSBuildEvaluationAsync (XmlDocument csproj, string projectPath, string evaluateProperty, string dependsOnTargets = "", Dictionary? properties = null) { var xml = @" @@ -74,7 +74,7 @@ private async Task GetPropertyByMSBuildEvaluationAsync (XmlDocument cspr "; - var dir = Path.GetDirectoryName (projectPath); + var dir = Path.GetDirectoryName (projectPath)!; var inspector = Path.Combine (dir, "PropertyInspector.csproj"); var output = Path.Combine (dir, "PropertyInspector.txt"); try { @@ -94,12 +94,14 @@ private async Task GetPropertyByMSBuildEvaluationAsync (XmlDocument cspr args.Add ("/p:ProjectFile=" + projectPath); args.Add ("/p:OutputFile=" + output); - foreach (var prop in properties) - args.Add ($"/p:{prop.Key}={prop.Value}"); + if (properties is not null) { + foreach (var prop in properties) + args.Add ($"/p:{prop.Key}={prop.Value}"); + } args.Add (inspector); - var env = new Dictionary { + var env = new Dictionary { { "MSBUILD_EXE_PATH", null }, }; @@ -146,13 +148,13 @@ public string GetDotNetExecutable (string directory) } // Find the first global.json up the directory hierarchy (stopping at the root directory) - string global_json = null; + string? global_json = null; var dir = directory; while (dir.Length > 2) { global_json = Path.Combine (dir, "global.json"); if (File.Exists (global_json)) break; - dir = Path.GetDirectoryName (dir); + dir = Path.GetDirectoryName (dir)!; } if (!File.Exists (global_json)) throw new Exception ($"Could not find any global.json file in {directory} or above"); @@ -164,7 +166,9 @@ public string GetDotNetExecutable (string directory) var doc = new XmlDocument (); doc.Load (reader); - var version = doc.SelectSingleNode ("/root/sdk").InnerText; + var version = doc.SelectSingleNode ("/root/sdk")?.InnerText; + if (version is null) + throw new Exception ($"Could not find SDK version in {global_json}"); string executable; switch (version [0]) { diff --git a/tests/xharness/AppRunner.cs b/tests/xharness/AppRunner.cs index 4dd6d865ee34..4cc1a11b2690 100644 --- a/tests/xharness/AppRunner.cs +++ b/tests/xharness/AppRunner.cs @@ -25,24 +25,24 @@ public class AppRunner { readonly ISimulatorLoaderFactory simulatorsLoaderFactory; readonly ISimpleListenerFactory listenerFactory; readonly IDeviceLoaderFactory devicesLoaderFactory; - readonly ICrashSnapshotReporterFactory snapshotReporterFactory; + readonly CrashSnapshotReporterFactory snapshotReporterFactory; readonly ICaptureLogFactory captureLogFactory; - readonly IDeviceLogCapturerFactory deviceLogCapturerFactory; + readonly DeviceLogCapturerFactory deviceLogCapturerFactory; readonly ITestReporterFactory testReporterFactory; readonly IAppBundleInformationParser appBundleInformationParser; readonly RunMode runMode; readonly bool isSimulator; readonly TestTarget target; - readonly IHarness harness; + readonly Harness harness; readonly double timeoutMultiplier; - readonly IBuildToolTask buildTask; - readonly string variation; + readonly BuildToolTask? buildTask; + readonly string? variation; readonly string projectFilePath; - readonly string buildConfiguration; + readonly string? buildConfiguration; - string deviceName; - ISimulatorDevice simulator; + string? deviceName; + ISimulatorDevice? simulator; bool ensureCleanSimulatorState = true; bool EnsureCleanSimulatorState { @@ -50,13 +50,16 @@ bool EnsureCleanSimulatorState { set => ensureCleanSimulatorState = value; } - public AppBundleInformation AppInformation { get; private set; } + AppBundleInformation? appInformation; + public AppBundleInformation AppInformation { + get => appInformation!; + } - bool IsExtension => AppInformation.Extension.HasValue; + bool IsExtension => AppInformation?.Extension.HasValue ?? false; public TestExecutingResult Result { get; private set; } - public string FailureMessage { get; private set; } + public string? FailureMessage { get; private set; } public IFileBackedLog MainLog { get; set; } @@ -67,22 +70,22 @@ public AppRunner (IMlaunchProcessManager processManager, ISimulatorLoaderFactory simulatorsFactory, ISimpleListenerFactory simpleListenerFactory, IDeviceLoaderFactory devicesFactory, - ICrashSnapshotReporterFactory snapshotReporterFactory, + CrashSnapshotReporterFactory snapshotReporterFactory, ICaptureLogFactory captureLogFactory, - IDeviceLogCapturerFactory deviceLogCapturerFactory, + DeviceLogCapturerFactory deviceLogCapturerFactory, ITestReporterFactory reporterFactory, TestTarget target, - IHarness harness, + Harness harness, IFileBackedLog mainLog, ILogs logs, string projectFilePath, - string buildConfiguration, - ISimulatorDevice simulator = null, - string deviceName = null, + string? buildConfiguration, + ISimulatorDevice? simulator = null, + string? deviceName = null, bool ensureCleanSimulatorState = false, double timeoutMultiplier = 1, - string variation = null, - IBuildToolTask buildTask = null) + string? variation = null, + BuildToolTask? buildTask = null) { this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); this.simulatorsLoaderFactory = simulatorsFactory ?? throw new ArgumentNullException (nameof (simulatorsFactory)); @@ -112,7 +115,7 @@ public AppRunner (IMlaunchProcessManager processManager, public async Task InitializeAsync () { - AppInformation = await appBundleInformationParser.ParseFromProject2 (harness.AppBundleLocator, projectFilePath, target, buildConfiguration); + appInformation = await appBundleInformationParser.ParseFromProject2 (harness.AppBundleLocator, projectFilePath, target, buildConfiguration!); AppInformation.Variation = variation; } @@ -307,7 +310,7 @@ public async Task RunAsync () args.Add (new SetStdoutArgument (stdout_log)); args.Add (new SetStderrArgument (stderr_log)); - var simulators = new [] { simulator }; + var simulators = new [] { simulator! }; var systemLogs = new List (); foreach (var sim in simulators) { // Upload the system log @@ -344,7 +347,7 @@ public async Task RunAsync () } MainLog.WriteLine ("Enabled verbose logging"); - args.Add (new SimulatorUDIDArgument (simulator.UDID)); + args.Add (new SimulatorUDIDArgument (simulator!.UDID)); await crashReporter.StartCaptureAsync (); @@ -373,7 +376,7 @@ public async Task RunAsync () args.Add (new DeviceNameArgument (deviceName)); var deviceSystemLog = Logs.Create ($"device-{deviceName}-{Harness.Helpers.Timestamp}.log", "Device log"); - var deviceLogCapturer = deviceLogCapturerFactory.Create (harness.HarnessLog, deviceSystemLog, deviceName); + var deviceLogCapturer = deviceLogCapturerFactory.Create (harness.HarnessLog!, deviceSystemLog, deviceName); deviceLogCapturer.StartCapture (); try { @@ -429,14 +432,14 @@ public async Task RunAsync () FailureMessage = "Test app failed to launch."; } - return testReporter.Success.Value ? 0 : 1; + return testReporter?.Success == true ? 0 : 1; } static bool IsLaunchFailure (IFileBackedLog log) { try { using var reader = log.GetReader (); - string line; + string? line; while ((line = reader.ReadLine ()) is not null) { if (line.Contains ("Could not launch the app", StringComparison.Ordinal)) return true; diff --git a/tests/xharness/CrashSnapshotReporterFactory.cs b/tests/xharness/CrashSnapshotReporterFactory.cs index bb8c31af7155..d2bc2158570d 100644 --- a/tests/xharness/CrashSnapshotReporterFactory.cs +++ b/tests/xharness/CrashSnapshotReporterFactory.cs @@ -5,11 +5,7 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Logging; namespace Xharness { - public interface ICrashSnapshotReporterFactory { - ICrashSnapshotReporter Create (ILog log, ILogs logs, bool isDevice, string deviceName); - } - - public class CrashSnapshotReporterFactory : ICrashSnapshotReporterFactory { + public class CrashSnapshotReporterFactory { readonly IMlaunchProcessManager processManager; public CrashSnapshotReporterFactory (IMlaunchProcessManager processManager) @@ -17,7 +13,7 @@ public CrashSnapshotReporterFactory (IMlaunchProcessManager processManager) this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); } - public ICrashSnapshotReporter Create (ILog log, ILogs logs, bool isDevice, string deviceName) => + public ICrashSnapshotReporter Create (ILog log, ILogs logs, bool isDevice, string? deviceName) => new CrashSnapshotReporter (processManager, log, logs, isDevice, deviceName); } } diff --git a/tests/xharness/DeviceLogCapturerFactory.cs b/tests/xharness/DeviceLogCapturerFactory.cs index eafd26927c8e..e70ba1c7d796 100644 --- a/tests/xharness/DeviceLogCapturerFactory.cs +++ b/tests/xharness/DeviceLogCapturerFactory.cs @@ -4,12 +4,8 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Logging; namespace Xharness { - public interface IDeviceLogCapturerFactory { - IDeviceLogCapturer Create (ILog mainLog, ILog deviceLog, string deviceName); - } - - public class DeviceLogCapturerFactory : IDeviceLogCapturerFactory { - public IDeviceLogCapturer Create (ILog mainLog, ILog deviceLog, string deviceName) + public class DeviceLogCapturerFactory { + public IDeviceLogCapturer Create (ILog mainLog, ILog deviceLog, string? deviceName) { return new DeviceLogCapturer (mainLog, deviceLog, deviceName); } diff --git a/tests/xharness/GitHub.cs b/tests/xharness/GitHub.cs index 125e9ac2198a..11d8d4a266cb 100644 --- a/tests/xharness/GitHub.cs +++ b/tests/xharness/GitHub.cs @@ -31,10 +31,10 @@ public class GitHub : IVersionControlSystem { const string PullsApiUrl = "https://api.github.com/repos/dotnet/macios/pulls"; - readonly IHarness harness; + readonly Harness harness; readonly IProcessManager processManager; - public GitHub (IHarness harness, IProcessManager processManager) + public GitHub (Harness harness, IProcessManager processManager) { if (harness is null) throw new ArgumentNullException (nameof (harness)); @@ -196,7 +196,7 @@ IEnumerable GetModifiedFilesRemotely (int pullRequest) var output = new MemoryLog () { Timestamp = false // ensure we do not add the timestap or the logic for the file check will be hard and having it adds no value }; - var rv = processManager.RunAsync (git, harness.HarnessLog, stdoutLog: output, stderrLog: output).Result; + var rv = processManager.RunAsync (git, harness.HarnessLog!, stdoutLog: output, stderrLog: output).Result; if (rv.Succeeded) return output.ToString ().Split (new char [] { '\n' }, StringSplitOptions.RemoveEmptyEntries); diff --git a/tests/xharness/Harness.cs b/tests/xharness/Harness.cs index a281e9f4b701..33cf6b5ffb93 100644 --- a/tests/xharness/Harness.cs +++ b/tests/xharness/Harness.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -33,14 +34,14 @@ public class HarnessConfiguration { public Dictionary EnvironmentVariables { get; set; } = new Dictionary (); public bool? IncludeSystemPermissionTests { get; set; } public List TestProjects { get; set; } = new List (); - public string JenkinsConfiguration { get; set; } + public string JenkinsConfiguration { get; set; } = string.Empty; public HashSet Labels { get; set; } = new HashSet (); public string LogDirectory { get; set; } = Environment.CurrentDirectory; - public string MarkdownSummaryPath { get; set; } - public string PeriodicCommand { get; set; } - public string PeriodicCommandArguments { get; set; } + public string MarkdownSummaryPath { get; set; } = string.Empty; + public string PeriodicCommand { get; set; } = string.Empty; + public string PeriodicCommandArguments { get; set; } = string.Empty; public TimeSpan PeriodicCommandInterval { get; set; } - public string SdkRoot { get; set; } + public string? SdkRoot { get; set; } public TestTarget Target { get; set; } public double TimeoutInMinutes { get; set; } = 15; public bool UseSystemXamarinIOSMac { get; set; } @@ -48,20 +49,20 @@ public class HarnessConfiguration { public XmlResultJargon XmlJargon { get; set; } = XmlResultJargon.NUnitV3; // This is the maccore/tests directory. - static string root_directory; + static string? root_directory; public static string RootDirectory { get { if (root_directory is null) { - var testAssemblyDirectory = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location); + var testAssemblyDirectory = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location)!; var dir = testAssemblyDirectory; var path = Path.Combine (testAssemblyDirectory, ".git"); while (!Directory.Exists (path) && path.Length > 3) { - dir = Path.GetDirectoryName (dir); + dir = Path.GetDirectoryName (dir)!; path = Path.Combine (dir, ".git"); } if (!Directory.Exists (path)) throw new Exception ("Could not find the xamarin-macios repo."); - path = Path.Combine (Path.GetDirectoryName (path), "tests"); + path = Path.Combine (Path.GetDirectoryName (path)!, "tests"); if (!Directory.Exists (path)) throw new Exception ("Could not find the tests directory."); root_directory = Path.GetFullPath (path); @@ -121,7 +122,7 @@ public static string InjectRootTestsDirectory (string value) } } - public class Harness : IHarness { + public class Harness { readonly TestTarget target; readonly string buildConfiguration = "Debug"; readonly IMlaunchProcessManager processManager; @@ -130,23 +131,23 @@ public class Harness : IHarness { public HarnessAction Action { get; } public int Verbosity { get; } - public IFileBackedLog HarnessLog { get; set; } - public HashSet Labels { get; } + public IFileBackedLog? HarnessLog { get; set; } + public HashSet Labels { get; } = new (); public XmlResultJargon XmlJargon { get; } public IResultParser ResultParser { get; } public ITunnelBore TunnelBore { get; } public AppBundleLocator AppBundleLocator { get; } - string sdkRoot; + string? sdkRoot; string SdkRoot { - get => sdkRoot; + get => sdkRoot!; set { sdkRoot = value; XcodeRoot = FindXcode (sdkRoot); } } - bool TryGetMlaunchDotnetPath (out string value) + bool TryGetMlaunchDotnetPath ([NotNullWhen (true)] out string? value) { value = null; @@ -160,12 +161,12 @@ bool TryGetMlaunchDotnetPath (out string value) } var sdkPlatform = platform.AsString ().ToUpperInvariant (); - var sdkName = GetVariable ($"{sdkPlatform}_NUGET_SDK_NAME"); + var sdkName = GetVariable ($"{sdkPlatform}_NUGET_SDK_NAME") ?? throw new Exception ($"Could not get the SDK name for {sdkPlatform} from the environment variable {sdkPlatform}_NUGET_SDK_NAME"); // there is a diff between getting the path for the current platform when running on CI or off CI. The config files in the CI do not // contain the correct workload version, the reason for this is that the workload is built in a different machine which means that // the Make.config will use the wrong version. The CI set the version in the environment variable {platform}_WORKLOAD_VERSION via a script. - var workloadVersion = GetVariable ($"{sdkPlatform}_WORKLOAD_VERSION"); - var sdkVersion = GetVariable ($"{sdkPlatform}_NUGET_VERSION_NO_METADATA"); + var workloadVersion = GetVariable ($"{sdkPlatform}_WORKLOAD_VERSION", ""); + var sdkVersion = GetVariable ($"{sdkPlatform}_NUGET_VERSION_NO_METADATA") ?? throw new Exception ($"Could not get the SDK version for {sdkPlatform} from the environment variable {sdkPlatform}_NUGET_VERSION_NO_METADATA"); value = Path.Combine (DOTNET_DIR, "packs", sdkName, string.IsNullOrEmpty (workloadVersion) ? sdkVersion : workloadVersion, "tools", "bin", "mlaunch"); return true; } @@ -184,7 +185,8 @@ bool IsVariableSet (string variable) return !string.IsNullOrEmpty (GetVariable (variable)); } - string GetVariable (string variable, string @default = null) + [return: NotNullIfNotNull (nameof (@default))] + string? GetVariable (string variable, string? @default = null) { var result = Environment.GetEnvironmentVariable (variable); if (string.IsNullOrEmpty (result)) @@ -212,7 +214,7 @@ public Version DotNetVersion { // Run - public string XcodeRoot { get; private set; } + public string? XcodeRoot { get; private set; } public string LogDirectory { get; } = Environment.CurrentDirectory; public double Timeout { get; } = 15; // in minutes public double LaunchTimeout { get; } // in minutes @@ -268,17 +270,17 @@ public Harness (IResultParser resultParser, HarnessAction action, HarnessConfigu INCLUDE_IOS = IsVariableSet (nameof (INCLUDE_IOS)); INCLUDE_TVOS = IsVariableSet (nameof (INCLUDE_TVOS)); - JENKINS_RESULTS_DIRECTORY = GetVariable (nameof (JENKINS_RESULTS_DIRECTORY)); + JENKINS_RESULTS_DIRECTORY = GetVariable (nameof (JENKINS_RESULTS_DIRECTORY)) ?? throw new Exception ($"Could not get the Jenkins results directory from the environment variable {nameof (JENKINS_RESULTS_DIRECTORY)}"); INCLUDE_MAC = IsVariableSet (nameof (INCLUDE_MAC)); INCLUDE_MACCATALYST = IsVariableSet (nameof (INCLUDE_MACCATALYST)); - DOTNET_DIR = GetVariable (nameof (DOTNET_DIR)); - DOTNET_TFM = GetVariable (nameof (DOTNET_TFM)); + DOTNET_DIR = GetVariable (nameof (DOTNET_DIR)) ?? throw new Exception ($"Could not get the .NET directory from the environment variable {nameof (DOTNET_DIR)}"); + DOTNET_TFM = GetVariable (nameof (DOTNET_TFM)) ?? throw new Exception ($"Could not get the .NET TFM from the environment variable {nameof (DOTNET_TFM)}"); if (string.IsNullOrEmpty (SdkRoot)) - SdkRoot = GetVariable ("XCODE_DEVELOPER_ROOT", configuration.SdkRoot); + SdkRoot = GetVariable ("XCODE_DEVELOPER_ROOT", configuration.SdkRoot!); processManager = new MlaunchProcessManager (XcodeRoot, MlaunchPath); - AppBundleLocator = new AppBundleLocator (processManager, () => HarnessLog, "/usr/local/share/dotnet/dotnet", GetVariable ("DOTNET")); + AppBundleLocator = new AppBundleLocator (processManager, () => HarnessLog!, "/usr/local/share/dotnet/dotnet", GetVariable ("DOTNET")!); TunnelBore = new TunnelBore (processManager); } @@ -319,7 +321,7 @@ static string FindXcode (string path) return path; } - path = Path.GetDirectoryName (path); + path = Path.GetDirectoryName (path)!; } while (true); } @@ -426,8 +428,8 @@ void PopulateUnitTestProjects () void PopulatePlatformSpecificProjects () { - string [] noConfigurations = null; - var debugAndRelease = new string [] { "Debug", "Release" }; + string []? noConfigurations = null; + string []? debugAndRelease = new string [] { "Debug", "Release" }; var projectInfos = new [] { new { @@ -449,35 +451,35 @@ void PopulatePlatformSpecificProjects () Platforms = TestPlatform.All, ProjectPath = Path.Combine ("linker", "dont link"), IsFSharp = false, - Configurations = debugAndRelease, + Configurations = (string[]?) debugAndRelease, }, new { Label = TestLabel.Linker, Platforms = TestPlatform.All, ProjectPath = Path.Combine ("linker", "link sdk"), IsFSharp = false, - Configurations = debugAndRelease, + Configurations = (string[]?) debugAndRelease, }, new { Label = TestLabel.Linker, Platforms = TestPlatform.All, ProjectPath = Path.Combine ("linker", "link all"), IsFSharp = false, - Configurations = debugAndRelease, + Configurations = (string[]?) debugAndRelease, }, new { Label = TestLabel.Linker, Platforms = TestPlatform.All, ProjectPath = Path.Combine ("linker", "trimmode copy"), IsFSharp = false, - Configurations = debugAndRelease, + Configurations = (string[]?) debugAndRelease, }, new { Label = TestLabel.Linker, Platforms = TestPlatform.All, ProjectPath = Path.Combine ("linker", "trimmode link"), IsFSharp = false, - Configurations = debugAndRelease, + Configurations = (string[]?) debugAndRelease, }, new { Label = TestLabel.Fsharp, @@ -557,7 +559,7 @@ IEnumerable FindConfigFiles (string name) var file = Path.Combine (dir, name); if (File.Exists (file)) yield return file; - dir = Path.GetDirectoryName (dir); + dir = Path.GetDirectoryName (dir)!; } } @@ -677,7 +679,7 @@ public bool UseTcpTunnel { } } - public string VSDropsUri { + public string? VSDropsUri { get { var uri = Environment.GetEnvironmentVariable ("VSDROPS_URI"); return string.IsNullOrEmpty (uri) ? null : uri; @@ -711,7 +713,7 @@ int Jenkins () public void Save (StringWriter doc, string path) { if (!File.Exists (path)) { - Directory.CreateDirectory (Path.GetDirectoryName (path)); + Directory.CreateDirectory (Path.GetDirectoryName (path)!); File.WriteAllText (path, doc.ToString ()); Log (1, "Created {0}", path); } else { @@ -740,7 +742,7 @@ AppRunner CreateAppRunner (TestProject project) new TestReporterFactory (processManager), target, this, - HarnessLog, + HarnessLog!, new Logs (LogDirectory), project.Path, buildConfiguration); diff --git a/tests/xharness/IAppBundleInformationParserExtensions.cs b/tests/xharness/IAppBundleInformationParserExtensions.cs index ac25d71c2157..57b793746ab5 100644 --- a/tests/xharness/IAppBundleInformationParserExtensions.cs +++ b/tests/xharness/IAppBundleInformationParserExtensions.cs @@ -11,7 +11,7 @@ namespace Xharness { public static class IAppBundleInformationParserExtensions { // This is a copy of this method: https://github.com/dotnet/xharness/blob/aa434d0c7e6eb46df1ec11b3c63add37d835c4d0/src/Microsoft.DotNet.XHarness.iOS.Shared/AppBundleInformationParser.cs#L43-L103 // And then augmented to handle that the path to the Info.plist might have $(RootTestsDirectory) in it. - public async static Task ParseFromProject2 (this IAppBundleInformationParser @this, IAppBundleLocator? _appBundleLocator, string projectFilePath, TestTarget target, string buildConfiguration) + public async static Task ParseFromProject2 (this IAppBundleInformationParser @this, AppBundleLocator? _appBundleLocator, string projectFilePath, TestTarget target, string buildConfiguration) { var csproj = new XmlDocument (); csproj.LoadWithoutNetworkAccess (projectFilePath); diff --git a/tests/xharness/IHarness.cs b/tests/xharness/IHarness.cs deleted file mode 100644 index 7a3c0c1ebb4c..000000000000 --- a/tests/xharness/IHarness.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.XHarness.Common; -using Microsoft.DotNet.XHarness.Common.Logging; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; - -namespace Xharness { - - /// - /// Interface that represents the harness class that contains all the needed info to execute the tests. - /// - public interface IHarness { - - #region Properties - HarnessAction Action { get; } - IFileBackedLog HarnessLog { get; set; } - int Verbosity { get; } - HashSet Labels { get; } - XmlResultJargon XmlJargon { get; } - IResultParser ResultParser { get; } - AppBundleLocator AppBundleLocator { get; } - ITunnelBore TunnelBore { get; } - List TestProjects { get; } - bool INCLUDE_IOS { get; } - bool INCLUDE_TVOS { get; } - bool INCLUDE_MAC { get; } - bool INCLUDE_MACCATALYST { get; } - string JENKINS_RESULTS_DIRECTORY { get; } - string DOTNET_DIR { get; set; } - string DOTNET_TFM { get; } - Version DotNetVersion { get; } - string XcodeRoot { get; } - string LogDirectory { get; } - double Timeout { get; } - double LaunchTimeout { get; } // in minutes - bool DryRun { get; } // Most things don't support this. If you need it somewhere, implement it! - string JenkinsConfiguration { get; } - Dictionary EnvironmentVariables { get; } - string MarkdownSummaryPath { get; } - string PeriodicCommand { get; } - string PeriodicCommandArguments { get; } - TimeSpan PeriodicCommandInterval { get; } - bool? IncludeSystemPermissionTests { get; set; } - bool InCI { get; } - bool UseTcpTunnel { get; } - string VSDropsUri { get; } - - #endregion - - #region methods - - bool GetIncludeSystemPermissionTests (TestPlatform platform, bool device); - void Save (StringWriter doc, string path); - void Log (int minLevel, string message, params object [] args); - void Log (string message); - void Log (string message, params object [] args); - string GetDotNetExecutable (string directory); - - #endregion - } -} diff --git a/tests/xharness/Jenkins/Jenkins.cs b/tests/xharness/Jenkins/Jenkins.cs index 9a9f0e19d75c..d6def49f8554 100644 --- a/tests/xharness/Jenkins/Jenkins.cs +++ b/tests/xharness/Jenkins/Jenkins.cs @@ -17,8 +17,8 @@ using Xharness.Jenkins.TestTasks; namespace Xharness.Jenkins { - class Jenkins { - public readonly ISimulatorLoader Simulators; + public class Jenkins { + public readonly SimulatorLoader Simulators; public readonly IHardwareDeviceLoader Devices; readonly IMlaunchProcessManager processManager; public ITunnelBore TunnelBore { get; private set; } @@ -31,22 +31,30 @@ class Jenkins { // report writers, do need to be a class instance because the have state. readonly HtmlReportWriter xamarinStorageHtmlReportWriter; - readonly HtmlReportWriter vsdropsHtmlReportWriter; + readonly HtmlReportWriter? vsdropsHtmlReportWriter; readonly MarkdownReportWriter markdownReportWriter; public bool Populating { get; private set; } = true; - public IHarness Harness { get; } + public Harness Harness { get; } public bool ForceExtensionBuildOnly; public bool CleanSuccessfulTestRuns = true; public bool UninstallTestApp = true; - public IFileBackedLog MainLog; + IFileBackedLog? mainLog; + public IFileBackedLog MainLog { + get { + return mainLog!; + } + set { + mainLog = value; + } + } public ILog SimulatorLoadLog => DeviceLoader.SimulatorLoadLog; public ILog DeviceLoadLog => DeviceLoader.DeviceLoadLog; - string log_directory; + string? log_directory; public string LogDirectory { get { if (string.IsNullOrEmpty (log_directory)) { @@ -58,19 +66,19 @@ public string LogDirectory { } } - ILogs logs; + ILogs? logs; public ILogs Logs { get { return logs ?? (logs = new Logs (LogDirectory)); } } - public List Tasks { get; private set; } = new List (); + public List Tasks { get; private set; } = new List (); - public IErrorKnowledgeBase ErrorKnowledgeBase => new ErrorKnowledgeBase (); + public ErrorKnowledgeBase ErrorKnowledgeBase => new ErrorKnowledgeBase (); public IResourceManager ResourceManager => resourceManager; - public Jenkins (IHarness harness, IMlaunchProcessManager processManager, IResultParser resultParser, ITunnelBore tunnelBore) + public Jenkins (Harness harness, IMlaunchProcessManager processManager, IResultParser resultParser, ITunnelBore tunnelBore) { this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); this.TunnelBore = tunnelBore ?? throw new ArgumentNullException (nameof (tunnelBore)); @@ -105,7 +113,7 @@ public bool IsIncluded (TestProject project) return rv; } - public bool IsBetaXcode => Harness.XcodeRoot.IndexOf ("beta", StringComparison.OrdinalIgnoreCase) >= 0; + public bool IsBetaXcode => Harness.XcodeRoot?.IndexOf ("beta", StringComparison.OrdinalIgnoreCase) >= 0; async Task PopulateTasksAsync () { @@ -255,7 +263,7 @@ public int Run () command: Harness.PeriodicCommand, processManager: processManager, interval: Harness.PeriodicCommandInterval, - logs: logs, + logs: Logs, arguments: string.IsNullOrEmpty (Harness.PeriodicCommandArguments) ? null : Harness.PeriodicCommandArguments); periodicCommand.Execute ().DoNotAwait (); } @@ -305,7 +313,7 @@ public int Run () void CollectCrashReports () { try { - var dir = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), "Library", "Logs", "DiagnosticReports"); + var dir = Path.Combine (Environment.GetEnvironmentVariable ("HOME")!, "Library", "Logs", "DiagnosticReports"); var reports = Directory.GetFiles (dir).Select (v => { (string Path, DateTime LastWriteTimeUtc) rv = (v, File.GetLastWriteTimeUtc (v)); return rv; @@ -392,7 +400,7 @@ public void GenerateReport () throw new NotImplementedException (); } - var allTasks = new List (); + var allTasks = new List (); if (!Populating) { allTasks.AddRange (allExecuteTasks); allTasks.AddRange (allSimulatorTasks); @@ -437,7 +445,7 @@ public void GenerateReport () File.Move (tmpmarkdown, Harness.MarkdownSummaryPath); } - var dependentFileLocation = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location); + var dependentFileLocation = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location)!; foreach (var file in new string [] { "xharness.js", "xharness.css" }) { File.Copy (Path.Combine (dependentFileLocation, file), Path.Combine (LogDirectory, file), true); } diff --git a/tests/xharness/Jenkins/JenkinsDeviceLoader.cs b/tests/xharness/Jenkins/JenkinsDeviceLoader.cs index 107b8d67c65e..538e0e1f445e 100644 --- a/tests/xharness/Jenkins/JenkinsDeviceLoader.cs +++ b/tests/xharness/Jenkins/JenkinsDeviceLoader.cs @@ -8,7 +8,7 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; namespace Xharness.Jenkins { - class JenkinsDeviceLoader { + public class JenkinsDeviceLoader { static readonly string devicesName = "Device"; static readonly string simulatorsName = "Simulator"; diff --git a/tests/xharness/Jenkins/MacTaskTestsFactory.cs b/tests/xharness/Jenkins/MacTaskTestsFactory.cs index dfc399b255d6..552f92c70ffc 100644 --- a/tests/xharness/Jenkins/MacTaskTestsFactory.cs +++ b/tests/xharness/Jenkins/MacTaskTestsFactory.cs @@ -12,9 +12,9 @@ namespace Xharness.Jenkins { class MacTestTasksFactory : TaskFactory { - readonly ICrashSnapshotReporterFactory crashReportSnapshotFactory; + readonly CrashSnapshotReporterFactory crashReportSnapshotFactory; - public MacTestTasksFactory (Jenkins jenkins, IMlaunchProcessManager processManager, TestVariationsFactory testVariationsFactory, ICrashSnapshotReporterFactory crashReportSnapshotFactory) + public MacTestTasksFactory (Jenkins jenkins, IMlaunchProcessManager processManager, TestVariationsFactory testVariationsFactory, CrashSnapshotReporterFactory crashReportSnapshotFactory) : base (jenkins, processManager, testVariationsFactory) { this.crashReportSnapshotFactory = crashReportSnapshotFactory; diff --git a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs index 494d8e8dbcff..670799a45514 100644 --- a/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs +++ b/tests/xharness/Jenkins/Reports/HtmlReportWriter.cs @@ -29,7 +29,7 @@ class HtmlReportWriter : IReportWriter { string? previous_test_runs; // convenient - IHarness Harness => jenkins.Harness; + Harness Harness => jenkins.Harness; public HtmlReportWriter (Jenkins jenkins, IResourceManager resourceManager, IResultParser resultParser, string? linksPrefix = null, bool embeddedResources = false) { @@ -82,7 +82,7 @@ void IncludeCss (StreamWriter writer) writer.WriteLine (""); } } - public void Write (IList allTasks, StreamWriter writer) + public void Write (IList allTasks, StreamWriter writer) { var id_counter = 0; @@ -343,7 +343,7 @@ public void Write (IList allTasks, StreamWriter writer) state = test.ExecutionResult.ToString (); var log_id = id_counter++; var logs = test.AggregatedLogs.ToList (); - string title; + string? title; if (multipleModes) { title = test.Variation ?? "Default"; } else if (singleTask) { @@ -690,11 +690,11 @@ static string LinkEncode (string path) return System.Web.HttpUtility.UrlEncode (path).Replace ("%2f", "/").Replace ("+", "%20"); } - string RenderTextStates (IEnumerable tests) + string RenderTextStates (IEnumerable tests) { // Create a collection of all non-ignored tests in the group (unless all tests were ignored). var allIgnored = tests.All ((v) => v.ExecutionResult == TestExecutingResult.Ignored); - IEnumerable relevantGroup; + IEnumerable relevantGroup; if (allIgnored) { relevantGroup = tests; } else { diff --git a/tests/xharness/Jenkins/Reports/IReportWriter.cs b/tests/xharness/Jenkins/Reports/IReportWriter.cs index 97fc23b3dd36..6f222c45d8e8 100644 --- a/tests/xharness/Jenkins/Reports/IReportWriter.cs +++ b/tests/xharness/Jenkins/Reports/IReportWriter.cs @@ -8,6 +8,6 @@ namespace Xharness.Jenkins.Reports { /// To be implemented by those classes that write reports regarding the results of the executed tasks. ///
interface IReportWriter { - void Write (IList tasks, StreamWriter writer); + void Write (IList tasks, StreamWriter writer); } } diff --git a/tests/xharness/Jenkins/Reports/MarkdownReportWriter.cs b/tests/xharness/Jenkins/Reports/MarkdownReportWriter.cs index c3a9de0562a5..5db4f6c215aa 100644 --- a/tests/xharness/Jenkins/Reports/MarkdownReportWriter.cs +++ b/tests/xharness/Jenkins/Reports/MarkdownReportWriter.cs @@ -13,13 +13,13 @@ namespace Xharness.Jenkins.Reports { ///
class MarkdownReportWriter : IReportWriter { - void WriteFailedTestsDetails (IEnumerable failedTests, StreamWriter writer) + void WriteFailedTestsDetails (IEnumerable failedTests, StreamWriter writer) { writer.WriteLine ("## Failed tests"); writer.WriteLine (); foreach (var group in failedTests.GroupBy ((v) => v.TestName)) { - if (group is IEnumerable enumerableGroup) { + if (group is IEnumerable enumerableGroup) { foreach (var test in enumerableGroup) { writer.Write ($" * {group.Key}"); if (!string.IsNullOrEmpty (test.Mode)) @@ -48,7 +48,7 @@ void WriteFailedTestsDetails (IEnumerable failedTests, StreamWriter w } - public void Write (IList allTasks, StreamWriter writer) + public void Write (IList allTasks, StreamWriter writer) { var failedTests = allTasks.Where ((v) => v.Failed); var deviceNotFound = allTasks.Where ((v) => v.DeviceNotFound); diff --git a/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs b/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs index 91f095fec843..87234db22848 100644 --- a/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs +++ b/tests/xharness/Jenkins/RunSimulatorTasksFactory.cs @@ -77,7 +77,7 @@ public async override Task> CreateTasksAsync () simulators: jenkins.Simulators, buildTask: buildTask, processManager: processManager, - candidates: candidates?.Cast () ?? test.Candidates)).ToList (); + candidates: candidates?.Cast () ?? test.Candidates)).ToList (); if (jenkins.IsServerMode) return testVariations; diff --git a/tests/xharness/Jenkins/TestData.cs b/tests/xharness/Jenkins/TestData.cs index 4e240071afbd..9b6d22436477 100644 --- a/tests/xharness/Jenkins/TestData.cs +++ b/tests/xharness/Jenkins/TestData.cs @@ -5,18 +5,11 @@ namespace Xharness.Jenkins { class TestData { - public string Variation; - public KnownIssue KnownFailure; - public bool Debug; - public string LinkMode; + public string? Variation; + public KnownIssue? KnownFailure; public bool? Ignored; - public bool EnableSGenConc; - public bool UseLlvm; - public bool? UseMonoRuntime; - public IEnumerable Candidates; - public string RuntimeIdentifier; - public string Registrar; - public bool PublishAot; // NativeAOT - public string TestVariation; + public IEnumerable? Candidates; + public string? RuntimeIdentifier; + public string? TestVariation; } } diff --git a/tests/xharness/Jenkins/TestSelector.cs b/tests/xharness/Jenkins/TestSelector.cs index a3d82d6a7817..08c95ef312e8 100644 --- a/tests/xharness/Jenkins/TestSelector.cs +++ b/tests/xharness/Jenkins/TestSelector.cs @@ -10,7 +10,7 @@ namespace Xharness.Jenkins { - class TestSelection { + public class TestSelection { TestLabel selection = TestLabel.None | TestLabel.Msbuild | @@ -90,7 +90,7 @@ class TestSelector { readonly IVersionControlSystem vcs; ILog? MainLog => jenkins?.MainLog; - IHarness Harness => jenkins.Harness; + Harness Harness => jenkins.Harness; #endregion diff --git a/tests/xharness/Jenkins/TestServer.cs b/tests/xharness/Jenkins/TestServer.cs index 916a06c5c379..9ffc9554ac4b 100644 --- a/tests/xharness/Jenkins/TestServer.cs +++ b/tests/xharness/Jenkins/TestServer.cs @@ -45,7 +45,7 @@ public Task RunAsync (Jenkins jenkins, HtmlReportWriter htmlReportWriter) // Try and find an unused port int attemptsLeft = 50; int port = 51234; // Try this port first, to try to not vary between runs just because. - Random r = new Random ((int) DateTime.Now.Ticks); + var r = new Random ((int) DateTime.Now.Ticks); do { var newPort = port != 0 ? port : r.Next (49152, 65535); // The suggested range for dynamic ports is 49152-65535 (IANA) server = new HttpListener (); @@ -68,10 +68,10 @@ public Task RunAsync (Jenkins jenkins, HtmlReportWriter htmlReportWriter) var context = server.GetContext (); var request = context.Request; var response = context.Response; - var arguments = System.Web.HttpUtility.ParseQueryString (request.Url.Query); + var arguments = System.Web.HttpUtility.ParseQueryString (request.Url?.Query ?? ""); try { var allTasks = jenkins.Tasks.SelectMany ((v) => { - var rv = new List (); + var rv = new List (); var runsim = v as AggregatedRunSimulatorTask; if (runsim is not null) rv.AddRange (runsim.Tasks); @@ -79,9 +79,9 @@ public Task RunAsync (Jenkins jenkins, HtmlReportWriter htmlReportWriter) return rv; }); - IEnumerable find_tasks (StreamWriter writer, string ids) + IEnumerable find_tasks (StreamWriter writer, string ids) { - IEnumerable tasks; + IEnumerable tasks; switch (request.Url.Query) { case "?all": tasks = jenkins.Tasks; @@ -97,7 +97,7 @@ IEnumerable find_tasks (StreamWriter writer, string ids) return Array.Empty (); default: var id_inputs = ids.Substring (1).Split (','); - var rv = new List (id_inputs.Length); + var rv = new List (id_inputs.Length); foreach (var id_input in id_inputs) { if (int.TryParse (id_input, out var id)) { var task = jenkins.Tasks.FirstOrDefault ((t) => t.ID == id); @@ -118,9 +118,9 @@ IEnumerable find_tasks (StreamWriter writer, string ids) return tasks; } - string serveFile = null; + string? serveFile = null; // do not allow requests that are not http or https - if (request.Url.Scheme != Uri.UriSchemeHttp && request.Url.Scheme != Uri.UriSchemeHttps) { + if (request.Url?.Scheme != Uri.UriSchemeHttp && request.Url?.Scheme != Uri.UriSchemeHttps) { response.StatusCode = 400; response.StatusDescription = "Bad Request"; response.OutputStream.Write (System.Text.Encoding.UTF8.GetBytes ("Invalid local path")); @@ -128,7 +128,7 @@ IEnumerable find_tasks (StreamWriter writer, string ids) } var localPath = request.Url.LocalPath; var file = Path.GetFileName (localPath); - var directoryName = Path.GetDirectoryName (localPath); + var directoryName = Path.GetDirectoryName (localPath)!; var jenkinsDirectoryName = $"/{Path.GetFileName (jenkins.LogDirectory)}"; // for the request to be valid the local path has to be one of the following @@ -329,7 +329,7 @@ IEnumerable find_tasks (StreamWriter writer, string ids) } if (serveFile is null) { - serveFile = Path.Combine (Path.GetDirectoryName (jenkins.LogDirectory), localPath.Substring (1)); + serveFile = Path.Combine (Path.GetDirectoryName (jenkins.LogDirectory)!, localPath.Substring (1)); serveFile = Path.GetFullPath (serveFile); if (!serveFile.StartsWith (Path.GetDirectoryName (Path.GetFullPath (jenkins.LogDirectory)) + Path.DirectorySeparatorChar)) { Console.WriteLine ($"400: {localPath}"); diff --git a/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs b/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs index b8e47819e90f..896e9a506d18 100644 --- a/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/AppleTestTask.cs @@ -6,9 +6,9 @@ #nullable enable namespace Xharness.Jenkins.TestTasks { - abstract class AppleTestTask : TestTasks { + public abstract class AppleTestTask : TestTask { public Jenkins Jenkins { get; private set; } - public IHarness Harness { get { return Jenkins.Harness; } } + public Harness Harness { get { return Jenkins.Harness; } } public override string RootDirectory => HarnessConfiguration.RootDirectory; public override IResourceManager ResourceManager => Jenkins.ResourceManager; @@ -28,7 +28,7 @@ public AppleTestTask (Jenkins jenkins) public override void GenerateReport () => Jenkins.GenerateReport (); - protected override void WriteLineToRunnerLog (string message) => Harness.HarnessLog.WriteLine (message); + protected override void WriteLineToRunnerLog (string message) => Harness.HarnessLog?.WriteLine (message); public override void SetEnvironmentVariables (Process process) { diff --git a/tests/xharness/Jenkins/TestTasks/BuildProjectTask.cs b/tests/xharness/Jenkins/TestTasks/BuildProjectTask.cs index ce21abb56c05..34e494bc3b1e 100644 --- a/tests/xharness/Jenkins/TestTasks/BuildProjectTask.cs +++ b/tests/xharness/Jenkins/TestTasks/BuildProjectTask.cs @@ -2,10 +2,10 @@ using Microsoft.DotNet.XHarness.Common.Execution; namespace Xharness.Jenkins.TestTasks { - abstract class BuildProjectTask : BuildToolTask { - BuildProject BuildProject => buildToolTask as BuildProject; + public abstract class BuildProjectTask : BuildToolTask { + BuildProject BuildProject => (BuildProject) buildToolTask; - public string SolutionPath { + public string? SolutionPath { get => BuildProject.SolutionPath; set => BuildProject.SolutionPath = value; } diff --git a/tests/xharness/Jenkins/TestTasks/BuildTool.cs b/tests/xharness/Jenkins/TestTasks/BuildTool.cs index 860e4b96ba72..e393747fc940 100644 --- a/tests/xharness/Jenkins/TestTasks/BuildTool.cs +++ b/tests/xharness/Jenkins/TestTasks/BuildTool.cs @@ -7,11 +7,11 @@ namespace Xharness.Jenkins.TestTasks { public class BuildTool { - public string TestName { get; set; } + public string TestName { get; set; } = ""; public IProcessManager ProcessManager { get; } public TestPlatform Platform { get; set; } - public TestProject TestProject { get; set; } - public IFileBackedLog BuildLog { get; set; } + public TestProject? TestProject { get; set; } + public IFileBackedLog? BuildLog { get; set; } public bool SpecifyPlatform { get; set; } = true; public bool SpecifyConfiguration { get; set; } = true; @@ -27,7 +27,7 @@ public BuildTool (IProcessManager processManager, TestPlatform platform) : this Platform = platform; } - public virtual string Mode { + public virtual string? Mode { get { return Platform.ToString (); } set { throw new NotSupportedException (); } } diff --git a/tests/xharness/Jenkins/TestTasks/BuildToolTask.cs b/tests/xharness/Jenkins/TestTasks/BuildToolTask.cs index a61b60d4a6dc..c0a98763d699 100644 --- a/tests/xharness/Jenkins/TestTasks/BuildToolTask.cs +++ b/tests/xharness/Jenkins/TestTasks/BuildToolTask.cs @@ -5,12 +5,12 @@ using Microsoft.DotNet.XHarness.Common.Logging; namespace Xharness.Jenkins.TestTasks { - abstract class BuildToolTask : AppleTestTask, IBuildToolTask { + public abstract class BuildToolTask : AppleTestTask { protected BuildTool buildToolTask; public IProcessManager ProcessManager { get; } - public IFileBackedLog BuildLog { + public IFileBackedLog? BuildLog { get => buildToolTask.BuildLog; set => buildToolTask.BuildLog = value; } @@ -37,7 +37,7 @@ public List Constants { get => buildToolTask.Constants; } - public override TestProject TestProject { + public override TestProject? TestProject { get => base.TestProject; set { base.TestProject = value; @@ -50,7 +50,7 @@ protected BuildToolTask (Jenkins jenkins, TestProject testProject, IProcessManag base.TestProject = testProject; ProcessManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); InitializeTool (); - buildToolTask.TestProject = testProject; + buildToolTask!.TestProject = testProject; } public override TestPlatform Platform { @@ -61,7 +61,7 @@ public override TestPlatform Platform { } } - public override string Mode { + public override string? Mode { get => buildToolTask.Mode; set => buildToolTask.Mode = value; } diff --git a/tests/xharness/Jenkins/TestTasks/DotNetBuild.cs b/tests/xharness/Jenkins/TestTasks/DotNetBuild.cs index 17d20c21ad30..6b3dcf421a12 100644 --- a/tests/xharness/Jenkins/TestTasks/DotNetBuild.cs +++ b/tests/xharness/Jenkins/TestTasks/DotNetBuild.cs @@ -16,7 +16,7 @@ public DotNetBuild (Func msbuildPath, IErrorKnowledgeBase errorKnowledgeBase) : base (msbuildPath, processManager, resourceManager, eventLogger, envManager, errorKnowledgeBase) { } - public override List GetToolArguments (string projectPlatform, string projectConfiguration, string projectFile, IFileBackedLog buildLog) + public override List GetToolArguments (string? projectPlatform, string? projectConfiguration, string projectFile, IFileBackedLog buildLog) { var args = base.GetToolArguments (projectPlatform, projectConfiguration, projectFile, buildLog); args.Remove ("--"); diff --git a/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs b/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs index 73f81acc219c..55f11fabecd6 100644 --- a/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/DotNetTestTask.cs @@ -50,9 +50,9 @@ public override async Task RunTestAsync () args.Add (filter); } - WorkingDirectory = Path.GetDirectoryName (ProjectFile); + WorkingDirectory = Path.GetDirectoryName (ProjectFile)!; - await ExecuteProcessAsync (Jenkins.Harness.GetDotNetExecutable (Path.GetDirectoryName (ProjectFile)), args); + await ExecuteProcessAsync (Jenkins.Harness.GetDotNetExecutable (Path.GetDirectoryName (ProjectFile)!), args); try { var xmlDoc = new XmlDocument (); diff --git a/tests/xharness/Jenkins/TestTasks/IBuildToolTask.cs b/tests/xharness/Jenkins/TestTasks/IBuildToolTask.cs deleted file mode 100644 index 698884332e74..000000000000 --- a/tests/xharness/Jenkins/TestTasks/IBuildToolTask.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.Execution; -using Microsoft.DotNet.XHarness.Common.Logging; - -namespace Xharness.Jenkins.TestTasks { - - /// - /// Interface to be implemented by those tasks that represent a build execution. - /// - public interface IBuildToolTask : ITestTask { - IFileBackedLog BuildLog { get; } - bool SpecifyPlatform { get; set; } - bool SpecifyConfiguration { get; set; } - - IProcessManager ProcessManager { get; } - TestProject TestProject { get; set; } - - Task CleanAsync (); - } -} diff --git a/tests/xharness/Jenkins/TestTasks/IRunDeviceTask.cs b/tests/xharness/Jenkins/TestTasks/IRunDeviceTask.cs deleted file mode 100644 index 22d891f389e3..000000000000 --- a/tests/xharness/Jenkins/TestTasks/IRunDeviceTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; - -namespace Xharness.Jenkins.TestTasks { - public interface IRunDeviceTask : IRunXITask { - - ITunnelBore TunnelBore { get; } - } -} diff --git a/tests/xharness/Jenkins/TestTasks/IRunSimulatorTask.cs b/tests/xharness/Jenkins/TestTasks/IRunSimulatorTask.cs deleted file mode 100644 index 8da7fdd87997..000000000000 --- a/tests/xharness/Jenkins/TestTasks/IRunSimulatorTask.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; - -namespace Xharness.Jenkins.TestTasks { - public interface IRunSimulatorTask : IRunXITask { - - Task AcquireResourceAsync (); - } -} diff --git a/tests/xharness/Jenkins/TestTasks/IRunTestTask.cs b/tests/xharness/Jenkins/TestTasks/IRunTestTask.cs deleted file mode 100644 index 73f6163bbb77..000000000000 --- a/tests/xharness/Jenkins/TestTasks/IRunTestTask.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.iOS.Shared.Execution; - -namespace Xharness.Jenkins.TestTasks { - public interface IRunTestTask : ITestTask { - IHarness Harness { get; } - double TimeoutMultiplier { get; } - IMlaunchProcessManager ProcessManager { get; } - IBuildToolTask BuildTask { get; } - Task RunTestAsync (); - Task VerifyBuildAsync (); - } -} diff --git a/tests/xharness/Jenkins/TestTasks/IRunXITask.cs b/tests/xharness/Jenkins/TestTasks/IRunXITask.cs deleted file mode 100644 index f2aab4b305d9..000000000000 --- a/tests/xharness/Jenkins/TestTasks/IRunXITask.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; - -namespace Xharness.Jenkins.TestTasks { - public interface IRunXITask : IRunTestTask where TDevice : class, IDevice { - - AppRunner Runner { get; set; } - AppRunner AdditionalRunner { get; set; } - TestTarget AppRunnerTarget { get; set; } - IEnumerable Candidates { get; } - TDevice Device { get; set; } - } -} diff --git a/tests/xharness/Jenkins/TestTasks/ITestTask.cs b/tests/xharness/Jenkins/TestTasks/ITestTask.cs deleted file mode 100644 index 77f8d7e9ab6e..000000000000 --- a/tests/xharness/Jenkins/TestTasks/ITestTask.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.Logging; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Logging; - -namespace Xharness.Jenkins.TestTasks { - public interface ITestTask { - - #region Status properties - - bool NotStarted { get; } - bool Building { get; } - bool BuildSucceeded { get; } - bool BuildFailure { get; } - bool Waiting { get; } - bool InProgress { get; } - bool Running { get; } - bool Finished { get; } - bool HarnessException { get; } - bool Built { get; } - - bool Succeeded { get; } - bool Failed { get; } - bool TimedOut { get; } - bool Crashed { get; } - bool LaunchFailure { get; } - bool DeviceNotFound { get; } - - public TimeSpan WaitingDuration { get; } - - #endregion - - bool HasCustomTestName { get; } - bool BuildOnly { get; set; } - bool Ignored { get; set; } - - KnownIssue KnownFailure { get; set; } - string ProjectConfiguration { get; set; } - string ProjectPlatform { get; set; } - string ProjectFile { get; } - string Mode { get; set; } - string Variation { get; set; } - string TestName { get; } - string FailureMessage { get; set; } - string LogDirectory { get; } - - public int ID { get; } - - - TimeSpan Duration { get; } - TestPlatform Platform { get; set; } - Task InitialTask { get; set; } - TestExecutingResult ExecutionResult { get; set; } - IEnumerable AggregatedLogs { get; } - ILogs Logs { get; } - Stopwatch DurationStopWatch { get; } - string ProgressMessage { get; } - string RootDirectory { get; } - - - string GuessFailureReason (IReadableLog log); - Task RunAsync (); - Task VerifyRunAsync (); - void Reset (); - Task NotifyBlockingWaitAsync (Task task); - } -} diff --git a/tests/xharness/Jenkins/TestTasks/ITestTaskExtensions.cs b/tests/xharness/Jenkins/TestTasks/ITestTaskExtensions.cs index 51df4e73d483..1992fdc66afa 100644 --- a/tests/xharness/Jenkins/TestTasks/ITestTaskExtensions.cs +++ b/tests/xharness/Jenkins/TestTasks/ITestTaskExtensions.cs @@ -4,7 +4,7 @@ namespace Xharness.Jenkins.TestTasks { public static class ITestTaskExtensions { - public static string GetTestColor (this IEnumerable tests) + public static string GetTestColor (this IEnumerable tests) { if (!tests.Any ()) return "black"; @@ -36,7 +36,7 @@ public static string GetTestColor (this IEnumerable tests) return "black"; } - public static string GetTestColor (this ITestTask test) + public static string GetTestColor (this TestTask test) { if (test.NotStarted) { return "black"; diff --git a/tests/xharness/Jenkins/TestTasks/MSBuild.cs b/tests/xharness/Jenkins/TestTasks/MSBuild.cs index b38ff9043a16..9c91806fc2a4 100644 --- a/tests/xharness/Jenkins/TestTasks/MSBuild.cs +++ b/tests/xharness/Jenkins/TestTasks/MSBuild.cs @@ -17,7 +17,7 @@ public class MSBuild : BuildProject { readonly IErrorKnowledgeBase errorKnowledgeBase; readonly Func msbuildPath; - public virtual List GetToolArguments (string projectPlatform, string projectConfiguration, string projectFile, IFileBackedLog buildLog) + public virtual List GetToolArguments (string? projectPlatform, string? projectConfiguration, string projectFile, IFileBackedLog buildLog) { var binlogPath = buildLog.FullPath.Replace (".txt", ".binlog"); @@ -49,7 +49,7 @@ public MSBuild (Func msbuildPath, this.errorKnowledgeBase = errorKnowledgeBase ?? throw new ArgumentNullException (nameof (errorKnowledgeBase)); } - public async Task<(TestExecutingResult ExecutionResult, KnownIssue KnownFailure)> ExecuteAsync ( + public async Task<(TestExecutingResult ExecutionResult, KnownIssue? KnownFailure)> ExecuteAsync ( string projectPlatform, string projectConfiguration, string projectFile, @@ -59,7 +59,7 @@ public MSBuild (Func msbuildPath, ILog mainLog) { BuildLog = buildLog; - (TestExecutingResult ExecutionResult, KnownIssue KnownFailure) result = (TestExecutingResult.NotStarted, (KnownIssue) null); + (TestExecutingResult ExecutionResult, KnownIssue? KnownFailure) result = default; using (var xbuild = new Process ()) { xbuild.StartInfo.FileName = msbuildPath (); @@ -87,7 +87,7 @@ public MSBuild (Func msbuildPath, return result; } - async Task CleanProjectAsync (string project_file, string project_platform, string project_configuration, ILog log, ILog mainLog) + async Task CleanProjectAsync (string project_file, string? project_platform, string? project_configuration, ILog log, ILog mainLog) { // Don't require the desktop resource here, this shouldn't be that resource sensitive using (var xbuild = new Process ()) { diff --git a/tests/xharness/Jenkins/TestTasks/MSBuildTask.cs b/tests/xharness/Jenkins/TestTasks/MSBuildTask.cs index a4c3008f1186..eb1edff9fcc4 100644 --- a/tests/xharness/Jenkins/TestTasks/MSBuildTask.cs +++ b/tests/xharness/Jenkins/TestTasks/MSBuildTask.cs @@ -6,10 +6,10 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Logging; namespace Xharness.Jenkins.TestTasks { - class MSBuildTask : BuildProjectTask { + public class MSBuildTask : BuildProjectTask { protected virtual string ToolName { get { - return Jenkins.Harness.GetDotNetExecutable (Path.GetDirectoryName (ProjectFile)); + return Jenkins.Harness.GetDotNetExecutable (Path.GetDirectoryName (ProjectFile)!); } } @@ -26,9 +26,9 @@ public override void SetEnvironmentVariables (Process process) } protected virtual List ToolArguments => - MSBuild.GetToolArguments (ProjectPlatform, ProjectConfiguration, ProjectFile, BuildLog); + MSBuild.GetToolArguments (ProjectPlatform, ProjectConfiguration, ProjectFile, BuildLog!); - MSBuild MSBuild => buildToolTask as MSBuild; + MSBuild MSBuild => (MSBuild) buildToolTask; public MSBuildTask (Jenkins jenkins, TestProject testProject, IProcessManager processManager) : base (jenkins, testProject, processManager) { } @@ -49,8 +49,8 @@ protected override async Task ExecuteAsync () using var resource = await NotifyAndAcquireDesktopResourceAsync (); BuildLog = Logs.Create ($"build-{Platform}-{Timestamp}.txt", LogType.BuildLog.ToString ()); (ExecutionResult, KnownFailure) = await MSBuild.ExecuteAsync ( - projectPlatform: ProjectPlatform, - projectConfiguration: ProjectConfiguration, + projectPlatform: ProjectPlatform!, + projectConfiguration: ProjectConfiguration!, projectFile: ProjectFile, resource: resource, dryRun: Jenkins.Harness.DryRun, @@ -62,13 +62,13 @@ protected override async Task ExecuteAsync () public override Task CleanAsync () => MSBuild.CleanAsync ( - projectPlatform: ProjectPlatform, - projectConfiguration: ProjectConfiguration, + projectPlatform: ProjectPlatform!, + projectConfiguration: ProjectConfiguration!, projectFile: ProjectFile, cleanLog: Logs.Create ($"clean-{Platform}-{Timestamp}.txt", "Clean log"), mainLog: Jenkins.MainLog); - public static void SetDotNetEnvironmentVariables (Dictionary environment) + public static void SetDotNetEnvironmentVariables (Dictionary environment) { environment ["MSBUILD_EXE_PATH"] = null; environment ["MSBuildExtensionsPathFallbackPathsOverride"] = null; diff --git a/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs b/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs index be8c515719ef..6b43a0205eba 100644 --- a/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs +++ b/tests/xharness/Jenkins/TestTasks/MacExecuteTask.cs @@ -14,12 +14,12 @@ namespace Xharness.Jenkins.TestTasks { class MacExecuteTask : MacTask { - protected ICrashSnapshotReporterFactory CrashReportSnapshotFactory { get; } + protected CrashSnapshotReporterFactory CrashReportSnapshotFactory { get; } - public string Path; + public string? Path; public bool IsUnitTest; - public MacExecuteTask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProcessManager processManager, ICrashSnapshotReporterFactory crashReportSnapshotFactory) + public MacExecuteTask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProcessManager processManager, CrashSnapshotReporterFactory crashReportSnapshotFactory) : base (jenkins, build_task, processManager) { this.CrashReportSnapshotFactory = crashReportSnapshotFactory ?? throw new ArgumentNullException (nameof (crashReportSnapshotFactory)); @@ -45,20 +45,20 @@ public override async Task RunTestAsync () name = System.IO.Path.GetFileName (System.IO.Path.GetDirectoryName (projectDir)); var suffix = string.Empty; if (ProjectFile.EndsWith (".slnx", StringComparison.Ordinal)) { - Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile), "bin", BuildTask.ProjectPlatform, BuildTask.ProjectConfiguration + suffix, name + ".app", "Contents", "MacOS", name); + Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile)!, "bin", BuildTask.ProjectPlatform!, BuildTask.ProjectConfiguration + suffix, name + ".app", "Contents", "MacOS", name!); } else { var project = new XmlDocument (); project.LoadWithoutNetworkAccess (ProjectFile); - var outputPath = await Harness.AppBundleLocator.LocateAppBundle (project, ProjectFile, TestTarget.None, BuildTask.ProjectConfiguration); + var outputPath = await Harness.AppBundleLocator.LocateAppBundle (project, ProjectFile, TestTarget.None, BuildTask.ProjectConfiguration!); var assemblyName = project.GetAssemblyName (); - Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile), outputPath, assemblyName + ".app", "Contents", "MacOS", assemblyName); + Path = System.IO.Path.Combine (System.IO.Path.GetDirectoryName (ProjectFile)!, outputPath!, assemblyName + ".app", "Contents", "MacOS", assemblyName); } using (var resource = await NotifyAndAcquireDesktopResourceAsync ()) { using (var proc = new Process ()) { proc.StartInfo.FileName = Path; var arguments = new List (); - IFileBackedLog xmlLog = null; + IFileBackedLog? xmlLog = null; var useXmlOutput = Harness.InCI || true; if (IsUnitTest) { var extension = useXmlOutput ? "xml" : "log"; @@ -88,14 +88,14 @@ public override async Task RunTestAsync () proc.StartInfo.Arguments = StringUtils.FormatArguments (arguments); Jenkins.MainLog.WriteLine ("Executing {0} ({1})", TestName, Mode); var log = Logs.Create ($"execute-{Platform}-{Timestamp}.txt", LogType.ExecutionLog.ToString ()); - ICrashSnapshotReporter snapshot = null; + ICrashSnapshotReporter? snapshot = null; if (!Jenkins.Harness.DryRun) { ExecutionResult = TestExecutingResult.Running; snapshot = CrashReportSnapshotFactory.Create (log, Logs, isDevice: false, deviceName: null); await snapshot.StartCaptureAsync (); - ProcessExecutionResult result = null; + ProcessExecutionResult? result = null; try { var timeout = TimeSpan.FromMinutes (20); @@ -119,8 +119,8 @@ public override async Task RunTestAsync () if (IsUnitTest) { var reporterFactory = new TestReporterFactory (ProcessManager); - var listener = new Microsoft.DotNet.XHarness.iOS.Shared.Listeners.SimpleFileListener (xmlLog.FullPath, log, xmlLog, useXmlOutput); - var reporter = reporterFactory.Create (Harness.HarnessLog, log, Logs, snapshot, listener, Harness.ResultParser, new AppBundleInformation ("N/A", "N/A", "N/A", "N/A", true, null), RunMode.MacOS, Harness.XmlJargon, "no device here", TimeSpan.Zero); + var listener = new Microsoft.DotNet.XHarness.iOS.Shared.Listeners.SimpleFileListener (xmlLog!.FullPath, log, xmlLog, useXmlOutput); + var reporter = reporterFactory.Create (Harness.HarnessLog!, log, Logs, snapshot!, listener, Harness.ResultParser, new AppBundleInformation ("N/A", "N/A", "N/A", "N/A", true, null), RunMode.MacOS, Harness.XmlJargon, "no device here", TimeSpan.Zero); var rv = await reporter.ParseResult (); if (ExecutionResult == TestExecutingResult.Succeeded) { diff --git a/tests/xharness/Jenkins/TestTasks/MacTask.cs b/tests/xharness/Jenkins/TestTasks/MacTask.cs index 510fa15564d1..b426712da750 100644 --- a/tests/xharness/Jenkins/TestTasks/MacTask.cs +++ b/tests/xharness/Jenkins/TestTasks/MacTask.cs @@ -8,7 +8,7 @@ public MacTask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProcessManage { } - public override string Mode { + public override string? Mode { get { switch (Platform) { case TestPlatform.Mac: diff --git a/tests/xharness/Jenkins/TestTasks/Resource.cs b/tests/xharness/Jenkins/TestTasks/Resource.cs index 289d8d5c8db5..9b95123d9030 100644 --- a/tests/xharness/Jenkins/TestTasks/Resource.cs +++ b/tests/xharness/Jenkins/TestTasks/Resource.cs @@ -21,7 +21,7 @@ public class Resource { public int QueuedUsers => queue.Count + exclusive_queue.Count; public int MaxConcurrentUsers { get; set; } = 1; - public Resource (string name, int max_concurrent_users = 1, string description = null) + public Resource (string name, int max_concurrent_users = 1, string? description = null) { this.Name = name; this.MaxConcurrentUsers = max_concurrent_users; @@ -62,13 +62,13 @@ void Release () lock (queue) { Users--; exclusive = false; - if (queue.TryDequeue (out TaskCompletionSource tcs)) { + if (queue.TryDequeue (out var tcs)) { Users++; - tcs.SetResult ((IAcquiredResource) tcs.Task.AsyncState); + tcs.SetResult ((IAcquiredResource) tcs.Task.AsyncState!); } else if (Users == 0 && exclusive_queue.TryDequeue (out tcs)) { Users++; exclusive = true; - tcs.SetResult ((IAcquiredResource) tcs.Task.AsyncState); + tcs.SetResult ((IAcquiredResource) tcs.Task.AsyncState!); } } } diff --git a/tests/xharness/Jenkins/TestTasks/RunDevice.cs b/tests/xharness/Jenkins/TestTasks/RunDevice.cs index fcbf1ed59b38..0fb0d644ce53 100644 --- a/tests/xharness/Jenkins/TestTasks/RunDevice.cs +++ b/tests/xharness/Jenkins/TestTasks/RunDevice.cs @@ -11,7 +11,7 @@ namespace Xharness.Jenkins.TestTasks { public class RunDevice { - readonly IRunDeviceTask testTask; + readonly RunDeviceTask testTask; readonly IHardwareDeviceLoader devices; readonly IResultParser resultParser = new XmlResultParser (); readonly IResourceManager resourceManager; @@ -26,9 +26,9 @@ public class RunDevice { readonly XmlResultJargon xmlResultJargon; readonly IErrorKnowledgeBase errorKnowledgeBase; - public AppInstallMonitorLog InstallLog { get; private set; } + public AppInstallMonitorLog? InstallLog { get; private set; } - public RunDevice (IRunDeviceTask testTask, + public RunDevice (RunDeviceTask testTask, IHardwareDeviceLoader devices, IResourceManager resourceManager, ILog mainLog, @@ -77,7 +77,7 @@ public async Task RunTestAsync () testTask.Device = testTask.Candidates.First ((d) => d.UDID == device_resource.Resource.Name); mainLog.WriteLine ("Acquired device '{0}' for '{1}'", testTask.Device.Name, testTask.ProjectFile); - ITunnelBore tunnelBore = null; + ITunnelBore? tunnelBore = null; if (useTcpTunnel && testTask.Device.DevicePlatform != DevicePlatform.iOS && testTask.Device.DevicePlatform != DevicePlatform.tvOS) { mainLog.WriteLine ("Ignoring request to use a tunnel because it is not supported by the specified platform"); @@ -163,7 +163,7 @@ public async Task RunTestAsync () } finally { // Uninstall again, so that we don't leave junk behind and fill up the device. if (uninstallTestApp) { - testTask.Runner.MainLog = uninstall_log; + testTask.Runner!.MainLog = uninstall_log; var uninstall_result = await testTask.Runner.UninstallAsync (); if (!uninstall_result.Succeeded) mainLog.WriteLine ($"Post-run uninstall failed, exit code: {uninstall_result.ExitCode} (this won't affect the test result)"); diff --git a/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs b/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs index 19788fbefd1c..c019be39cffe 100644 --- a/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunDeviceTask.cs @@ -8,11 +8,11 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; namespace Xharness.Jenkins.TestTasks { - class RunDeviceTask : RunXITask, IRunDeviceTask { + public class RunDeviceTask : RunXITask { public ITunnelBore TunnelBore { get; private set; } RunDevice runDevice; - public override string ProgressMessage { + public override string? ProgressMessage { get { var log = runDevice.InstallLog; if (log is null) diff --git a/tests/xharness/Jenkins/TestTasks/RunSimulator.cs b/tests/xharness/Jenkins/TestTasks/RunSimulator.cs index ca5eb393c47f..e94c372e0534 100644 --- a/tests/xharness/Jenkins/TestTasks/RunSimulator.cs +++ b/tests/xharness/Jenkins/TestTasks/RunSimulator.cs @@ -15,8 +15,8 @@ public class RunSimulator { readonly ILog mainLog; readonly ILog simulatorLoadLog; - readonly ISimulatorLoader simulators; - readonly IRunSimulatorTask testTask; + readonly SimulatorLoader simulators; + readonly RunSimulatorTask testTask; readonly IErrorKnowledgeBase errorKnowledgeBase; public IEnumerable Simulators { @@ -29,9 +29,9 @@ public IEnumerable Simulators { } } - public RunSimulator (IRunSimulatorTask testTask, - ISimulatorLoader simulators, - IErrorKnowledgeBase errorKnowledgeBase, + public RunSimulator (RunSimulatorTask testTask, + SimulatorLoader simulators, + ErrorKnowledgeBase errorKnowledgeBase, ILog mainLog, ILog simulatorLoadLog) { @@ -95,7 +95,7 @@ public async Task SelectSimulatorAsync () new TestReporterFactory (testTask.ProcessManager), testTask.AppRunnerTarget, testTask.Harness, - mainLog: testTask.Logs.Create ($"run-{testTask.Device.UDID}-{Harness.Helpers.Timestamp}.log", "Run log"), + mainLog: testTask.Logs.Create ($"run-{testTask.Device!.UDID}-{Harness.Helpers.Timestamp}.log", "Run log"), logs: testTask.Logs, projectFilePath: testTask.ProjectFile, ensureCleanSimulatorState: clean_state, @@ -120,7 +120,7 @@ public async Task RunTestAsync () using (var resource = await testTask.NotifyBlockingWaitAsync (testTask.AcquireResourceAsync ())) { if (testTask.Runner is null) await SelectSimulatorAsync (); - await testTask.Runner.RunAsync (); + await testTask.Runner!.RunAsync (); } testTask.ExecutionResult = testTask.Runner.Result; diff --git a/tests/xharness/Jenkins/TestTasks/RunSimulatorTask.cs b/tests/xharness/Jenkins/TestTasks/RunSimulatorTask.cs index 2b7353c04113..ff2ab887243f 100644 --- a/tests/xharness/Jenkins/TestTasks/RunSimulatorTask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunSimulatorTask.cs @@ -4,14 +4,14 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; namespace Xharness.Jenkins.TestTasks { - class RunSimulatorTask : RunXITask, IRunSimulatorTask { + public class RunSimulatorTask : RunXITask { readonly RunSimulator runSimulator; - public IAcquiredResource AcquiredResource; + public IAcquiredResource? AcquiredResource; public IEnumerable Simulators => runSimulator.Simulators; - public RunSimulatorTask (Jenkins jenkins, ISimulatorLoader simulators, MSBuildTask buildTask, IMlaunchProcessManager processManager, IEnumerable candidates = null) - : base (jenkins, buildTask, processManager, candidates) => runSimulator = new RunSimulator ( + public RunSimulatorTask (Jenkins jenkins, SimulatorLoader simulators, MSBuildTask buildTask, IMlaunchProcessManager processManager, IEnumerable? candidates = null) + : base (jenkins, buildTask, processManager, candidates ?? []) => runSimulator = new RunSimulator ( testTask: this, simulators: simulators, errorKnowledgeBase: Jenkins.ErrorKnowledgeBase, @@ -41,11 +41,11 @@ protected override string XIMode { } class NondisposedResource : IAcquiredResource { - public IAcquiredResource Wrapped; + public IAcquiredResource? Wrapped; public Resource Resource { get { - return Wrapped.Resource; + return Wrapped!.Resource; } } diff --git a/tests/xharness/Jenkins/TestTasks/RunTest.cs b/tests/xharness/Jenkins/TestTasks/RunTest.cs index de7ed8f96490..46af2d0be5fd 100644 --- a/tests/xharness/Jenkins/TestTasks/RunTest.cs +++ b/tests/xharness/Jenkins/TestTasks/RunTest.cs @@ -14,10 +14,10 @@ namespace Xharness.Jenkins.TestTasks { public class RunTest { public IMlaunchProcessManager ProcessManager { get; private set; } - public IBuildToolTask BuildTask { get; private set; } + public BuildToolTask BuildTask { get; private set; } IResultParser ResultParser { get; } = new XmlResultParser (); - readonly IRunTestTask testTask; + readonly RunTestTask testTask; readonly IEnvManager envManager; readonly ILog mainLog; readonly bool generateXmlFailures; @@ -26,10 +26,10 @@ public class RunTest { public TimeSpan Timeout { get; set; } = TimeSpan.FromMinutes (10); public double TimeoutMultiplier { get; set; } = 1; - public string WorkingDirectory; + public string? WorkingDirectory; - public RunTest (IRunTestTask testTask, - IBuildToolTask buildTask, + public RunTest (RunTestTask testTask, + BuildToolTask buildTask, IMlaunchProcessManager processManager, IEnvManager envManager, ILog mainLog, diff --git a/tests/xharness/Jenkins/TestTasks/RunTestTask.cs b/tests/xharness/Jenkins/TestTasks/RunTestTask.cs index 0f02dc4d4bce..5d8500feaf25 100644 --- a/tests/xharness/Jenkins/TestTasks/RunTestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunTestTask.cs @@ -8,17 +8,17 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Logging; namespace Xharness.Jenkins.TestTasks { - internal abstract class RunTestTask : AppleTestTask, IRunTestTask { + public abstract class RunTestTask : AppleTestTask { protected RunTest runTest; public IMlaunchProcessManager ProcessManager => runTest.ProcessManager; - public IBuildToolTask BuildTask => runTest.BuildTask; + public BuildToolTask BuildTask => runTest.BuildTask; public double TimeoutMultiplier { get => runTest.TimeoutMultiplier; set => runTest.TimeoutMultiplier = value; } - public string WorkingDirectory { + public string? WorkingDirectory { get => runTest.WorkingDirectory; set => runTest.WorkingDirectory = value; } @@ -28,7 +28,7 @@ public TimeSpan Timeout { set => runTest.Timeout = value; } - public RunTestTask (Jenkins jenkins, IBuildToolTask build_task, IMlaunchProcessManager processManager) : base (jenkins) + public RunTestTask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProcessManager processManager) : base (jenkins) { runTest = new RunTest ( testTask: this, @@ -98,7 +98,7 @@ protected Task ExecuteProcessAsync (string filename, List arguments) return ExecuteProcessAsync (null, filename, arguments); } - protected Task ExecuteProcessAsync (ILog log, string filename, List arguments) + protected Task ExecuteProcessAsync (ILog? log, string filename, List arguments) { if (log is null) log = Logs.Create ($"execute-{Timestamp}.txt", LogType.ExecutionLog.ToString ()); diff --git a/tests/xharness/Jenkins/TestTasks/RunXITask.cs b/tests/xharness/Jenkins/TestTasks/RunXITask.cs index 24e1f513d10f..463e24b06291 100644 --- a/tests/xharness/Jenkins/TestTasks/RunXITask.cs +++ b/tests/xharness/Jenkins/TestTasks/RunXITask.cs @@ -9,19 +9,17 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; namespace Xharness.Jenkins.TestTasks { - abstract class RunXITask : RunTestTask where TDevice : class, IDevice { + public abstract class RunXITask : RunTestTask where TDevice : class, IDevice { public TestTarget AppRunnerTarget { get; set; } - public AppRunner Runner { get; set; } - public AppRunner AdditionalRunner { get; set; } + public AppRunner? Runner { get; set; } + public AppRunner? AdditionalRunner { get; set; } public IEnumerable Candidates { get; } - public TDevice Device { get; set; } + public TDevice? Device { get; set; } - public TDevice CompanionDevice { get; set; } - - public string BundleIdentifier => Runner.AppInformation.BundleIdentifier; + public string BundleIdentifier => Runner?.AppInformation.BundleIdentifier ?? string.Empty; public RunXITask (Jenkins jenkins, BuildToolTask build_task, IMlaunchProcessManager processManager, IEnumerable candidates) : base (jenkins, build_task, processManager) @@ -40,7 +38,7 @@ public override IEnumerable AggregatedLogs { } } - public override string Mode { + public override string? Mode { get { switch (Platform) { @@ -65,7 +63,7 @@ public override async Task VerifyRunAsync () var asyncEnumerable = enumerable as IAsyncEnumerable; if (asyncEnumerable is not null) await asyncEnumerable.ReadyTask; - if (!enumerable.Any ()) { + if (enumerable is null || !enumerable.Any ()) { ExecutionResult = TestExecutingResult.DeviceNotFound; FailureMessage = "No applicable devices found."; } diff --git a/tests/xharness/Jenkins/TestTasks/TestTask.cs b/tests/xharness/Jenkins/TestTasks/TestTask.cs index 014c0045b43b..0528e50e8a3a 100644 --- a/tests/xharness/Jenkins/TestTasks/TestTask.cs +++ b/tests/xharness/Jenkins/TestTasks/TestTask.cs @@ -13,26 +13,26 @@ using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; namespace Xharness.Jenkins.TestTasks { - public abstract class TestTasks : IEnvManager, IEventLogger, ITestTask { + public abstract class TestTask : IEnvManager, IEventLogger { static int counter; - static DriveInfo rootDrive; + static DriveInfo? rootDrive; protected readonly Stopwatch waitingDuration = new (); #region Private vars - ILog testLog; + ILog? testLog; bool? supportsParallelExecution; - string testName; - Task executeTask; + string? testName; + Task? executeTask; #endregion #region Public vars - public Dictionary Environment = new (); - public Task InitialTask { get; set; } // a task that's executed before this task's ExecuteAsync method. - public Task CompletedTask; // a task that's executed after this task's ExecuteAsync method. + public Dictionary Environment = new (); + public Task? InitialTask { get; set; } // a task that's executed before this task's ExecuteAsync method. + public Task? CompletedTask; // a task that's executed after this task's ExecuteAsync method. public List Resources = new (); #endregion @@ -41,12 +41,12 @@ public abstract class TestTasks : IEnvManager, IEventLogger, ITestTask { public int ID { get; private set; } public bool BuildOnly { get; set; } - public KnownIssue KnownFailure { get; set; } - public string ProjectConfiguration { get; set; } - public string ProjectPlatform { get; set; } + public KnownIssue? KnownFailure { get; set; } + public string? ProjectConfiguration { get; set; } + public string? ProjectPlatform { get; set; } protected static string Timestamp => Harness.Helpers.Timestamp; - public string ProjectFile => TestProject?.Path; + public string ProjectFile => TestProject?.Path ?? ""; public bool HasCustomTestName => testName is not null; public bool NotStarted => (ExecutionResult & TestExecutingResult.StateMask) == TestExecutingResult.NotStarted; @@ -80,19 +80,19 @@ public bool Ignored { public Stopwatch DurationStopWatch { get; } = new (); public TimeSpan Duration => DurationStopWatch.Elapsed; - string failureMessage; - public string FailureMessage { + string? failureMessage; + public string? FailureMessage { get { return failureMessage; } set { failureMessage = value; - MainLog.WriteLine (failureMessage); + MainLog.WriteLine (failureMessage ?? ""); } } public ILog MainLog => testLog ??= Logs.Create ($"main-{Timestamp}.log", "Main log"); - ILogs logs; + ILogs? logs; public ILogs Logs => logs ??= new Logs (LogDirectory); #endregion @@ -112,11 +112,11 @@ public ILog MainLog #region Virtual - public virtual TestProject TestProject { get; set; } + public virtual TestProject? TestProject { get; set; } public virtual TestPlatform Platform { get; set; } - public virtual string ProgressMessage { get; } - public virtual string Mode { get; set; } - public virtual string Variation { get; set; } + public virtual string? ProgressMessage { get; } + public virtual string? Mode { get; set; } + public virtual string? Variation { get; set; } public virtual bool SupportsParallelExecution { get => supportsParallelExecution ?? true; @@ -174,7 +174,7 @@ public virtual void Reset () #endregion - public TestTasks () + public TestTask () { ID = Interlocked.Increment (ref counter); } @@ -265,7 +265,7 @@ public override string ToString () protected void AddCILogFiles (StreamReader stream) { - string line; + string? line; while ((line = stream.ReadLine ()) is not null) { if (!line.StartsWith ("@MonkeyWrench: ", StringComparison.Ordinal)) continue; @@ -287,11 +287,11 @@ protected void AddCILogFiles (StreamReader stream) } } - public string GuessFailureReason (IReadableLog log) + public string? GuessFailureReason (IReadableLog log) { try { using (var reader = log.GetReader ()) { - string line; + string? line; var error_msg = new System.Text.RegularExpressions.Regex ("([A-Z][A-Z][0-9][0-9][0-9][0-9]:.*)"); while ((line = reader.ReadLine ()) is not null) { var match = error_msg.Match (line); @@ -310,7 +310,9 @@ public string GuessFailureReason (IReadableLog log) // It will also pause the duration. public async Task NotifyBlockingWaitAsync (Task task) { - var rv = new BlockingWait (); + var rv = new BlockingWait () { + OnDispose = DurationStopWatch.Stop, + }; // Stop the timer while we're waiting for a resource DurationStopWatch.Stop (); @@ -320,20 +322,19 @@ public async Task NotifyBlockingWaitAsync (Task CreateTestVariations (IEnumerable tests, Func, T> creator) where T : RunTestTask; - } - - class TestVariationsFactory : ITestVariationsFactory { + class TestVariationsFactory { readonly Jenkins jenkins; readonly IProcessManager processManager; @@ -30,7 +26,7 @@ IEnumerable GetTestData (RunTestTask test) // This function returns additional test configurations (in addition to the default one) for the specific test var supports_interpreter = test.Platform != TestPlatform.Mac; - var ignore = test.TestProject.Ignore; + var ignore = test.TestProject!.Ignore; var mac_supports_arm64 = Harness.CanRunArm64; var arm64_runtime_identifier = string.Empty; var x64_runtime_identifier = string.Empty; @@ -62,51 +58,43 @@ IEnumerable GetTestData (RunTestTask test) switch (test.TestName) { case "link all": if (test.ProjectConfiguration == "Debug") { - // in .NET 9 we add a variation to test original resource bundling (which is opt in in .NET 9), - // and in .NET 10 we change the variation to test *not* bundling original resources (because it becomes opt out in .NET 10, - // so we don't test it by default). - if (jenkins.Harness.DotNetVersion.Major <= 9) { - yield return new TestData { Variation = "Debug (bundle original resources)", TestVariation = "bundle-original-resources", Debug = true }; - } else { - yield return new TestData { Variation = "Debug (don't bundle original resources)", TestVariation = "do-not-bundle-original-resources", Debug = true }; - } + yield return new TestData { Variation = "Debug (don't bundle original resources)", TestVariation = "do-not-bundle-original-resources" }; } break; case "introspection": if (supports_coreclr && supports_mono) { // we only need specific coreclr test if we *also* support mono (otherwise the default test will be coreclr) - yield return new TestData { Variation = "CoreCLR", TestVariation = "coreclr", Ignored = ignore_coreclr, Debug = true }; + yield return new TestData { Variation = "CoreCLR", TestVariation = "coreclr", Ignored = ignore_coreclr }; } break; case "monotouch-test": if (supports_coreclr && supports_mono) { // we only need specific coreclr test if we *also* support mono (otherwise the default test will be coreclr) - yield return new TestData { Variation = "Debug (CoreCLR)", TestVariation = "debug|coreclr", Ignored = ignore_coreclr, Debug = true }; + yield return new TestData { Variation = "Debug (CoreCLR)", TestVariation = "debug|coreclr", Ignored = ignore_coreclr }; if (mac_supports_arm64) - yield return new TestData { Variation = "Release (CoreCLR, ARM64)", TestVariation = "release|coreclr", Ignored = ignore_coreclr, Debug = false, RuntimeIdentifier = arm64_sim_runtime_identifier }; - yield return new TestData { Variation = "Release (CoreCLR, x64)", TestVariation = "release|coreclr", Ignored = ignore_coreclr, Debug = false, RuntimeIdentifier = x64_sim_runtime_identifier }; - yield return new TestData { Variation = "Release (CoreCLR, Universal)", TestVariation = "release|coreclr", Ignored = ignore_coreclr, Debug = false }; + yield return new TestData { Variation = "Release (CoreCLR, ARM64)", TestVariation = "release|coreclr", Ignored = ignore_coreclr, RuntimeIdentifier = arm64_sim_runtime_identifier }; + yield return new TestData { Variation = "Release (CoreCLR, x64)", TestVariation = "release|coreclr", Ignored = ignore_coreclr, RuntimeIdentifier = x64_sim_runtime_identifier }; + yield return new TestData { Variation = "Release (CoreCLR, Universal)", TestVariation = "release|coreclr", Ignored = ignore_coreclr }; } break; } switch (test.ProjectPlatform) { case "iPhone": - if (test.ProjectConfiguration.Contains ("Debug")) - yield return new TestData { Variation = "Release", Debug = false }; + if (test.ProjectConfiguration?.Contains ("Debug") == true) + yield return new TestData { Variation = "Release", TestVariation = "release" }; switch (test.TestName) { case "monotouch-test": ignore = true; - yield return new TestData { Variation = "Debug (dynamic registrar)", Registrar = "dynamic", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "static-registrar-all-optimizations", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-all-optimizations", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Debug: SGenConc", Debug = true, EnableSGenConc = true, Ignored = ignore }; + yield return new TestData { Variation = "Debug (dynamic registrar)", TestVariation = "dynamic-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "release|static-registrar-all-optimizations", Ignored = ignore }; + yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-all-optimizations", Ignored = ignore }; if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Ignored = ignore }; + yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Ignored = ignore }; } - yield return new TestData { Variation = "Release (LLVM)", Debug = false, UseLlvm = true, Ignored = ignore }; - yield return new TestData { Variation = "Debug (managed static registrar)", Registrar = "managed-static", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Release (NativeAOT)", Debug = false, PublishAot = true, Ignored = ignore, LinkMode = "Full" }; + yield return new TestData { Variation = "Release (LLVM)", TestVariation = "release|llvm", Ignored = ignore }; + yield return new TestData { Variation = "Debug (managed static registrar)", TestVariation = "managed-static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "release|managed-static-registrar-all-optimizations-linkall", Ignored = ignore }; + yield return new TestData { Variation = "Release (NativeAOT)", TestVariation = "release|nativeaot", Ignored = ignore }; break; } break; @@ -114,31 +102,30 @@ IEnumerable GetTestData (RunTestTask test) switch (test.TestName) { case "monotouch-test": // The default is to run monotouch-test with the dynamic registrar (in the simulator), so that's already covered - yield return new TestData { Variation = "Debug (LinkSdk)", Debug = true, LinkMode = "SdkOnly", Ignored = ignore }; - yield return new TestData { Variation = "Debug (static registrar)", Registrar = "static", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-optimizations-except-uithread-checks-linkall", Debug = true, Ignored = ignore ?? !jenkins.TestSelection.IsEnabled (TestLabel.All) }; + yield return new TestData { Variation = "Debug (LinkSdk)", TestVariation = "linksdk", Ignored = ignore }; + yield return new TestData { Variation = "Debug (static registrar)", TestVariation = "static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (all optimizations)", TestVariation = "release|static-registrar-all-optimizations-linkall", Ignored = ignore }; + yield return new TestData { Variation = "Debug (all optimizations)", TestVariation = "static-registrar-optimizations-except-uithread-checks-linkall", Ignored = ignore ?? !jenkins.TestSelection.IsEnabled (TestLabel.All) }; if (mac_supports_arm64) { - yield return new TestData { Variation = "Debug (ARM64)", Debug = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, }; - yield return new TestData { Variation = "Release (NativeAOT, ARM64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, LinkMode = "Full" }; + yield return new TestData { Variation = "Debug (ARM64)", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, }; + yield return new TestData { Variation = "Release (NativeAOT, ARM64)", TestVariation = "release|nativeaot", Ignored = ignore, RuntimeIdentifier = arm64_sim_runtime_identifier }; } - yield return new TestData { Variation = "Debug (managed static registrar)", Registrar = "managed-static", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Release (NativeAOT, x64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = x64_sim_runtime_identifier, LinkMode = "Full" }; + yield return new TestData { Variation = "Debug (managed static registrar)", TestVariation = "managed-static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "release|managed-static-registrar-all-optimizations-linkall", Ignored = ignore }; + yield return new TestData { Variation = "Release (NativeAOT, x64)", TestVariation = "release|nativeaot", Ignored = ignore, RuntimeIdentifier = x64_sim_runtime_identifier }; if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (interpreter)", TestVariation = "interpreter", Debug = false, Ignored = ignore, UseLlvm = false }; + yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Ignored = ignore }; + yield return new TestData { Variation = "Release (interpreter)", TestVariation = "release|interpreter", Ignored = ignore }; } break; case "introspection": if (mac_supports_arm64) - yield return new TestData { Variation = "Debug (ARM64)", Debug = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, }; + yield return new TestData { Variation = "Debug (ARM64)", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_sim_runtime_identifier, }; foreach (var target in test.Platform.GetTestTargetsForSimulator ()) yield return new TestData { Variation = $"Debug ({test.Platform.GetSimulatorMinVersion ()})", - Debug = true, Candidates = jenkins.Simulators.SelectDevices (target.GetTargetOs (true), jenkins.SimulatorLoadLog, true), Ignored = ignore ?? !jenkins.TestSelection.IsEnabled (PlatformLabel.OldiOSSimulator) || !jenkins.TestSelection.IsEnabled (TestLabel.Introspection), }; @@ -151,23 +138,23 @@ IEnumerable GetTestData (RunTestTask test) case null: switch (test.TestName) { case "monotouch-test": - yield return new TestData { Variation = "Debug (ARM64)", Debug = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, }; - yield return new TestData { Variation = "Debug (managed static registrar)", Registrar = "managed-static", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Debug (static registrar)", Registrar = "static", Debug = true, Ignored = ignore, }; - yield return new TestData { Variation = "Debug (static registrar, ARM64)", Registrar = "static", Debug = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, }; - yield return new TestData { Variation = "Release (managed static registrar)", Registrar = "managed-static", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "managed-static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Release (NativeAOT)", Debug = false, PublishAot = true, Ignored = ignore, LinkMode = "Full" }; - yield return new TestData { Variation = "Release (NativeAOT, ARM64)", Debug = false, PublishAot = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, LinkMode = "Full" }; - yield return new TestData { Variation = "Release (NativeAOT, x64)", Debug = false, PublishAot = true, Ignored = ignore, RuntimeIdentifier = x64_runtime_identifier, LinkMode = "Full" }; - yield return new TestData { Variation = "Release (static registrar)", Registrar = "static", Debug = false, Ignored = ignore }; - yield return new TestData { Variation = "Release (static registrar, all optimizations)", TestVariation = "static-registrar-all-optimizations-linkall", Debug = false, Ignored = ignore }; + yield return new TestData { Variation = "Debug (ARM64)", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, }; + yield return new TestData { Variation = "Debug (managed static registrar)", TestVariation = "managed-static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Debug (static registrar)", TestVariation = "static-registrar", Ignored = ignore, }; + yield return new TestData { Variation = "Debug (static registrar, ARM64)", TestVariation = "static-registrar", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier, }; + yield return new TestData { Variation = "Release (managed static registrar)", TestVariation = "release|managed-static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (managed static registrar, all optimizations)", TestVariation = "release|managed-static-registrar-all-optimizations-linkall", Ignored = ignore }; + yield return new TestData { Variation = "Release (NativeAOT)", TestVariation = "release|nativeaot", Ignored = ignore }; + yield return new TestData { Variation = "Release (NativeAOT, ARM64)", TestVariation = "release|nativeaot", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier }; + yield return new TestData { Variation = "Release (NativeAOT, x64)", TestVariation = "release|nativeaot", Ignored = ignore, RuntimeIdentifier = x64_runtime_identifier }; + yield return new TestData { Variation = "Release (static registrar)", TestVariation = "release|static-registrar", Ignored = ignore }; + yield return new TestData { Variation = "Release (static registrar, all optimizations)", TestVariation = "release|static-registrar-all-optimizations-linkall", Ignored = ignore }; if (test.Platform == TestPlatform.MacCatalyst) { - yield return new TestData { Variation = "Release (ARM64, LLVM)", Debug = false, UseLlvm = true, Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier }; + yield return new TestData { Variation = "Release (ARM64, LLVM)", TestVariation = "release|llvm", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier }; } if (supports_interpreter) { - yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Debug = true, Ignored = ignore }; - yield return new TestData { Variation = "Release (interpreter)", TestVariation = "interpreter", Debug = false, Ignored = ignore, UseLlvm = false }; + yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Ignored = ignore }; + yield return new TestData { Variation = "Release (interpreter)", TestVariation = "release|interpreter", Ignored = ignore }; } break; } @@ -177,63 +164,35 @@ IEnumerable GetTestData (RunTestTask test) } } - public IEnumerable CreateTestVariations (IEnumerable tests, Func, T> creator) where T : RunTestTask + public IEnumerable CreateTestVariations (IEnumerable tests, Func?, T> creator) where T : RunTestTask { foreach (var task in tests) { if (string.IsNullOrEmpty (task.Variation)) - task.Variation = task.ProjectConfiguration.Contains ("Debug") ? "Debug" : "Release"; + task.Variation = task.ProjectConfiguration?.Contains ("Debug") == true ? "Debug" : "Release"; } var rv = new List (tests); foreach (var task in tests.ToArray ()) { foreach (var test_data in GetTestData (task)) { var variation = test_data.Variation; - var configuration = test_data.Debug ? task.ProjectConfiguration : task.ProjectConfiguration.Replace ("Debug", "Release"); - var debug = test_data.Debug; - var link_mode = test_data.LinkMode; + var debug = !(test_data.TestVariation ?? "").Split ('|').Any (v => string.Equals (v, "release", StringComparison.OrdinalIgnoreCase)); + var configuration = debug ? task.ProjectConfiguration : task.ProjectConfiguration?.Replace ("Debug", "Release"); var ignored = test_data.Ignored; var known_failure = test_data.KnownFailure; var candidates = test_data.Candidates; - var use_mono_runtime = test_data.UseMonoRuntime; var runtime_identifer = test_data.RuntimeIdentifier; - var use_llvm = test_data.UseLlvm; - var registrar = test_data.Registrar; - var publishaot = test_data.PublishAot; var test_variation = test_data.TestVariation; if (known_failure is not null) ignored = true; - var clone = task.TestProject.Clone (); + var clone = task.TestProject!.Clone (); var clone_task = Task.Run (async () => { - await task.BuildTask.InitialTask; // this is the project cloning above + await task.BuildTask.InitialTask!; // this is the project cloning above await clone.CreateCopyAsync (jenkins.MainLog, processManager, task, HarnessConfiguration.RootDirectory); - var isMac = task.Platform.IsMac (); - - if (!string.IsNullOrEmpty (link_mode)) { - clone.Xml.SetProperty ("LinkMode", link_mode); - clone.Xml.SetProperty ("MtouchLink", link_mode); - } - if (test_data.EnableSGenConc) - clone.Xml.SetProperty ("EnableSGenConc", "true"); - if (use_llvm) - clone.Xml.SetProperty ("MtouchUseLlvm", "true"); - - if (!debug && !isMac) - clone.Xml.SetProperty ("MtouchUseLlvm", "true"); - if (use_mono_runtime.HasValue) - clone.Xml.SetProperty ("UseMonoRuntime", use_mono_runtime.Value ? "true" : "false"); if (!string.IsNullOrEmpty (runtime_identifer)) clone.Xml.SetProperty ("RuntimeIdentifier", runtime_identifer); - if (!string.IsNullOrEmpty (registrar)) - clone.Xml.SetProperty ("Registrar", registrar); - if (publishaot) { - clone.Xml.SetProperty ("PublishAot", "true", last: false); - clone.Xml.SetProperty ("_IsPublishing", "true", last: false); // quack like "dotnet publish", otherwise PublishAot=true has no effect. - if (!string.IsNullOrEmpty (runtime_identifer)) - clone.Xml.SetProperty ("PublishRuntimeIdentifier", runtime_identifer); - } if (!string.IsNullOrEmpty (test_variation)) { clone.Xml.SetProperty ("TestVariation", test_variation); foreach (var pr in clone.ProjectReferences) { @@ -249,7 +208,7 @@ public IEnumerable CreateTestVariations (IEnumerable tests, Func showHelp () }, + { "h|?|help", "Displays the help", (v) => showHelp!.Invoke () }, { "v|verbose", "Show verbose output", (v) => configuration.Verbosity++ }, { "use-system:", "Use the system version of Xamarin.iOS/Xamarin.Mac or the locally build version. Default: the locally build version.", (v) => configuration.UseSystemXamarinIOSMac = v == "1" || v == "true" || string.IsNullOrEmpty (v) }, { "rootdir=", "The root directory for the tests.", (v) => HarnessConfiguration.RootDirectory = v }, diff --git a/tests/xharness/TestPlatformExtensions.cs b/tests/xharness/TestPlatformExtensions.cs index 6deb5d3042a0..187db3b85ad6 100644 --- a/tests/xharness/TestPlatformExtensions.cs +++ b/tests/xharness/TestPlatformExtensions.cs @@ -27,7 +27,7 @@ public static bool IsMac (this TestPlatform platform) } // This must match our $(_PlatformName) variable in our MSBuild logic. - public static string ToPlatformName (this TestPlatform platform) + public static string? ToPlatformName (this TestPlatform platform) { switch (platform) { case TestPlatform.iOS: diff --git a/tests/xharness/TestProject.cs b/tests/xharness/TestProject.cs index fb40da8a461d..3aef099deeef 100644 --- a/tests/xharness/TestProject.cs +++ b/tests/xharness/TestProject.cs @@ -22,7 +22,7 @@ public class TestProject { public TestPlatform TestPlatform; public TestLabel Label; public string Path; - public string? Name; + public string Name = ""; public bool IsExecutableProject; public string []? Configurations; public string? FailureMessage; @@ -80,13 +80,13 @@ protected virtual TestProject CompleteClone (TestProject rv) return rv; } - public Task CreateCopyAsync (ILog log, IProcessManager processManager, ITestTask test, string rootDirectory) + public Task CreateCopyAsync (ILog log, IProcessManager processManager, TestTask test, string rootDirectory) { var pr = new Dictionary (); return CreateCopyAsync (log, processManager, test, rootDirectory, pr); } - async Task CreateCopyAsync (ILog log, IProcessManager processManager, ITestTask test, string rootDirectory, Dictionary allProjectReferences) + async Task CreateCopyAsync (ILog log, IProcessManager processManager, TestTask test, string rootDirectory, Dictionary allProjectReferences) { var directory = Cache.CreateTemporaryDirectory (test.TestName ?? System.IO.Path.GetFileNameWithoutExtension (Path)); Directory.CreateDirectory (directory); @@ -220,7 +220,7 @@ void InlineSharedImports (XmlDocument doc, string original_path, Dictionary; + +namespace Xharness { + public class TestReporter : ITestReporter { + const string timeoutMessage = "Test run timed out after {0} minute(s)."; + const string completionMessage = "Test run completed"; + const string failureMessage = "Test run failed"; + + readonly ISimpleListener listener; + readonly IFileBackedLog mainLog; + readonly ILogs crashLogs; + readonly IReadableLog runLog; + readonly ILogs logs; + readonly ICrashSnapshotReporter crashReporter; + readonly IResultParser resultParser; + readonly AppBundleInformation appInfo; + readonly RunMode runMode; + readonly XmlResultJargon xmlJargon; + readonly IMlaunchProcessManager processManager; + readonly string? deviceName; + readonly TimeSpan timeout; + readonly Stopwatch timeoutWatch; + readonly string? additionalLogsDirectory; + readonly CancellationTokenSource cancellationTokenSource = new (); + readonly ExceptionLogger? exceptionLogger; + readonly bool generateHtml; + + bool waitedForExit = true; + bool launchFailure; + bool isSimulatorTest; + bool timedout; + + public ILog CallbackLog { get; private set; } + + public bool? Success { get; private set; } + + public CancellationToken CancellationToken => cancellationTokenSource.Token; + + public bool ResultsUseXml => xmlJargon != XmlResultJargon.Missing; + + bool TestExecutionStarted => listener.ConnectedTask.IsCompletedSuccessfully && listener.ConnectedTask.Result; + + public TestReporter ( + IMlaunchProcessManager processManager, + IFileBackedLog mainLog, + IReadableLog runLog, + ILogs logs, + ICrashSnapshotReporter crashReporter, + ISimpleListener simpleListener, + IResultParser parser, + AppBundleInformation appInformation, + RunMode runMode, + XmlResultJargon xmlJargon, + string? device, + TimeSpan timeout, + string? additionalLogsDirectory = null, + ExceptionLogger? exceptionLogger = null, + bool generateHtml = false) + { + this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); + deviceName = device; + listener = simpleListener ?? throw new ArgumentNullException (nameof (simpleListener)); + this.mainLog = mainLog ?? throw new ArgumentNullException (nameof (mainLog)); + this.runLog = runLog ?? throw new ArgumentNullException (nameof (runLog)); + this.logs = logs ?? throw new ArgumentNullException (nameof (logs)); + this.crashReporter = crashReporter ?? throw new ArgumentNullException (nameof (crashReporter)); + crashLogs = new Logs (logs.Directory); + resultParser = parser ?? throw new ArgumentNullException (nameof (parser)); + appInfo = appInformation ?? throw new ArgumentNullException (nameof (appInformation)); + this.runMode = runMode; + this.xmlJargon = xmlJargon; + this.timeout = timeout; + this.additionalLogsDirectory = additionalLogsDirectory; + this.exceptionLogger = exceptionLogger; + timeoutWatch = Stopwatch.StartNew (); + this.generateHtml = generateHtml; + + CallbackLog = new CallbackLog ((line) => { + waitedForExit &= line?.Contains ("MT1111: ") != true; + if (line?.Contains ("error MT1007") == true) + launchFailure = true; + }); + } + + async Task GetPidFromRunLog () + { + int pid = -1; + + using var reader = runLog.GetReader (); + if (reader.Peek () == -1) { + if (!listener.ConnectedTask.IsCompletedSuccessfully || !listener.ConnectedTask.Result) + launchFailure = true; + } else { + string? line; + while ((line = await reader.ReadLineAsync ()) is not null) { + if (line.StartsWith ("Application launched. PID = ", StringComparison.Ordinal)) { + var pidstr = line.Substring ("Application launched. PID = ".Length); + if (!int.TryParse (pidstr, out pid)) + mainLog.WriteLine ("Could not parse pid: {0}", pidstr); + } else if (line.Contains ("Xamarin.Hosting: Launched ") && line.Contains (" with pid ")) { + var pidstr = line.Substring (line.LastIndexOf (' ')); + if (!int.TryParse (pidstr, out pid)) + mainLog.WriteLine ("Could not parse pid: {0}", pidstr); + } else if (line.Contains ("error MT1008")) { + launchFailure = true; + } + } + } + + return pid; + } + + async Task GetPidFromMainLog () + { + int pid = -1; + using var logReader = mainLog.GetReader (); + string? line; + while ((line = await logReader.ReadLineAsync ()) is not null) { + const string str = "was launched with pid '"; + var idx = line.IndexOf (str, StringComparison.Ordinal); + if (idx > 0) { + idx += str.Length; + var nextIdx = line.IndexOf ('\'', idx); + if (nextIdx > idx) + int.TryParse (line.Substring (idx, nextIdx - idx), out pid); + } + if (pid != -1) + return pid; + } + return pid; + } + + void GetCrashReason (int pid, IReadableLog crashLog, out string? crashReason) + { + crashReason = null; + using var crashReader = crashLog.GetReader (); + var text = crashReader.ReadToEnd (); + + var reader = JsonReaderWriterFactory.CreateJsonReader (Encoding.UTF8.GetBytes (text), new XmlDictionaryReaderQuotas ()); + var doc = new XmlDocument (); + doc.Load (reader); + foreach (XmlNode node in doc.SelectNodes ($"/root/processes/item[pid = '" + pid + "']")!) { + Console.WriteLine (node?.InnerXml); + Console.WriteLine (node?.SelectSingleNode ("reason")?.InnerText); + crashReason = node?.SelectSingleNode ("reason")?.InnerText; + } + } + + async Task TcpConnectionFailed () + { + using var reader = new StreamReader (mainLog.FullPath); + string? line; + while ((line = await reader.ReadLineAsync ()) is not null) { + if (line.Contains ("Couldn't establish a TCP connection with any of the hostnames")) + return true; + } + return false; + } + + Task KillAppProcess (int pid, CancellationTokenSource cancellationSource) + { + var launchTimedout = cancellationSource.IsCancellationRequested; + var timeoutType = launchTimedout ? "Launch" : "Completion"; + mainLog.WriteLine ($"{timeoutType} timed out after {timeoutWatch.Elapsed.TotalSeconds} seconds"); + return processManager.KillTreeAsync (pid, mainLog, true); + } + + async Task CollectResult (ProcessExecutionResult runResult) + { + if (!waitedForExit && !runResult.TimedOut) { + mainLog.WriteLine ("Waiting for listener to complete, since mlaunch won't tell."); + if (!await listener.CompletionTask.TimeoutAfter (timeout - timeoutWatch.Elapsed)) + runResult.TimedOut = true; + } + + if (runResult.TimedOut) { + timedout = true; + Success = false; + mainLog.WriteLine (timeoutMessage, timeout.TotalMinutes); + } else if (runResult.Succeeded) { + mainLog.WriteLine (completionMessage); + Success = true; + } else { + mainLog.WriteLine (failureMessage); + Success = false; + } + } + + public void LaunchCallback (Task launchResult) + { + if (launchResult.IsFaulted) { + mainLog.WriteLine ($"Test execution failed: {launchResult.Exception}"); + return; + } + + if (launchResult.IsCanceled) { + mainLog.WriteLine ("Test execution was cancelled"); + return; + } + + if (launchResult.Result) { + mainLog.WriteLine ("Test execution started"); + return; + } + + cancellationTokenSource.Cancel (); + timedout = true; + + if (TestExecutionStarted) { + mainLog.WriteLine ($"Test execution timed out after {timeoutWatch.Elapsed.TotalMinutes:0.##} minutes"); + return; + } + + mainLog.WriteLine ($"Test failed to start in {timeoutWatch.Elapsed.TotalMinutes:0.##} minutes"); + } + + public async Task CollectSimulatorResult (ProcessExecutionResult runResult) + { + isSimulatorTest = true; + await CollectResult (runResult); + + if (Success is not null && !Success.Value) { + var pid = await GetPidFromRunLog (); + if (pid > 0) { + await KillAppProcess (pid, cancellationTokenSource); + } else { + mainLog.WriteLine ("Could not find pid in mtouch output."); + } + } + } + + public async Task CollectDeviceResult (ProcessExecutionResult runResult) + { + isSimulatorTest = false; + await CollectResult (runResult); + } + + async Task<(string? ResultLine, bool Failed)> GetResultLine (string logPath) + { + string? resultLine = null; + bool failed = false; + using var reader = new StreamReader (logPath); + string? line; + while ((line = await reader.ReadLineAsync ()) is not null) { + if (line.Contains ("Tests run:")) { + Console.WriteLine (line); + resultLine = line; + break; + } else if (line.Contains ("[FAIL]")) { + Console.WriteLine (line); + failed = true; + } + } + return (ResultLine: resultLine, Failed: failed); + } + + async Task<(string? resultLine, bool failed, bool crashed)> ParseResultFile (AppBundleInformation appInfo, string testLogPath, bool timedOut) + { + (string? resultLine, bool failed, bool crashed) parseResult = (null, false, false); + if (!File.Exists (testLogPath)) { + parseResult.crashed = true; + return parseResult; + } + + var path = Path.ChangeExtension (testLogPath, "xml"); + if (path == testLogPath) + path = Path.Combine (Path.GetDirectoryName (path)!, Path.GetFileNameWithoutExtension (path) + "-clean.xml"); + + resultParser.CleanXml (testLogPath, path); + + if (ResultsUseXml && resultParser.IsValidXml (path, out var xmlType)) { + try { + var newFilename = resultParser.GetXmlFilePath (path, xmlType); + var testRunName = $"{appInfo.AppName} {appInfo.Variation}"; + if (xmlType == XmlResultJargon.NUnitV3) { + var logFiles = new List (); + logFiles.AddRange (Directory.GetFiles (crashLogs.Directory)); + if (additionalLogsDirectory is not null) + logFiles.AddRange (Directory.GetFiles (additionalLogsDirectory)); + newFilename = XmlResultParser.GetVSTSFilename (newFilename); + resultParser.UpdateMissingData (path, newFilename, testRunName, logFiles); + } else { + File.Move (path, newFilename); + } + path = newFilename; + + if (generateHtml) { + var humanReadableLog = logs.CreateFile (Path.GetFileNameWithoutExtension (testLogPath) + ".log", LogType.NUnitResult); + (parseResult.resultLine, parseResult.failed) = resultParser.ParseResults (path, xmlType, humanReadableLog); + } else { + (parseResult.resultLine, parseResult.failed) = resultParser.ParseResults (path, xmlType, (StreamWriter?) null); + } + + logs.AddFile (path, LogType.XmlLog.ToString ()); + return parseResult; + } catch (Exception e) { + mainLog.WriteLine ("Could not parse xml result file: {0}", e); + mainLog.WriteLine ("File data is:"); + mainLog.WriteLine (new string ('#', 10)); + using (var stream = new StreamReader (path)) { + string? line; + while ((line = await stream.ReadLineAsync ()) is not null) + mainLog.WriteLine (line); + } + mainLog.WriteLine (new string ('#', 10)); + mainLog.WriteLine ("End of xml results."); + if (timedOut) { + WrenchLog.WriteLine ($"AddSummary: {runMode} timed out
"); + return parseResult; + } else { + WrenchLog.WriteLine ($"AddSummary: {runMode} crashed
"); + mainLog.WriteLine ("Test run crashed"); + parseResult.crashed = true; + return parseResult; + } + } + } + + File.Delete (path); + (parseResult.resultLine, parseResult.failed) = await GetResultLine (testLogPath); + return parseResult; + } + + async Task<(bool Succeeded, bool Crashed, string ResultLine)> TestsSucceeded (AppBundleInformation appInfo, string testLogPath, bool timedOut) + { + var (resultLine, failed, crashed) = await ParseResultFile (appInfo, testLogPath, timedOut); + if (resultLine is not null) { + var testsRun = resultLine.Replace ("Tests run: ", ""); + if (failed) { + WrenchLog.WriteLine ("AddSummary: {0} failed: {1}
", runMode, testsRun); + mainLog.WriteLine ("Test run failed"); + return (false, crashed, resultLine); + } else { + WrenchLog.WriteLine ("AddSummary: {0} succeeded: {1}
", runMode, testsRun); + mainLog.WriteLine ("Test run succeeded"); + return (true, crashed, resultLine); + } + } else if (timedOut) { + WrenchLog.WriteLine ("AddSummary: {0} timed out
", runMode); + mainLog.WriteLine ("Test run timed out"); + return (false, false, "Test run timed out"); + } else { + WrenchLog.WriteLine ("AddSummary: {0} crashed
", runMode); + mainLog.WriteLine ("Test run crashed"); + return (false, true, "Test run crashed"); + } + } + + async Task GenerateXmlFailures (string failure, bool crashed, string? crashReason) + { + if (!ResultsUseXml) + return; + + if (!string.IsNullOrEmpty (crashReason)) { + resultParser.GenerateFailure ( + logs, + "crash", + appInfo.AppName, + appInfo.Variation, + $"App Crash {appInfo.AppName} {appInfo.Variation}", + $"App crashed: {failure}", + mainLog.FullPath, + xmlJargon); + + return; + } + + if (launchFailure) { + resultParser.GenerateFailure ( + logs, + "launch", + appInfo.AppName, + appInfo.Variation, + $"App Launch {appInfo.AppName} {appInfo.Variation} on {deviceName}", + $"{failure} on {deviceName}", + mainLog.FullPath, + xmlJargon); + + return; + } + + if (!isSimulatorTest && crashed && string.IsNullOrEmpty (crashReason)) { + if (await TcpConnectionFailed ()) { + resultParser.GenerateFailure ( + logs, + "tcp-connection", + appInfo.AppName, + appInfo.Variation, + $"TcpConnection on {deviceName}", + $"Device {deviceName} could not reach the host over tcp.", + mainLog.FullPath, + xmlJargon); + } + } else if (timedout) { + resultParser.GenerateFailure ( + logs, + "timeout", + appInfo.AppName, + appInfo.Variation, + $"App Timeout {appInfo.AppName} {appInfo.Variation} on bot {deviceName}", + $"{appInfo.AppName} {appInfo.Variation} Test run timed out after {timeout.TotalMinutes} minute(s) on bot {deviceName}.", + mainLog.FullPath, + xmlJargon); + } + } + + public async Task<(TestExecutingResult ExecutingResult, string? ResultMessage)> ParseResult () + { + (TestExecutingResult ExecutingResult, string? ResultMessage) result = (TestExecutingResult.Finished, null); + var crashed = false; + if (File.Exists (listener.TestLog.FullPath)) { + WrenchLog.WriteLine ("AddFile: {0}", listener.TestLog.FullPath); + (Success, crashed, result.ResultMessage) = await TestsSucceeded (appInfo, listener.TestLog.FullPath, timedout); + } else if (timedout) { + WrenchLog.WriteLine ("AddSummary: {0} never launched
", runMode); + mainLog.WriteLine ("Test run never launched"); + result.ResultMessage = "Test runner never started"; + Success = false; + } else if (launchFailure) { + WrenchLog.WriteLine ("AddSummary: {0} failed to launch
", runMode); + mainLog.WriteLine ("Test run failed to launch"); + result.ResultMessage = "Test runner failed to launch"; + Success = false; + } else { + WrenchLog.WriteLine ("AddSummary: {0} crashed at startup (no log)
", runMode); + mainLog.WriteLine ("Test run started but crashed and no test results were reported"); + result.ResultMessage = "No test log file was produced"; + crashed = true; + Success = false; + } + + if (!Success.HasValue) + Success = false; + + var crashLogWaitTime = 0; + if (!Success.Value) + crashLogWaitTime = 5; + + if (crashed) + crashLogWaitTime = 30; + + await crashReporter.EndCaptureAsync (TimeSpan.FromSeconds (crashLogWaitTime)); + + if (timedout) { + if (TestExecutionStarted) { + result.ExecutingResult = TestExecutingResult.TimedOut; + } else { + result.ExecutingResult = TestExecutingResult.LaunchTimedOut; + } + } else if (launchFailure) { + result.ExecutingResult = TestExecutingResult.LaunchFailure; + } else if (crashed) { + result.ExecutingResult = TestExecutingResult.Crashed; + } else if (Success.Value) { + result.ExecutingResult = TestExecutingResult.Succeeded; + } else { + result.ExecutingResult = TestExecutingResult.Failed; + } + + if (!Success.Value) { + int pid = -1; + string? crashReason = null; + foreach (var crashLog in crashLogs) { + try { + logs.Add (crashLog); + + if (pid == -1) + pid = await GetPidFromMainLog (); + + GetCrashReason (pid, crashLog, out crashReason); + if (crashReason is not null) + break; + } catch (Exception e) { + var message = string.Format ("Failed to process crash report '{1}': {0}", e.Message, crashLog.Description); + mainLog.WriteLine (message); + exceptionLogger?.Invoke (2, message); + } + } + + if (!string.IsNullOrEmpty (crashReason)) { + if (crashReason == "per-process-limit") { + result.ResultMessage = "Killed due to using too much memory (per-process-limit)."; + } else { + result.ResultMessage = $"Killed by the OS ({crashReason})"; + } + } else if (launchFailure) { + result.ResultMessage = "Launch failure"; + } + + await GenerateXmlFailures (result.ResultMessage, crashed, crashReason); + } + + return result; + } + + public void Dispose () + { + crashLogs.Dispose (); + GC.SuppressFinalize (this); + } + } +} diff --git a/tests/xharness/TestReporterFactory.cs b/tests/xharness/TestReporterFactory.cs new file mode 100644 index 000000000000..77adb724b219 --- /dev/null +++ b/tests/xharness/TestReporterFactory.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System; +using Microsoft.DotNet.XHarness.Common; +using Microsoft.DotNet.XHarness.Common.Execution; +using Microsoft.DotNet.XHarness.Common.Logging; +using Microsoft.DotNet.XHarness.iOS.Shared; +using Microsoft.DotNet.XHarness.iOS.Shared.Execution; +using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; +using Microsoft.DotNet.XHarness.iOS.Shared.Logging; +using Microsoft.DotNet.XHarness.iOS.Shared.XmlResults; + +using ExceptionLogger = System.Action; + +namespace Xharness { + public class TestReporterFactory : ITestReporterFactory { + readonly IMlaunchProcessManager processManager; + + public TestReporterFactory (IMlaunchProcessManager processManager) + { + this.processManager = processManager ?? throw new ArgumentNullException (nameof (processManager)); + } + + public ITestReporter Create ( + IFileBackedLog mainLog, + IReadableLog runLog, + ILogs logs, + ICrashSnapshotReporter crashSnapshotReporter, + ISimpleListener simpleListener, + IResultParser parser, + AppBundleInformation appInformation, + RunMode runMode, + XmlResultJargon xmlJargon, + string? device, + TimeSpan timeout, + string? additionalLogsDirectory = null, + ExceptionLogger? exceptionLogger = null, + bool generateHtml = false) + { + return new TestReporter ( + processManager, + mainLog, + runLog, + logs, + crashSnapshotReporter, + simpleListener, + parser, + appInformation, + runMode, + xmlJargon, + device, + timeout, + additionalLogsDirectory, + exceptionLogger, + generateHtml); + } + } +} diff --git a/tests/xharness/Xharness.Tests/Jenkins/ErrorKnowledgeBaseTests.cs b/tests/xharness/Xharness.Tests/Jenkins/ErrorKnowledgeBaseTests.cs deleted file mode 100644 index 8b337c4b5b85..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/ErrorKnowledgeBaseTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -#nullable enable -using System.IO; -using Microsoft.DotNet.XHarness.iOS.Shared.Logging; -using NUnit.Framework; -using Xharness.Jenkins; - -namespace Xharness.Tests.Jenkins { - public class ErrorKnowledgeBaseTests { - - ErrorKnowledgeBase? errorKnowledgeBase; - string? testFile; - - [SetUp] - public void SetUp () - { - errorKnowledgeBase = new ErrorKnowledgeBase (); - testFile = Path.GetTempFileName (); - } - - [TearDown] - public void TearDown () - { - errorKnowledgeBase = null; - } - - [Test] - public void IsMonoMulti3IssuePresentTest () - { - using var log = new LogFile ("test", testFile); - log.WriteLine ("Some noise"); - log.WriteLine ("error MT5210: Native linking failed, undefined symbol: ___multi3"); - log.WriteLine ("Some noise"); - log.Flush (); - Assert.IsTrue (errorKnowledgeBase!.IsKnownBuildIssue (log, out var failureMessage)); - Assert.IsNotNull (failureMessage); - } - - [Test] - public void IsMonoMulti3IssueMissingTest () - { - using var log = new LogFile ("test", testFile); - log.WriteLine ("Some noise"); - log.WriteLine ("Some noise"); - log.Flush (); - Assert.IsFalse (errorKnowledgeBase!.IsKnownBuildIssue (log, out var failureMessage)); - Assert.IsNull (failureMessage); - } - - [Test] - public void IsHE0038ErrorPresentTest () - { - using var log = new LogFile ("test", testFile); - log.WriteLine ("Some noise"); - log.WriteLine ("error HE0038: Failed to launch the app"); - log.WriteLine ("Some noise"); - log.Flush (); - Assert.IsTrue (errorKnowledgeBase!.IsKnownTestIssue (log, out var failureMessage)); - Assert.IsNotNull (failureMessage); - } - - [Test] - public void IsHE0038ErrorMissingTest () - { - using var log = new LogFile ("test", testFile); - log.WriteLine ("Some noise"); - log.WriteLine ("Some noise"); - log.Flush (); - Assert.IsFalse (errorKnowledgeBase!.IsKnownTestIssue (log, out var failureMessage)); - Assert.IsNull (failureMessage); - } - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/ITestTaskExtensionsTests.cs b/tests/xharness/Xharness.Tests/Jenkins/ITestTaskExtensionsTests.cs deleted file mode 100644 index 80f38751a729..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/ITestTaskExtensionsTests.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using Microsoft.DotNet.XHarness.iOS.Shared; - -using Moq; -using NUnit.Framework; - -using Xharness.Jenkins.TestTasks; - -namespace Xharness.Tests.Jenkins { - - [TestFixture] - public class ITestTaskExtensionsTests { - - public class TestCasesData { - public static IEnumerable GetColorTestCases { - get { - var task = new Mock (); - task.Setup (t => t.NotStarted).Returns (true); - yield return new TestCaseData (task.Object).Returns ("black"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (true); - task.Setup (t => t.Building).Returns (true); - yield return new TestCaseData (task.Object).Returns ("darkblue"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (true); - task.Setup (t => t.Building).Returns (false); - task.Setup (t => t.Running).Returns (true); - yield return new TestCaseData (task.Object).Returns ("lightblue"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (true); - task.Setup (t => t.Building).Returns (false); - task.Setup (t => t.Running).Returns (false); - yield return new TestCaseData (task.Object).Returns ("blue"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.Crashed).Returns (true); - yield return new TestCaseData (task.Object).Returns ("maroon"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.LaunchFailure).Returns (true); - yield return new TestCaseData (task.Object).Returns ("coral"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.HarnessException).Returns (true); - yield return new TestCaseData (task.Object).Returns ("orange"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.TimedOut).Returns (true); - yield return new TestCaseData (task.Object).Returns ("purple"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.BuildFailure).Returns (true); - yield return new TestCaseData (task.Object).Returns ("darkred"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.Failed).Returns (true); - yield return new TestCaseData (task.Object).Returns ("red"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.BuildSucceeded).Returns (true); - yield return new TestCaseData (task.Object).Returns ("lightgreen"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.Succeeded).Returns (true); - yield return new TestCaseData (task.Object).Returns ("green"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.Ignored).Returns (true); - yield return new TestCaseData (task.Object).Returns ("gray"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.Waiting).Returns (true); - yield return new TestCaseData (task.Object).Returns ("darkgray"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - task.Setup (t => t.DeviceNotFound).Returns (true); - yield return new TestCaseData (task.Object).Returns ("orangered"); - - task = new Mock (); - task.Setup (t => t.InProgress).Returns (false); - yield return new TestCaseData (task.Object).Returns ("pink"); - } - } - - public static IEnumerable GetColorCollectionTestCases { - get { - - Mock firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - Mock secondTask = new Mock (); - secondTask.Setup (t => t.Crashed).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Crashed); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("maroon"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.LaunchFailure).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.LaunchFailure); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("coral"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.TimedOut).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.TimedOut); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("purple"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.BuildFailure).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.BuildFailure); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("darkred"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.Failed).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Failed); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("red"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.NotStarted).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.NotStarted); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("black"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.Ignored).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Ignored); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("gray"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.DeviceNotFound).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.DeviceNotFound); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("orangered"); - - firstTask = new Mock (); - firstTask.Setup (t => t.BuildSucceeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.BuildSucceeded); - secondTask = new Mock (); - secondTask.Setup (t => t.BuildSucceeded).Returns (true); - secondTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.BuildSucceeded); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("lightgreen"); - - firstTask = new Mock (); - firstTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - secondTask = new Mock (); - secondTask.Setup (t => t.Succeeded).Returns (true); - firstTask.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Succeeded); - yield return new TestCaseData (new List { firstTask.Object, secondTask.Object }).Returns ("green"); - - } - } - } - - [Test, TestCaseSource (typeof (TestCasesData), "GetColorTestCases")] - public string GetTestColorTest (ITestTask task) => task.GetTestColor (); - - [Test, TestCaseSource (typeof (TestCasesData), "GetColorCollectionTestCases")] - public string GetTestColorCollectionTest (IEnumerable tasks) => tasks.GetTestColor (); - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs b/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs deleted file mode 100644 index f6cd6d2c5ebd..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/JenkinsDeviceLoadterTests.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System; -using System.Collections; -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.Execution; -using Microsoft.DotNet.XHarness.Common.Logging; -using Microsoft.DotNet.XHarness.iOS.Shared.Execution; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Logging; -using Moq; -using NUnit.Framework; -using Xharness.Jenkins; - -namespace Xharness.Tests.Jenkins { - - [TestFixture] - public class JenkinsDeviceLoadterTests { - - public class TestCasesData { - public static IEnumerable GetDeviceTestCases { - get { - // set the mock expectations the expected results - var simulators = new Mock (); - var aDevice = new Mock (); - - // no devices found - var devices = new Mock (); - devices.Setup (d => d.Connected32BitIOS).Returns (Array.Empty ()); - devices.Setup (d => d.Connected64BitIOS).Returns (Array.Empty ()); - devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok - no devices found)."); - - // iOS 32b - devices = new Mock (); - devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.Connected64BitIOS).Returns (Array.Empty ()); - devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit"); - - devices = new Mock (); - devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.ConnectedTV).Returns (Array.Empty ()); - - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit"); - - devices = new Mock (); - devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.ConnectedTV).Returns (new IHardwareDevice [] { aDevice.Object }); - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit, tvOS"); - - devices = new Mock (); - devices.Setup (d => d.Connected32BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.Connected64BitIOS).Returns (new IHardwareDevice [] { aDevice.Object }); - devices.Setup (d => d.ConnectedTV).Returns (new IHardwareDevice [] { aDevice.Object }); - yield return new TestCaseData (simulators.Object, devices.Object, $"Device Listing (ok). Devices types are: iOS 32 bit, iOS 64 bit, tvOS"); - } - } - - public static IEnumerable GetSimulatorTestCases { - get { - var devices = new Mock (); - var simulators = new Mock (); - var processManager = new Mock (); - var db = new Mock (); - - simulators.Setup (s => s.AvailableDevices).Returns (Array.Empty ()); - yield return new TestCaseData (simulators.Object, devices.Object, "Simulator Listing (ok - no simulators found)."); - - simulators = new Mock (); - simulators.Setup (s => s.AvailableDevices).Returns (new SimulatorDevice [] { new SimulatorDevice (processManager.Object, db.Object) }); - yield return new TestCaseData (simulators.Object, devices.Object, $"Simulator Listing (ok - Found 1 simulators)."); - } - } - } - - Mock logs; - Mock log; - - [SetUp] - public void SetUp () - { - logs = new Mock (); - log = new Mock (); - - logs.Setup (l => l.Create ( - It.IsAny (), - It.Is (s => s.Equals ("Simulator Listing", StringComparison.OrdinalIgnoreCase)), - null)).Returns (log.Object); - - logs.Setup (l => l.Create ( - It.IsAny (), - It.Is (s => s.Equals ("Device Listing", StringComparison.OrdinalIgnoreCase)), - null)).Returns (log.Object); - - log.SetupSet (l => l.Description = It.IsAny ()).Verifiable (); - } - - [TearDown] - public void TearDown () - { - logs = null; - log = null; - } - - - [Test, TestCaseSource (typeof (TestCasesData), "GetDeviceTestCases")] - public async Task FoundDevicesTest (ISimulatorLoader simulators, IHardwareDeviceLoader devices, string expectedDescription) - { - var loader = new JenkinsDeviceLoader (simulators, devices, logs.Object); - - await loader.LoadDevicesAsync (); - // validate that the log description will be set as expected - log.VerifySet (l => l.Description = It.Is (s => s.Equals (expectedDescription, StringComparison.OrdinalIgnoreCase))); - } - - [Test, TestCaseSource (typeof (TestCasesData), "GetSimulatorTestCases")] - public async Task FoundSimulatorsTest (ISimulatorLoader simulators, IHardwareDeviceLoader devices, string expectedDescription) - { - var loader = new JenkinsDeviceLoader (simulators, devices, logs.Object); - - await loader.LoadSimulatorsAsync (); - // validate that the log description will be set as expected - log.VerifySet (l => l.Description = It.Is (s => s.Equals (expectedDescription, StringComparison.OrdinalIgnoreCase))); - } - - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/MarkdownReportWriterTests.cs b/tests/xharness/Xharness.Tests/Jenkins/MarkdownReportWriterTests.cs deleted file mode 100644 index 53ce059ec74c..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/MarkdownReportWriterTests.cs +++ /dev/null @@ -1,195 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Moq; -using NUnit.Framework; -using Xharness.Jenkins.Reports; -using Xharness.Jenkins.TestTasks; - -namespace Xharness.Tests.Jenkins { - [TestFixture] - public class MarkdownReportWriterTests { - - string path; - MarkdownReportWriter reportWriter; - - [SetUp] - public void SetUp () - { - path = Path.GetTempFileName (); - File.Delete (path); - reportWriter = new MarkdownReportWriter (); - } - - [TearDown] - public void TearDown () - { - File.Delete (path); - } - - [Test] - public void AllSuccessfulTest () - { - int count = 10; - List tasks = new List (); - for (var i = 0; i < count; i++) { - var success = new Mock (); - success.Setup (t => t.Finished).Returns (true); - success.Setup (t => t.Succeeded).Returns (true); - success.Setup (t => t.TestName).Returns ($"Success with id {i}"); - tasks.Add (success.Object); - } - - for (var i = 0; i < count; i++) { - var ignored = new Mock (); - ignored.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Ignored); - ignored.Setup (t => t.Finished).Returns (true); - tasks.Add (ignored.Object); - } - - using (var writer = new StreamWriter (path)) { - reportWriter.Write (tasks, writer); - } - - using (var reader = new StreamReader (path)) { - var report = reader.ReadToEnd (); - Assert.NotNull (report); - Assert.AreEqual ($"# :tada: All {count} tests passed :tada:\n\n", report); - } - } - - [Test] - public void MixResultsFailAndSuccessTest () - { - int count = 10; - List tasks = new List (); - for (var i = 0; i < count / 2; i++) { - var success = new Mock (); - success.Setup (t => t.Finished).Returns (true); - success.Setup (t => t.Succeeded).Returns (true); - success.Setup (t => t.TestName).Returns ($"Success with id {i}"); - tasks.Add (success.Object); - } - - for (var i = 0; i < count / 2; i++) { - var failure = new Mock (); - failure.Setup (t => t.Finished).Returns (true); - failure.Setup (t => t.Succeeded).Returns (false); - failure.Setup (t => t.Failed).Returns (true); - failure.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Failed); - failure.Setup (t => t.TestName).Returns ($"Failure with id {i}"); - tasks.Add (failure.Object); - } - - for (var i = 0; i < count; i++) { - var ignored = new Mock (); - ignored.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Ignored); - ignored.Setup (t => t.Finished).Returns (true); - tasks.Add (ignored.Object); - } - - using (var writer = new StreamWriter (path)) { - reportWriter.Write (tasks, writer); - } - - string summaryLine = null; - int failedTestsLineCount = 0; - - using (var reader = new StreamReader (path)) { - string line = null; - while ((line = reader.ReadLine ()) is not null) { - if (line.StartsWith ("{count / 2} tests failed, {count / 2} tests passed.
", summaryLine, "summary value"); - Assert.AreEqual (count / 2, failedTestsLineCount, "Error count"); - } - - [Test] - public void MissingDeviceTest () - { - int count = 10; - List tasks = new List (); - for (var i = 0; i < count; i++) { - var success = new Mock (); - success.Setup (t => t.DeviceNotFound).Returns (true); - success.Setup (t => t.Finished).Returns (true); - success.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.DeviceNotFound); - success.Setup (t => t.TestName).Returns ($"Failed with id {i}"); - tasks.Add (success.Object); - } - - using (var writer = new StreamWriter (path)) { - reportWriter.Write (tasks, writer); - } - - using (var reader = new StreamReader (path)) { - var report = reader.ReadToEnd (); - Assert.NotNull (report); - Assert.AreEqual ($"# Test results\n\n{count} tests' device not found, 0 tests passed.\n\n", report); - } - } - - [Test] - public void NotTestsTest () - { - int count = 10; - List tasks = new List (); - for (var i = 0; i < count; i++) { - var ignored = new Mock (); - ignored.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Ignored); - ignored.Setup (t => t.Finished).Returns (true); - tasks.Add (ignored.Object); - } - - using (var writer = new StreamWriter (path)) { - reportWriter.Write (tasks, writer); - } - - using (var reader = new StreamReader (path)) { - var report = reader.ReadToEnd (); - Assert.NotNull (report); - Assert.AreEqual ("# No tests selected.\n\n", report); - } - } - - [Test] - public void KnownIssueTest () - { - int count = 10; - List tasks = new List (); - - for (var i = 0; i < count; i++) { - var failure = new Mock (); - var knownIssue = new KnownIssue (humanMessage: "Testing known issues", issueLink: "http://github.com"); - failure.Setup (t => t.Finished).Returns (true); - failure.Setup (t => t.Succeeded).Returns (false); - failure.Setup (t => t.Failed).Returns (true); - failure.Setup (t => t.ExecutionResult).Returns (TestExecutingResult.Failed); - failure.Setup (t => t.TestName).Returns ($"Failure with id {i}"); - failure.Setup (t => t.KnownFailure).Returns (knownIssue); - tasks.Add (failure.Object); - } - - - using (var writer = new StreamWriter (path)) { - reportWriter.Write (tasks, writer); - } - - int failureCount = 0; - using (var reader = new StreamReader (path)) { - string line = null; - while ((line = reader.ReadLine ()) is not null) { - if (line.Contains ("Failure")) { - Assert.AreEqual ($" * Failure with id {failureCount}: Failed Known issue: [Testing known issues](http://github.com)", line, line); - failureCount++; - } - } - } - } - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/PeriodicCommandTests.cs b/tests/xharness/Xharness.Tests/Jenkins/PeriodicCommandTests.cs deleted file mode 100644 index 0e8fcb3610af..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/PeriodicCommandTests.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.Execution; -using Microsoft.DotNet.XHarness.Common.Logging; -using Microsoft.DotNet.XHarness.iOS.Shared.Execution; -using Microsoft.DotNet.XHarness.iOS.Shared.Logging; -using Moq; -using NUnit.Framework; -using Xharness.Jenkins; - -namespace Xharness.Tests.Jenkins { - - [TestFixture] - public class PeriodicCommandTests { - - Mock processManager; - Mock logs; - Mock log; - TimeSpan interval; - string command; - string arguments; - - [SetUp] - public void SetUp () - { - processManager = new Mock (MockBehavior.Strict); - logs = new Mock (); - log = new Mock (); - - // common setup for the mocks - logs.Setup (l => l.Create (It.Is (s => true), It.Is (s => true), null)).Returns (log.Object); - interval = TimeSpan.FromMilliseconds (100); - command = "test"; - arguments = "periodic"; - } - - // we do not test the options without the cancellation task because we want to be nice people when running - // the tests and do not leave a thread doing nothing - [Test] - public async Task TestExecuteNoArgs () - { - var periodicCommand = new PeriodicCommand (command, processManager.Object, interval, logs.Object); - var executionTcs = new TaskCompletionSource (); - var threadCs = new CancellationTokenSource (); - - processManager.Setup (pm => pm.RunAsync ( - It.Is (p => p.StartInfo.FileName == command && p.StartInfo.Arguments == string.Empty), - It.IsAny (), - interval, - null, - It.IsAny (), - null)).Callback, CancellationToken?, bool?> ( - (p, l, i, env, t, d) => { - executionTcs.TrySetResult (true); - }).ReturnsAsync (new ProcessExecutionResult { ExitCode = 0, TimedOut = false }).Verifiable (); - - var task = periodicCommand.Execute (threadCs.Token); - await executionTcs.Task; // wait for the callback in the mock, which is in another thread to set the source - processManager.VerifyAll (); - processManager.VerifyNoOtherCalls (); - threadCs.Cancel (); // clean - } - - [Test] - public async Task TestExecuteArgs () - { - // all similar logic to the above one, but with arguments - var periodicCommand = new PeriodicCommand (command, processManager.Object, interval, logs.Object, arguments: arguments); - var executionTcs = new TaskCompletionSource (); - var threadCs = new CancellationTokenSource (); - - processManager.Setup (pm => pm.RunAsync ( - It.Is (p => p.StartInfo.FileName == command && p.StartInfo.Arguments == arguments), - It.IsAny (), - interval, - null, - It.IsAny (), - null)).Callback, CancellationToken?, bool?> ( - (p, l, i, env, t, d) => { - executionTcs.TrySetResult (true); - }).ReturnsAsync (new ProcessExecutionResult { ExitCode = 0, TimedOut = false }).Verifiable (); - - var task = periodicCommand.Execute (threadCs.Token); - await executionTcs.Task; // wait for the callback in the mock, which is in another thread to set the source - processManager.VerifyAll (); - processManager.VerifyNoOtherCalls (); - threadCs.Cancel (); // clean - } - - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/ResourceManagerTests.cs b/tests/xharness/Xharness.Tests/Jenkins/ResourceManagerTests.cs deleted file mode 100644 index bdd8eb0bb6e7..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/ResourceManagerTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.Collections.Generic; -using System.Resources; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Xharness.Jenkins; -using Moq; -using NUnit.Framework; -using System.Linq; - -namespace Xharness.Tests.Jenkins { - [TestFixture] - public class ResourceManagerTests { - - Mock device1; - Mock device2; - Xharness.Jenkins.ResourceManager resourceManager; - - [SetUp] - public void SetUp () - { - device1 = new Mock (); - device2 = new Mock (); - resourceManager = new Xharness.Jenkins.ResourceManager (); - } - - [Test] - public void GetDeviceResourceMissingTest () - { - var devices = new List { device1.Object, device2.Object }; - // set the device expectations - device1.Setup (d => d.UDID).Returns ("device1"); - device1.Setup (d => d.Name).Returns ("device1"); - - device2.Setup (d => d.UDID).Returns ("device2"); - device2.Setup (d => d.Name).Returns ("device2"); - - var resources = resourceManager.GetDeviceResources (devices); - - // assert that both are present - Assert.NotNull (resources, "resources"); - Assert.AreEqual (2, resources.Count ()); - Assert.AreEqual (1, resources.Where (r => r.Name == "device1").Count (), "device1"); - Assert.AreEqual (1, resources.Where (r => r.Name == "device2").Count (), "device2"); - } - - [Test] - public void GetDeviceResourcePresent () - { - // call it twice to make sure we get the same results - var devices = new List { device1.Object, device2.Object }; - // set the device expectations - device1.Setup (d => d.UDID).Returns ("device1"); - device1.Setup (d => d.Name).Returns ("device1"); - - device2.Setup (d => d.UDID).Returns ("device2"); - device2.Setup (d => d.Name).Returns ("device2"); - - var resources = resourceManager.GetDeviceResources (devices); - - // assert that both are present - Assert.NotNull (resources, "resources"); - Assert.AreEqual (2, resources.Count ()); - Assert.AreEqual (1, resources.Where (r => r.Name == "device1").Count (), "first device1"); - Assert.AreEqual (1, resources.Where (r => r.Name == "device2").Count (), "first device2"); - - var resources2 = resourceManager.GetDeviceResources (devices); - - // assert that both are present - Assert.NotNull (resources2, "resources2"); - Assert.AreEqual (2, resources2.Count ()); - Assert.AreEqual (1, resources2.Where (r => r.Name == "device1").Count (), "second device1"); - Assert.AreEqual (1, resources2.Where (r => r.Name == "device2").Count (), "decond device2"); - } - - [Test] - public void GetDeviceResourcesAddMissingTest () - { - var devices = new List { device1.Object }; - // set the device expectations - device1.Setup (d => d.UDID).Returns ("device1"); - device1.Setup (d => d.Name).Returns ("device1"); - - device2.Setup (d => d.UDID).Returns ("device2"); - device2.Setup (d => d.Name).Returns ("device2"); - - var resources = resourceManager.GetDeviceResources (devices); - - // assert that both are present - Assert.NotNull (resources, "resources"); - Assert.AreEqual (1, resources.Count ()); - Assert.AreEqual (1, resources.Where (r => r.Name == "device1").Count (), "first device1"); - Assert.AreEqual (0, resources.Where (r => r.Name == "device2").Count (), "first device2"); - - var devices2 = new List { device1.Object, device2.Object }; - var resources2 = resourceManager.GetDeviceResources (devices2); - - // assert that both are present - Assert.NotNull (resources2, "resources2"); - Assert.AreEqual (2, resources2.Count ()); - Assert.AreEqual (1, resources2.Where (r => r.Name == "device1").Count (), "second device1"); - Assert.AreEqual (1, resources2.Where (r => r.Name == "device2").Count (), "decond device2"); - } - - [Test] - public void GetAllTest () - { - var devices = new List { device1.Object, device2.Object }; - // set the device expectations - device1.Setup (d => d.UDID).Returns ("device1"); - device1.Setup (d => d.Name).Returns ("device1"); - - device2.Setup (d => d.UDID).Returns ("device2"); - device2.Setup (d => d.Name).Returns ("device2"); - - var deviceResources = resourceManager.GetDeviceResources (devices); - - // now get all of the present resources and assert we have the desktop and nuget - var allResources = resourceManager.GetAll (); - - Assert.AreEqual (deviceResources.Count () + 2, allResources.Count (), "count"); - Assert.AreEqual (1, allResources.Where (r => r.Name == "device1").Count ()); - Assert.AreEqual (1, allResources.Where (r => r.Name == "device2").Count ()); - Assert.AreEqual (1, allResources.Where (r => r.Name == "Desktop").Count ()); - Assert.AreEqual (1, allResources.Where (r => r.Name == "Nuget").Count ()); - } - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs b/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs deleted file mode 100644 index f7f61230451a..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/TestSelectionTests.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using NUnit.Framework; -using Xharness.Jenkins; - -#nullable enable - -namespace Xharness.Tests.Jenkins { - - [TestFixture] - public class TestSelectionTests { - - TestSelection selection = new TestSelection (); - - [SetUp] - public void Setup () - { - selection = new TestSelection (); - } - - [Test] - public void DefaultSelectionTest () - { - // Assert tests - Assert.IsTrue (selection.SelectedTests.HasFlag (TestLabel.Msbuild), "msbuild"); - Assert.IsTrue (selection.IsEnabled (TestLabel.Msbuild), "IsEnabled (msbuild)"); - - Assert.IsTrue (selection.SelectedTests.HasFlag (TestLabel.Monotouch), "monotouch"); - Assert.IsTrue (selection.IsEnabled (TestLabel.Monotouch), "IsEnabled (monotouch)"); - - Assert.IsTrue (selection.SelectedTests.HasFlag (TestLabel.DotnetTest), "dotnet"); - Assert.IsTrue (selection.IsEnabled (TestLabel.DotnetTest), "IsEnabled (dotnet)"); - - // Assert platforms - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.tvOS), "tvos"); - Assert.IsTrue (selection.IsEnabled (PlatformLabel.tvOS), "IsEnabled (tvOS)"); - - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.iOS), "iOS"); - Assert.IsTrue (selection.IsEnabled (PlatformLabel.iOS), "IsEnabled (iOS)"); - - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.iOSSimulator), "iOSSimulator"); - Assert.IsTrue (selection.IsEnabled (PlatformLabel.iOSSimulator), "IsEnabled (iOSSimulator)"); - - Assert.IsTrue (selection.SelectedPlatforms.HasFlag (PlatformLabel.MacCatalyst), "maccatalyst"); - Assert.IsTrue (selection.IsEnabled (PlatformLabel.MacCatalyst), "IsEnabled (maccatalyst)"); - } - - [Test] - public void DisableAllTests () - { - selection.SetEnabled (TestLabel.All, false); - // loop over all tests labels and except None and All, assert they are not enabled - foreach (var obj in Enum.GetValues (typeof (TestLabel))) { - if (obj is TestLabel label) { - switch (label) { - case TestLabel.All: - case TestLabel.None: - continue; - default: - Assert.IsFalse (selection.IsEnabled (label), label.ToString ()); - break; - } - } - } - } - - [Test] - public void EnableAllTests () - { - selection.SetEnabled (TestLabel.All, true); - // loop over all tests labels and except None and All, assert they are not enabled - foreach (var obj in Enum.GetValues (typeof (TestLabel))) { - if (obj is TestLabel label) { - switch (label) { - case TestLabel.All: - case TestLabel.None: - continue; - default: - Assert.IsTrue (selection.IsEnabled (label), label.ToString ()); - break; - } - } - } - } - - [Test] - public void EnableSingleTest () - { - // disable all, then enable a single tests - selection.SetEnabled (TestLabel.All, false); - foreach (var obj in Enum.GetValues (typeof (TestLabel))) { - if (obj is TestLabel label) { - switch (label) { - case TestLabel.All: - case TestLabel.None: - continue; - default: - Assert.IsFalse (selection.IsEnabled (label), label.ToString ()); - break; - } - } - } - } - - [Test] - public void EnableSeveralTests () - { - selection.SetEnabled (TestLabel.All, false); - selection.SetEnabled (TestLabel.Monotouch, true); - foreach (var obj in Enum.GetValues ()) { - if (obj is TestLabel label) { - switch (label) { - case TestLabel.All: - case TestLabel.None: - continue; - case TestLabel.Monotouch: - Assert.IsTrue (selection.IsEnabled (label), label.ToString ()); - break; - default: - Assert.IsFalse (selection.IsEnabled (label), label.ToString ()); - break; - } - } - } - } - } -} diff --git a/tests/xharness/Xharness.Tests/Jenkins/TestSelectorTests.cs b/tests/xharness/Xharness.Tests/Jenkins/TestSelectorTests.cs deleted file mode 100644 index e3a51e31f933..000000000000 --- a/tests/xharness/Xharness.Tests/Jenkins/TestSelectorTests.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Collections.Generic; -using System.Linq.Expressions; -using Moq; -using NUnit.Framework; -using Xharness.Jenkins; - -namespace Xharness.Tests.Jenkins { - public class TestSelectorTests { - TestSelector selector; - Mock versionControlSystem; - - [SetUp] - public void SetUp () - { - versionControlSystem = new Mock (); - selector = new TestSelector (null, versionControlSystem.Object); - } - - [TearDown] - public void TearDown () - { - selector = null; - } - - [TestCase ("run-all-tests", TestLabel.All, PlatformLabel.All)] - [TestCase ("skip-all-tests", TestLabel.None, PlatformLabel.None)] - [TestCase ("skip-all-tests, run-monotouch-tests", TestLabel.Monotouch, PlatformLabel.None)] - [TestCase ("skip-all-tests, run-monotouch-tests, run-ios-tests", TestLabel.Monotouch, PlatformLabel.iOS)] - [TestCase ("run-monotouch-tests, run-bgen-tests, run-all-tests", TestLabel.All, PlatformLabel.All)] - public void SelectTestByLabelsTest (string cmdLabels, TestLabel expectedResult, PlatformLabel expectedPlatform) - { - var labels = new HashSet (); - labels.UnionWith (cmdLabels.Split (',')); - var selection = new TestSelection (); - selector.SelectTestsByLabel (labels, selection); - Assert.AreEqual (expectedResult, selection.SelectedTests, "Test selection failed."); - Assert.AreEqual (expectedPlatform, selection.SelectedPlatforms, "Platform selection failed."); - } - } -} diff --git a/tests/xharness/Xharness.Tests/Samples/NUnitV2Sample.xml b/tests/xharness/Xharness.Tests/Samples/NUnitV2Sample.xml deleted file mode 100644 index 70c61a15c04e..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/NUnitV2Sample.xml +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/xharness/Xharness.Tests/Samples/NUnitV3Sample.xml b/tests/xharness/Xharness.Tests/Samples/NUnitV3Sample.xml deleted file mode 100644 index f78fceb28368..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/NUnitV3Sample.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleFailure.xml b/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleFailure.xml deleted file mode 100644 index bf83ae78c02a..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleFailure.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleSuccess.xml b/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleSuccess.xml deleted file mode 100644 index 79714282cbf3..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/NUnitV3SampleSuccess.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/TestProject/Info.plist b/tests/xharness/Xharness.Tests/Samples/TestProject/Info.plist deleted file mode 100644 index b06447712c80..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/TestProject/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleName - com.xamarin.bcltests.SystemXunit - CFBundleIdentifier - com.xamarin.bcltests.SystemXunit - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 7.0 - UIDeviceFamily - - 1 - 2 - - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/TestProject/SystemXunit.csproj b/tests/xharness/Xharness.Tests/Samples/TestProject/SystemXunit.csproj deleted file mode 100644 index e66c2cb29ba1..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/TestProject/SystemXunit.csproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - - Debug - iPhoneSimulator - {3A835432-B054-32FD-07CB-F9A8FFCFB44D} - {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Exe - com.xamarin.bcltests.SystemXunit - com.xamarin.bcltests.SystemXunit - 67,168,169,219,414,612,618,649,672 - Xamarin.iOS - Resources - latest - - - True - full - False - bin - DEBUG;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_2_1;MOBILE;MONOTOUCH;FULL_AOT_RUNTIME;DISABLE_CAS_USE;$(DefineConstants) - prompt - 4 - True - None - True - x86_64 - cjk,mideast,other,rare,west - - - True - full - False - bin - DEBUG;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;NET_2_1;MOBILE;MONOTOUCH;FULL_AOT_RUNTIME;DISABLE_CAS_USE;$(DefineConstants) - prompt - 4 - iPhone Developer - True - True - ARM64 - cjk,mideast,other,rare,west - - - - - - - - - - - - - - - - - - - - monotouch\nunitlite.dll - - - monotouch\tests\Xunit.NetCore.Extensions.dll - - - monotouch\tests\xunit.execution.dotnet.dll - - - - - monotouch\tests\monotouch_System_xunit-test.dll - - - - - Assets.xcassets\AppIcon.appiconset\Contents.json - - - Assets.xcassets\Contents.json - - - - - - - - Info.plist - - - Entitlements.plist - - - - - TestRunner.NUnit\NUnitTestRunner.cs - - - TestRunner.NUnit\ClassOrNamespaceFilter.cs - - - TestRunner.NUnit\TestMethodFilter.cs - - - TestRunner.Core\Extensions.Bool.cs - - - TestRunner.Core\LogWriter.cs - - - TestRunner.Core\MinimumLogLevel.cs - - - TestRunner.Core\TcpTextWriter.cs - - - TestRunner.Core\TestAssemblyInfo.cs - - - TestRunner.Core\TestCompletionStatus.cs - - - TestRunner.Core\TestExecutionState.cs - - - TestRunner.Core\TestFailureInfo.cs - - - TestRunner.Core\TestRunner.cs - - - TestRunner.Core\TestRunSelector.cs - - - TestRunner.Core\TestRunSelectorType.cs - - - TestRunner.xUnit\XUnitFilter.cs - - - TestRunner.xUnit\XUnitFilterType.cs - - - TestRunner.xUnit\XUnitTestRunner.cs - - - ApplicationOptions.cs - - - IgnoreFileParser.cs - - - AppDelegate.cs - - - Main.cs - - - ViewController.cs - - - ViewController.designer.cs - ViewController.cs - - - RegisterType.cs - - - - - TestRunner.xUnit\NUnitXml.xslt - - - TestRunner.xUnit\NUnit3Xml.xslt - - - common-monotouch_System_xunit-test.dll.ignore - PreserveNewest - - - nunit-excludes.txt - PreserveNewest - - - xunit-excludes.txt - PreserveNewest - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/TouchUnitSample.xml b/tests/xharness/Xharness.Tests/Samples/TouchUnitSample.xml deleted file mode 100644 index 213c4c372d76..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/TouchUnitSample.xml +++ /dev/null @@ -1,8842 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/xharness/Xharness.Tests/Samples/devices.xml b/tests/xharness/Xharness.Tests/Samples/devices.xml deleted file mode 100644 index 8a4240022408..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/devices.xml +++ /dev/null @@ -1,277 +0,0 @@ - - - /Applications/Xcode113.app/Contents/Developer - - - - - - - - - - - - - 5696DC36EE3249859D465DA37E6EA912 - - - - Wifi - - False - - True - - Office - - - - - - - - - - - - - Activated - 5650776064 - 100 - b0:19:c6:94:f2:26 - 17D50 - 32789 - arm64 - Development - iPhone - 1 - 1 - 5696DC36EE3249859D465DA37E6EA912 - Standard - - D211AP - Usb - 359401080217877 - True - True - True - MQ8L2 - iPhone - True - 1 - iPhone10,5 - 13.3.1 - C39V7FLJJCM2 - 58561933312 - D9DCBED1EC414ECE9A2353364C2AC454 - 1434502442682426 - True - b0:19:c6:94:f2:25 - - - - - - - - - - - iPhone - - - E383EA784E604083B5B602853A364759 - - - - Usb - - False - - True - - iPhone - - - - - - - 6D6C141F40CC4A4DB7967FCCE974ECE3 - - - - - - - - - - - - - - iPhone - - - D384F1159D5748C2A590420D64FA8CBE - - - - Usb - - False - - True - - XQAiPhone5Sa - - - - - - - 245481CA878E4AC0825DFBFDBCFD16BB - - - - - - - - - - - - - - iPod - - - 5D61F84BC2804AA698C2DFC1B7FDD200 - - - - Usb - - False - - True - - XQAiPodTouch5f - - - - - - - 1CBD36A8F42441A78D57443EFE0BD666 - - - - - - Activated - 43999293440 - 100 - 88:64:40:5c:ee:c5 - 17A577 - 32816 - arm64e - Development - iPhone - 1 - 1 - 8A450AA31EA94191AD6B02455F377CC1 - Standard - False - N104AP - Usb - 353981100627011 - True - True - True - MWL72 - Manuel’s iPhone - True - 1 - iPhone12,1 - 13.0 - DNPZ893NN72J - 54814302208 - 58F21118E4D34FD69EAB7860BB9B38A0 - 2852055891869742 - True - 88:64:40:67:a1:06 - - - - - - - - - - - Watch - - - 9608C09A197C4A6EB41B454D91976654 - - - - 3 - - False - - True - - Manuel’s Apple Watch - - - - - - - BC87FE47DA2A421CA791AD667E7E57E8 - - - - bd3fd054136767445ff47819f65b74867a48e591 - - - Activated - 22636388352 - 90 - a4:d1:d2:74:24:89 - 13G36 - 35136 - armv7f - - iPad - white - unknown - E854B2C3E7C8451BAF8053EC4DAAEE49 - Standard - - K93AP - Usb - - True - True - True - MC980 - Manuel de la Pena Saenz’s iPad - False - 1 - iPad2,1 - 9.3.5 - DN6FV2LSDKPJ - 29631791104 - 51F3354D448D4814825D07DC5658C19B - 4130031754541 - False - a4:d1:d2:74:24:88 - - \ No newline at end of file diff --git a/tests/xharness/Xharness.Tests/Samples/run-log.txt b/tests/xharness/Xharness.Tests/Samples/run-log.txt deleted file mode 100644 index 4de9a92f07d3..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/run-log.txt +++ /dev/null @@ -1,47 +0,0 @@ -14:48:45.0272010 Test log server listening on: 0.0.0.0:49987 -14:48:45.0308310 System log for the 'iPhone X (iOS 13.3) - created by xharness' simulator is: /Users/mandel/Library/Logs/CoreSimulator/96EBF3D8-393E-4166-B1AF-4A3BDEAC5021/system.log -14:48:45.0314300 *** Executing com.xamarin.bcltests.mscorlib Part 1/Classic in the simulator *** -14:48:45.0328640 Starting test run -14:48:45.0332180 /Users/mandel/dotnet/macios/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch --sdkroot /Applications/Xcode113.app -v -argument=-connection-mode -argument=none -argument=-app-arg:-autostart -setenv=NUNIT_AUTOSTART=true -argument=-app-arg:-autoexit -setenv=NUNIT_AUTOEXIT=true -argument=-app-arg:-enablenetwork -setenv=NUNIT_ENABLE_NETWORK=true -argument=-app-arg:-hostname:127.0.0.1 -setenv=NUNIT_HOSTNAME=127.0.0.1 -argument=-app-arg:-transport:Tcp -setenv=NUNIT_TRANSPORT=TCP -argument=-app-arg:-hostport:49987 -setenv=NUNIT_HOSTPORT=49987 --launchsim "/Users/mandel/dotnet/macios/master/xamarin-macios/tests/xharness/tmp-test-dir/mscorlib Part 1/bin/mscorlib Part 1/iPhoneSimulator/Debug-unified/com.xamarin.bcltests.mscorlib Part 1.app" --stdout=/dev/ttys000 --stderr=/dev/ttys000 --device=:v2:udid=96EBF3D8-393E-4166-B1AF-4A3BDEAC5021 -14:48:45.2834160 Using Xcode 11.3 found in /Applications/Xcode113.app -14:48:45.2865790 Xamarin.Hosting: Xamarin.Hosting -14:48:45.2867370 Xamarin.Hosting: Version: cec1cba137 (master) -14:48:45.2867590 Xamarin.Hosting: Xcode: /Applications/Xcode113.app -14:48:45.2886960 Xamarin.Hosting: Xcode Version: 11.3 -14:48:45.2892130 Xamarin.Hosting: Verbosity: 11 -14:48:45.2987220 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/DVTFoundation -14:48:45.3024060 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTiPhoneSimulatorRemoteClient.framework/DVTiPhoneSimulatorRemoteClient -14:48:45.3024840 Xamarin.Hosting: Loaded /Library/Developer/PrivateFrameworks/CoreSimulator.framework/CoreSimulator -14:48:45.3026130 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/DTDeviceKitBase -14:48:45.3154170 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTKit.framework/DVTKit -14:48:45.3159370 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DTDeviceKit.framework/DTDeviceKit -14:48:45.3160450 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DTXConnectionServices.framework/DTXConnectionServices -14:48:45.3167760 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTSourceControl.framework/DVTSourceControl -14:48:45.3168970 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTServices.framework/DVTServices -14:48:45.3170070 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTPortal.framework/DVTPortal -14:48:45.3236970 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTDocumentation.framework/DVTDocumentation -14:48:45.3244800 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTAnalyticsClient.framework/DVTAnalyticsClient -14:48:45.3254630 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/DVTAnalytics.framework/DVTAnalytics -14:48:45.3273940 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/SourceKit.framework/SourceKit -14:48:45.3451120 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/Frameworks/IDEFoundation.framework/IDEFoundation -14:48:45.3459620 Xamarin.Hosting: Loaded /Applications/Xcode113.app/Contents/SharedFrameworks/IDEProducts.framework/IDEProducts -14:48:45.4904370 Xamarin.Hosting: Simulator watchdogs are already disabled for 'iOS 13.3 (17C45) - iPhone X'. -14:48:45.5001330 Xamarin.Hosting: Launching simulator application 'com.apple.iphonesimulator' -14:48:45.8284390 Xamarin.Hosting: Ready notification 'com.apple.iphonesimulator.ready' received from the simulator. -14:48:45.8317100 Xamarin.Hosting: Booting iPhone X (iOS 13.3) - created by xharness... -14:48:46.4418970 Xamarin.Hosting: Booted iPhone X (iOS 13.3) - created by xharness successfully. -14:48:46.4461820 Copying in /Users/mandel/dotnet/macios/master/xamarin-macios/tests/xharness/tmp-test-dir/mscorlib Part 1/bin/mscorlib Part 1/iPhoneSimulator/Debug-unified/com.xamarin.bcltests.mscorlib Part 1.app/.monotouch-64 -14:48:48.1443990 Xamarin.Hosting: No need to boot (already booted): iPhone X (iOS 13.3) - created by xharness -14:48:48.1459630 Xamarin.Hosting: Installing /Users/mandel/dotnet/macios/master/xamarin-macios/tests/xharness/tmp-test-dir/mscorlib Part 1/bin/mscorlib Part 1/iPhoneSimulator/Debug-unified/com.xamarin.bcltests.mscorlib Part 1.app with Bundle Identifier com.xamarin.bcltests.mscorlib Part 1 on 'iOS 13.3 (17C45) - iPhone X'... -14:49:25.8788620 Xamarin.Hosting: Installed 'com.xamarin.bcltests.mscorlib Part 1' from /Users/mandel/dotnet/macios/master/xamarin-macios/tests/xharness/tmp-test-dir/mscorlib Part 1/bin/mscorlib Part 1/iPhoneSimulator/Debug-unified/com.xamarin.bcltests.mscorlib Part 1.app -14:49:26.6020030 Xamarin.Hosting: Could not find any potentially troublesome weak load commands. -14:49:26.7037460 Xamarin.Hosting: The bundle id com.xamarin.bcltests.mscorlib Part 1 was successfully installed. -14:49:26.7087350 Xamarin.Hosting: Launching com.xamarin.bcltests.mscorlib Part 1 on 'iOS 13.3 (17C45) - iPhone X' -14:49:26.7808590 Xamarin.Hosting: Launched com.xamarin.bcltests.mscorlib Part 1 with pid 94797 -14:49:26.7861460 Xamarin.Hosting: Device 'iOS 13.3 (17C45) - iPhone X' booted. -14:49:31.0250650 Connection from 127.0.0.1:53085 saving logs to /Users/mandel/dotnet/macios/master/xamarin-macios/jenkins-results/tests/20200320_144720/mscorlib Part 1/122/test-classic-20200320_144845.log -14:49:31.0257860 Test run started -14:50:01.4773140 Tests have finished executing -14:50:01.7897340 Xamarin.Hosting: Simulated process has exited. -14:50:02.0809610 Test run completed -14:50:02.1691940 Test run succeeded \ No newline at end of file diff --git a/tests/xharness/Xharness.Tests/Samples/simulators.xml b/tests/xharness/Xharness.Tests/Samples/simulators.xml deleted file mode 100644 index 700467691560..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/simulators.xml +++ /dev/null @@ -1,925 +0,0 @@ - - - /Applications/Xcode113.app/Contents/Developer - - - - iOS 10.3 - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - 656129 - - - iOS 12.2 - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - 786944 - - - iOS 13.3 - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - 852736 - - - tvOS 10.2 - com.apple.CoreSimulator.SimRuntime.tvOS-10-2 - 655872 - - - tvOS 12.2 - com.apple.CoreSimulator.SimRuntime.tvOS-12-2 - 786944 - - - tvOS 13.3 - com.apple.CoreSimulator.SimRuntime.tvOS-13-3 - 852736 - - - watchOS 3.2 - com.apple.CoreSimulator.SimRuntime.watchOS-3-2 - 197120 - - - watchOS 5.2 - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - 328192 - - - watchOS 6.1 - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - 393473 - - - - - iPhone 4s - com.apple.CoreSimulator.SimDeviceType.iPhone-4s - IPhone - 327680 - 655359 - false - - - iPhone 5 - com.apple.CoreSimulator.SimDeviceType.iPhone-5 - IPhone - 393216 - 720895 - false - - - iPhone 5s - com.apple.CoreSimulator.SimDeviceType.iPhone-5s - IPhone - 458752 - 851967 - true - - - iPhone 6 Plus - com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus - IPhone - 524288 - 851967 - true - - - iPhone 6 - com.apple.CoreSimulator.SimDeviceType.iPhone-6 - IPhone - 524288 - 851967 - true - - - iPhone 6s - com.apple.CoreSimulator.SimDeviceType.iPhone-6s - IPhone - 589824 - 4294967295 - true - - - iPhone 6s Plus - com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus - IPhone - 589824 - 4294967295 - true - - - iPhone SE - com.apple.CoreSimulator.SimDeviceType.iPhone-SE - IPhone - 590592 - 4294967295 - true - - - iPhone 7 - com.apple.CoreSimulator.SimDeviceType.iPhone-7 - IPhone - 655360 - 4294967295 - true - - - iPhone 7 Plus - com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus - IPhone - 655360 - 4294967295 - true - - - iPhone 8 - com.apple.CoreSimulator.SimDeviceType.iPhone-8 - IPhone - 720896 - 4294967295 - true - - - iPhone 8 Plus - com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus - IPhone - 720896 - 4294967295 - true - - - iPhone X - com.apple.CoreSimulator.SimDeviceType.iPhone-X - IPhone - 720896 - 4294967295 - true - - - iPhone Xs - com.apple.CoreSimulator.SimDeviceType.iPhone-XS - IPhone - 786432 - 4294967295 - true - - - iPhone Xs Max - com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max - IPhone - 786432 - 4294967295 - true - - - iPhone Xʀ - com.apple.CoreSimulator.SimDeviceType.iPhone-XR - IPhone - 786432 - 4294967295 - true - - - iPhone 11 - com.apple.CoreSimulator.SimDeviceType.iPhone-11 - IPhone - 851968 - 4294967295 - true - - - iPhone 11 Pro - com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro - IPhone - 851968 - 4294967295 - true - - - iPhone 11 Pro Max - com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max - IPhone - 851968 - 4294967295 - true - - - iPad 2 - com.apple.CoreSimulator.SimDeviceType.iPad-2 - IPad - 262912 - 655359 - false - - - iPad Retina - com.apple.CoreSimulator.SimDeviceType.iPad-Retina - IPad - 327936 - 655359 - false - - - iPad Air - com.apple.CoreSimulator.SimDeviceType.iPad-Air - IPad - 458752 - 851967 - true - - - iPad mini 2 - com.apple.CoreSimulator.SimDeviceType.iPad-mini-2 - IPad - 458752 - 851967 - true - - - iPad mini 3 - com.apple.CoreSimulator.SimDeviceType.iPad-mini-3 - IPad - 524544 - 851967 - true - - - iPad mini 4 - com.apple.CoreSimulator.SimDeviceType.iPad-mini-4 - IPad - 589824 - 4294967295 - true - - - iPad Air 2 - com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 - IPad - 524288 - 4294967295 - true - - - iPad Pro (9.7-inch) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch- - IPad - 655360 - 4294967295 - true - - - iPad Pro (12.9-inch) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro - IPad - 590080 - 4294967295 - true - - - iPad (5th generation) - com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation- - IPad - 656128 - 4294967295 - true - - - iPad Pro (12.9-inch) (2nd generation) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation- - IPad - 656128 - 4294967295 - true - - - iPad Pro (10.5-inch) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch- - IPad - 656128 - 4294967295 - true - - - iPad (6th generation) - com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation- - IPad - 721664 - 4294967295 - true - - - iPad (7th generation) - com.apple.CoreSimulator.SimDeviceType.iPad--7th-generation- - IPad - 851968 - 4294967295 - true - - - iPad Pro (11-inch) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch- - IPad - 786432 - 4294967295 - true - - - iPad Pro (12.9-inch) (3rd generation) - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation- - IPad - 786432 - 4294967295 - true - - - iPad mini (5th generation) - com.apple.CoreSimulator.SimDeviceType.iPad-mini--5th-generation- - IPad - 786944 - 4294967295 - true - - - iPad Air (3rd generation) - com.apple.CoreSimulator.SimDeviceType.iPad-Air--3rd-generation- - IPad - 786944 - 4294967295 - true - - - Apple TV - com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p - TV - 589824 - 4294967295 - true - - - Apple TV 4K - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K - TV - 720896 - 4294967295 - true - - - Apple TV 4K (at 1080p) - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p - TV - 720896 - 4294967295 - true - - - Apple Watch - 38mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm - Watch - 131072 - 327679 - false - - - Apple Watch - 42mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm - Watch - 131072 - 327679 - false - - - Apple Watch Series 2 - 38mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm - Watch - 196608 - 4294967295 - false - - - Apple Watch Series 2 - 42mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm - Watch - 196608 - 4294967295 - false - - - Apple Watch Series 3 - 38mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm - Watch - 262144 - 4294967295 - false - - - Apple Watch Series 3 - 42mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm - Watch - 262144 - 4294967295 - false - - - Apple Watch Series 4 - 40mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm - Watch - 327680 - 4294967295 - false - - - Apple Watch Series 4 - 44mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm - Watch - 327680 - 4294967295 - false - - - Apple Watch Series 5 - 40mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-40mm - Watch - 393216 - 4294967295 - false - - - Apple Watch Series 5 - 44mm - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm - Watch - 393216 - 4294967295 - false - - - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-5 - /Users/mandel/Library/Developer/CoreSimulator/Devices/B0CF5BA5-318E-4FC8-8FC1-FB82D9F2FB42 - /Users/mandel/Library/Logs/CoreSimulator/B0CF5BA5-318E-4FC8-8FC1-FB82D9F2FB42 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-5s - /Users/mandel/Library/Developer/CoreSimulator/Devices/78A86F96-8333-42DE-81F3-1D8CFEC1FB17 - /Users/mandel/Library/Logs/CoreSimulator/78A86F96-8333-42DE-81F3-1D8CFEC1FB17 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/A921DF18-F3A1-4EDC-90DA-20E85D94685C - /Users/mandel/Library/Logs/CoreSimulator/A921DF18-F3A1-4EDC-90DA-20E85D94685C - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-6 - /Users/mandel/Library/Developer/CoreSimulator/Devices/62992D4C-C669-4C51-AAD4-1877891EC26B - /Users/mandel/Library/Logs/CoreSimulator/62992D4C-C669-4C51-AAD4-1877891EC26B - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-6s - /Users/mandel/Library/Developer/CoreSimulator/Devices/5C41C297-EDF4-4D97-804C-4186843CAC71 - /Users/mandel/Library/Logs/CoreSimulator/5C41C297-EDF4-4D97-804C-4186843CAC71 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/619E6E2A-1B6E-42AC-93A5-2EE548689274 - /Users/mandel/Library/Logs/CoreSimulator/619E6E2A-1B6E-42AC-93A5-2EE548689274 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-SE - /Users/mandel/Library/Developer/CoreSimulator/Devices/B239B550-AB0B-416C-987B-9AD8A856D429 - /Users/mandel/Library/Logs/CoreSimulator/B239B550-AB0B-416C-987B-9AD8A856D429 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-7 - /Users/mandel/Library/Developer/CoreSimulator/Devices/216D7E4C-679F-4E57-9680-805930EA9D1E - /Users/mandel/Library/Logs/CoreSimulator/216D7E4C-679F-4E57-9680-805930EA9D1E - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/71AFDC06-B30E-4B2D-BF63-0EDDA0A62063 - /Users/mandel/Library/Logs/CoreSimulator/71AFDC06-B30E-4B2D-BF63-0EDDA0A62063 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Air - /Users/mandel/Library/Developer/CoreSimulator/Devices/8C322CFC-A086-454E-BCA6-2BFC86E60B5E - /Users/mandel/Library/Logs/CoreSimulator/8C322CFC-A086-454E-BCA6-2BFC86E60B5E - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 - /Users/mandel/Library/Developer/CoreSimulator/Devices/FD05BCC6-2FE6-4F06-B954-5C835D10F14A - /Users/mandel/Library/Logs/CoreSimulator/FD05BCC6-2FE6-4F06-B954-5C835D10F14A - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/0D858881-E7D8-47CE-A972-CB93727A1184 - /Users/mandel/Library/Logs/CoreSimulator/0D858881-E7D8-47CE-A972-CB93727A1184 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro - /Users/mandel/Library/Developer/CoreSimulator/Devices/C5DF41A6-4AB2-4427-B4C3-504D59D1D6A2 - /Users/mandel/Library/Logs/CoreSimulator/C5DF41A6-4AB2-4427-B4C3-504D59D1D6A2 - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/19086AC5-F933-43BD-AEA6-1C1D0737E3DB - /Users/mandel/Library/Logs/CoreSimulator/19086AC5-F933-43BD-AEA6-1C1D0737E3DB - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/1688E430-E910-46EC-980C-A281C8BA8AAE - /Users/mandel/Library/Logs/CoreSimulator/1688E430-E910-46EC-980C-A281C8BA8AAE - - - com.apple.CoreSimulator.SimRuntime.iOS-10-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/356B263C-8516-4F3B-BBF1-CA23FA5478E6 - /Users/mandel/Library/Logs/CoreSimulator/356B263C-8516-4F3B-BBF1-CA23FA5478E6 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-5s - /Users/mandel/Library/Developer/CoreSimulator/Devices/711BA51B-6261-4394-84A6-BE9F8B5D3B80 - /Users/mandel/Library/Logs/CoreSimulator/711BA51B-6261-4394-84A6-BE9F8B5D3B80 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/1D4E284E-E1F7-48BE-9975-E90C47A39B7C - /Users/mandel/Library/Logs/CoreSimulator/1D4E284E-E1F7-48BE-9975-E90C47A39B7C - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-6 - /Users/mandel/Library/Developer/CoreSimulator/Devices/0FE1F639-BE0D-42A8-BAE9-09D8656051D4 - /Users/mandel/Library/Logs/CoreSimulator/0FE1F639-BE0D-42A8-BAE9-09D8656051D4 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-6s - /Users/mandel/Library/Developer/CoreSimulator/Devices/08ED135B-B33B-439E-B188-2F84C1B478FC - /Users/mandel/Library/Logs/CoreSimulator/08ED135B-B33B-439E-B188-2F84C1B478FC - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/96A46A7E-0F6E-4627-A309-9306111A1B33 - /Users/mandel/Library/Logs/CoreSimulator/96A46A7E-0F6E-4627-A309-9306111A1B33 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-SE - /Users/mandel/Library/Developer/CoreSimulator/Devices/04DF2D48-4442-46EE-B3BE-695E403136C5 - /Users/mandel/Library/Logs/CoreSimulator/04DF2D48-4442-46EE-B3BE-695E403136C5 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-7 - /Users/mandel/Library/Developer/CoreSimulator/Devices/79AB7EDF-3FCB-4D2C-A390-7BB5936736B4 - /Users/mandel/Library/Logs/CoreSimulator/79AB7EDF-3FCB-4D2C-A390-7BB5936736B4 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-7-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/204656B8-0240-43FE-BF99-3B0F284FFB3C - /Users/mandel/Library/Logs/CoreSimulator/204656B8-0240-43FE-BF99-3B0F284FFB3C - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-8 - /Users/mandel/Library/Developer/CoreSimulator/Devices/FFFC5F6C-49EE-4796-8881-3416AE5F4708 - /Users/mandel/Library/Logs/CoreSimulator/FFFC5F6C-49EE-4796-8881-3416AE5F4708 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/AD320A80-FF13-4D28-8346-7962005732B0 - /Users/mandel/Library/Logs/CoreSimulator/AD320A80-FF13-4D28-8346-7962005732B0 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-X - /Users/mandel/Library/Developer/CoreSimulator/Devices/2FD14929-A33B-4690-86CD-42716A4DF2ED - /Users/mandel/Library/Logs/CoreSimulator/2FD14929-A33B-4690-86CD-42716A4DF2ED - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-XS - /Users/mandel/Library/Developer/CoreSimulator/Devices/E9914E48-7A63-493D-B7AA-D7AD90F0E312 - /Users/mandel/Library/Logs/CoreSimulator/E9914E48-7A63-493D-B7AA-D7AD90F0E312 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-XS-Max - /Users/mandel/Library/Developer/CoreSimulator/Devices/FA0C5B13-CC3F-4044-8E7E-48100375A340 - /Users/mandel/Library/Logs/CoreSimulator/FA0C5B13-CC3F-4044-8E7E-48100375A340 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPhone-XR - /Users/mandel/Library/Developer/CoreSimulator/Devices/BB062731-8AA4-4A3A-A2A6-D032FC41F3B9 - /Users/mandel/Library/Logs/CoreSimulator/BB062731-8AA4-4A3A-A2A6-D032FC41F3B9 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Air - /Users/mandel/Library/Developer/CoreSimulator/Devices/9E8F8D70-7180-495B-853C-D51871E9F102 - /Users/mandel/Library/Logs/CoreSimulator/9E8F8D70-7180-495B-853C-D51871E9F102 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 - /Users/mandel/Library/Developer/CoreSimulator/Devices/4505497B-509A-4246-987D-119064149BF6 - /Users/mandel/Library/Logs/CoreSimulator/4505497B-509A-4246-987D-119064149BF6 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/09D14A0A-4683-4E42-98A2-AB53310F197A - /Users/mandel/Library/Logs/CoreSimulator/09D14A0A-4683-4E42-98A2-AB53310F197A - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro - /Users/mandel/Library/Developer/CoreSimulator/Devices/1544537F-FDC8-40C9-AC08-A09FC4DD24B6 - /Users/mandel/Library/Logs/CoreSimulator/1544537F-FDC8-40C9-AC08-A09FC4DD24B6 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad--5th-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/A83C8C66-A7CF-46FD-8E4B-3A87FD2FF5A4 - /Users/mandel/Library/Logs/CoreSimulator/A83C8C66-A7CF-46FD-8E4B-3A87FD2FF5A4 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---2nd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/257CA31A-CC5A-4C5C-B072-0D3A3D0A9451 - /Users/mandel/Library/Logs/CoreSimulator/257CA31A-CC5A-4C5C-B072-0D3A3D0A9451 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--10-5-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/C006BEA4-CEDF-46E2-959C-96B8C9E6B6BA - /Users/mandel/Library/Logs/CoreSimulator/C006BEA4-CEDF-46E2-959C-96B8C9E6B6BA - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad--6th-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/43F3F691-8B57-47D6-898B-B2AAFCA53BFA - /Users/mandel/Library/Logs/CoreSimulator/43F3F691-8B57-47D6-898B-B2AAFCA53BFA - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/3DF2CFFC-C279-485D-8379-CC50C2297EDD - /Users/mandel/Library/Logs/CoreSimulator/3DF2CFFC-C279-485D-8379-CC50C2297EDD - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/4F2E05BB-4945-445E-99E7-D81D4F83E248 - /Users/mandel/Library/Logs/CoreSimulator/4F2E05BB-4945-445E-99E7-D81D4F83E248 - - - com.apple.CoreSimulator.SimRuntime.iOS-12-2 - com.apple.CoreSimulator.SimDeviceType.iPad-Air--3rd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/02177DD5-3EE1-4A8D-8277-BE95F4ACB1A5 - /Users/mandel/Library/Logs/CoreSimulator/02177DD5-3EE1-4A8D-8277-BE95F4ACB1A5 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-8 - /Users/mandel/Library/Developer/CoreSimulator/Devices/CFD33BF1-FC9A-4674-BB49-80CFA47450A5 - /Users/mandel/Library/Logs/CoreSimulator/CFD33BF1-FC9A-4674-BB49-80CFA47450A5 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus - /Users/mandel/Library/Developer/CoreSimulator/Devices/9D61D008-5A27-4B98-801A-0709897EA981 - /Users/mandel/Library/Logs/CoreSimulator/9D61D008-5A27-4B98-801A-0709897EA981 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-X - /Users/mandel/Library/Developer/CoreSimulator/Devices/18F485DC-7F0A-440F-BEF9-5BE5954B0FB1 - /Users/mandel/Library/Logs/CoreSimulator/18F485DC-7F0A-440F-BEF9-5BE5954B0FB1 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-11 - /Users/mandel/Library/Developer/CoreSimulator/Devices/ABC2A44A-789D-4C8B-88A7-0CD7C6BF316C - /Users/mandel/Library/Logs/CoreSimulator/ABC2A44A-789D-4C8B-88A7-0CD7C6BF316C - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro - /Users/mandel/Library/Developer/CoreSimulator/Devices/1840A231-2033-42A6-AEB4-B223235A2707 - /Users/mandel/Library/Logs/CoreSimulator/1840A231-2033-42A6-AEB4-B223235A2707 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPhone-11-Pro-Max - /Users/mandel/Library/Developer/CoreSimulator/Devices/FB4347FF-11B6-4487-BECC-0B556BAD3E89 - /Users/mandel/Library/Logs/CoreSimulator/FB4347FF-11B6-4487-BECC-0B556BAD3E89 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--9-7-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/972FB6FB-6BC5-4FD8-B8FB-BC4B08DAC817 - /Users/mandel/Library/Logs/CoreSimulator/972FB6FB-6BC5-4FD8-B8FB-BC4B08DAC817 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPad--7th-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/C519CBBA-AAAD-4777-B599-8A30085AABCB - /Users/mandel/Library/Logs/CoreSimulator/C519CBBA-AAAD-4777-B599-8A30085AABCB - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--11-inch- - /Users/mandel/Library/Developer/CoreSimulator/Devices/F7FCC57E-97CA-410F-B759-DFB395F0062C - /Users/mandel/Library/Logs/CoreSimulator/F7FCC57E-97CA-410F-B759-DFB395F0062C - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Pro--12-9-inch---3rd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/80096DEA-A0BC-4755-8AB4-F941B6DD7438 - /Users/mandel/Library/Logs/CoreSimulator/80096DEA-A0BC-4755-8AB4-F941B6DD7438 - - - com.apple.CoreSimulator.SimRuntime.iOS-13-3 - com.apple.CoreSimulator.SimDeviceType.iPad-Air--3rd-generation- - /Users/mandel/Library/Developer/CoreSimulator/Devices/8094F147-86A1-4196-BFB9-040BAC65B9BF - /Users/mandel/Library/Logs/CoreSimulator/8094F147-86A1-4196-BFB9-040BAC65B9BF - - - com.apple.CoreSimulator.SimRuntime.tvOS-10-2 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p - /Users/mandel/Library/Developer/CoreSimulator/Devices/FC0AD7D8-40E1-4BEC-BC84-ECE1796E3B10 - /Users/mandel/Library/Logs/CoreSimulator/FC0AD7D8-40E1-4BEC-BC84-ECE1796E3B10 - - - com.apple.CoreSimulator.SimRuntime.tvOS-12-2 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p - /Users/mandel/Library/Developer/CoreSimulator/Devices/62179381-3483-41F2-ABD2-7C69E46B2C3C - /Users/mandel/Library/Logs/CoreSimulator/62179381-3483-41F2-ABD2-7C69E46B2C3C - - - com.apple.CoreSimulator.SimRuntime.tvOS-12-2 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K - /Users/mandel/Library/Developer/CoreSimulator/Devices/C10D4992-1C46-474D-871B-B89D0817CFB4 - /Users/mandel/Library/Logs/CoreSimulator/C10D4992-1C46-474D-871B-B89D0817CFB4 - - - com.apple.CoreSimulator.SimRuntime.tvOS-12-2 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p - /Users/mandel/Library/Developer/CoreSimulator/Devices/73EAFA5D-04C7-4194-8D51-6E32C913C3B6 - /Users/mandel/Library/Logs/CoreSimulator/73EAFA5D-04C7-4194-8D51-6E32C913C3B6 - - - com.apple.CoreSimulator.SimRuntime.tvOS-13-3 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-1080p - /Users/mandel/Library/Developer/CoreSimulator/Devices/3A12BAFF-0DAA-4052-AB0D-743AB85CE030 - /Users/mandel/Library/Logs/CoreSimulator/3A12BAFF-0DAA-4052-AB0D-743AB85CE030 - - - com.apple.CoreSimulator.SimRuntime.tvOS-13-3 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-4K - /Users/mandel/Library/Developer/CoreSimulator/Devices/FD2A3BE2-3E95-473E-99D2-DF0733F1CEED - /Users/mandel/Library/Logs/CoreSimulator/FD2A3BE2-3E95-473E-99D2-DF0733F1CEED - - - com.apple.CoreSimulator.SimRuntime.tvOS-13-3 - com.apple.CoreSimulator.SimDeviceType.Apple-TV-4K-1080p - /Users/mandel/Library/Developer/CoreSimulator/Devices/2599FF00-17DD-43F7-BFC4-90693C145398 - /Users/mandel/Library/Logs/CoreSimulator/2599FF00-17DD-43F7-BFC4-90693C145398 - - - com.apple.CoreSimulator.SimRuntime.watchOS-3-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/F00FA51A-D353-4DD0-9631-FBAE0CE79D0F - /Users/mandel/Library/Logs/CoreSimulator/F00FA51A-D353-4DD0-9631-FBAE0CE79D0F - - - com.apple.CoreSimulator.SimRuntime.watchOS-3-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-42mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/7E4D7EC2-45C3-41A5-A7CD-78BE9610E02B - /Users/mandel/Library/Logs/CoreSimulator/7E4D7EC2-45C3-41A5-A7CD-78BE9610E02B - - - com.apple.CoreSimulator.SimRuntime.watchOS-3-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/7209E5D6-9F1B-4067-96D7-342D403CD805 - /Users/mandel/Library/Logs/CoreSimulator/7209E5D6-9F1B-4067-96D7-342D403CD805 - - - com.apple.CoreSimulator.SimRuntime.watchOS-3-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/7BDF181F-3D32-4ECB-B2D6-0D73353DD0AB - /Users/mandel/Library/Logs/CoreSimulator/7BDF181F-3D32-4ECB-B2D6-0D73353DD0AB - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/99F89C62-A028-4752-96D3-5E57CDAEDA22 - /Users/mandel/Library/Logs/CoreSimulator/99F89C62-A028-4752-96D3-5E57CDAEDA22 - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-2-42mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/8DF7353A-CE2C-45E2-944D-FF12FBFBF24B - /Users/mandel/Library/Logs/CoreSimulator/8DF7353A-CE2C-45E2-944D-FF12FBFBF24B - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/3F577C08-9F99-4B9F-8EFC-CFF64B24DB51 - /Users/mandel/Library/Logs/CoreSimulator/3F577C08-9F99-4B9F-8EFC-CFF64B24DB51 - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-42mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/E26C48DB-9780-4342-84E2-783F4FF86286 - /Users/mandel/Library/Logs/CoreSimulator/E26C48DB-9780-4342-84E2-783F4FF86286 - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/121B2CE2-B036-4BB4-B54A-A03F5431091B - /Users/mandel/Library/Logs/CoreSimulator/121B2CE2-B036-4BB4-B54A-A03F5431091B - - - com.apple.CoreSimulator.SimRuntime.watchOS-5-2 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/7764F572-0B81-4353-9D19-AA5E358425C2 - /Users/mandel/Library/Logs/CoreSimulator/7764F572-0B81-4353-9D19-AA5E358425C2 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/BB2F9CF0-A928-4909-867A-525A937D7390 - /Users/mandel/Library/Logs/CoreSimulator/BB2F9CF0-A928-4909-867A-525A937D7390 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-3-38mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/D9FC8E35-8CD2-4E3F-A660-24CAF1304479 - /Users/mandel/Library/Logs/CoreSimulator/D9FC8E35-8CD2-4E3F-A660-24CAF1304479 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-40mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/8EC34527-72DB-4A4D-B268-79C838189492 - /Users/mandel/Library/Logs/CoreSimulator/8EC34527-72DB-4A4D-B268-79C838189492 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-4-44mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/CC509130-B1EC-4400-B2AB-730B602F7E03 - /Users/mandel/Library/Logs/CoreSimulator/CC509130-B1EC-4400-B2AB-730B602F7E03 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-40mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/9B798995-5A29-45E1-BF89-6D29BB2864D3 - /Users/mandel/Library/Logs/CoreSimulator/9B798995-5A29-45E1-BF89-6D29BB2864D3 - - - com.apple.CoreSimulator.SimRuntime.watchOS-6-1 - com.apple.CoreSimulator.SimDeviceType.Apple-Watch-Series-5-44mm - /Users/mandel/Library/Developer/CoreSimulator/Devices/77F07B96-D2E4-4F04-B958-B68E2FBCC2ED - /Users/mandel/Library/Logs/CoreSimulator/77F07B96-D2E4-4F04-B958-B68E2FBCC2ED - - - - - 62992D4C-C669-4C51-AAD4-1877891EC26B - F00FA51A-D353-4DD0-9631-FBAE0CE79D0F - - - 18F485DC-7F0A-440F-BEF9-5BE5954B0FB1 - BB2F9CF0-A928-4909-867A-525A937D7390 - - - 1840A231-2033-42A6-AEB4-B223235A2707 - 9B798995-5A29-45E1-BF89-6D29BB2864D3 - - - FB4347FF-11B6-4487-BECC-0B556BAD3E89 - 77F07B96-D2E4-4F04-B958-B68E2FBCC2ED - - - - \ No newline at end of file diff --git a/tests/xharness/Xharness.Tests/Samples/xUnitSample.xml b/tests/xharness/Xharness.Tests/Samples/xUnitSample.xml deleted file mode 100644 index b8603de904a5..000000000000 --- a/tests/xharness/Xharness.Tests/Samples/xUnitSample.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/xharness/Xharness.Tests/TestImporter/Templates/Tests/PListExtensionsTests.cs b/tests/xharness/Xharness.Tests/TestImporter/Templates/Tests/PListExtensionsTests.cs deleted file mode 100644 index 760cd57557e3..000000000000 --- a/tests/xharness/Xharness.Tests/TestImporter/Templates/Tests/PListExtensionsTests.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.IO; -using System.Linq; -using System.Text; -using System.Xml; -using Microsoft.DotNet.XHarness.iOS.Shared.Utilities; -using NUnit.Framework; - -namespace Xharness.Tests.TestImporter.Templates.Tests { - - public class PListExtensionsTests { - private XmlDocument plist; - - [SetUp] - public void SetUp () - { - plist = CreateResultSample (); - } - - /// - /// Creates a sample pList to be used with the tests and returns the temp file in which it was stored. - /// - /// The path where the sample plist can be found. - XmlDocument CreateResultSample () - { - var name = GetType ().Assembly.GetManifestResourceNames () - .FirstOrDefault (a => a.EndsWith ("Info.plist", StringComparison.Ordinal)); - var tempPath = Path.GetTempFileName (); - var byteOrderMarkUtf8 = Encoding.UTF8.GetString (Encoding.UTF8.GetPreamble ()); // I hate BOM - using var sampleStream = new StreamReader (GetType ().Assembly.GetManifestResourceStream (name)); - - // create the document with the plist and return it - var doc = new XmlDocument (); - var settings = new XmlReaderSettings () { - XmlResolver = null, - DtdProcessing = DtdProcessing.Parse, - }; - using var reader = XmlReader.Create (sampleStream, settings); - doc.Load (reader); - return doc; - } - - [Test] - public void SetMinimumOSVersion () - { - var version = "MyMinVersion"; - plist.SetMinimumOSVersion (version); - Assert.AreEqual (version, plist.GetMinimumOSVersion ()); - } - - [Test] - public void SetNullMinimumOSVersion () => Assert.Throws (() => plist.SetMinimumOSVersion (null)); - - [Test] - public void SetMinimummacOSVersion () - { - var version = "MyMaccMinVersion"; - plist.SetMinimummacOSVersion (version); - Assert.AreEqual (version, plist.GetMinimummacOSVersion ()); - } - - [Test] - public void SetNullMinimummacOSVersion () => Assert.Throws (() => plist.SetMinimummacOSVersion (null)); - - [Test] - public void SetCFBundleDisplayName () - { - var displayName = "MySuperApp"; - plist.SetCFBundleDisplayName (displayName); - Assert.AreEqual (displayName, plist.GetCFBundleDisplayName ()); - } - - [Test] - public void SetNullCFBundleDisplayName () => Assert.Throws (() => plist.SetCFBundleDisplayName (null)); - - [Test] - public void SetCFBundleIdentifier () - { - var bundleIdentifier = "my.company.super.app"; - plist.SetCFBundleIdentifier (bundleIdentifier); - Assert.AreEqual (bundleIdentifier, plist.GetCFBundleIdentifier ()); - } - - [Test] - public void SetNullCFBundleIdentifier () => Assert.Throws (() => plist.SetCFBundleIdentifier (null)); - - [Test] - public void SetCFBundleName () - { - var bundleName = "MySuper.app"; - plist.SetCFBundleName (bundleName); - Assert.AreEqual (bundleName, plist.GetCFBundleName ()); - } - - [Test] - public void SetNullCFBundleName () => Assert.Throws (() => plist.SetCFBundleName (null)); - } -} diff --git a/tests/xharness/Xharness.Tests/TestImporter/Tests/ProjectDefinitionTests.cs b/tests/xharness/Xharness.Tests/TestImporter/Tests/ProjectDefinitionTests.cs deleted file mode 100644 index e9428d82afe3..000000000000 --- a/tests/xharness/Xharness.Tests/TestImporter/Tests/ProjectDefinitionTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using Moq; -using NUnit.Framework; -using Xharness.TestImporter; - -namespace Xharness.Tests.TestImporter.Tests { - public class ProjectDefinitionTests { - - Mock assemblyLocator; - Mock factory; - - [SetUp] - public void SetUp () - { - assemblyLocator = new Mock (); - factory = new Mock (); - } - - [TearDown] - public void TearDown () - { - assemblyLocator = null; - } - - [Test] - public void GetTypeForAssembliesNullMonoPath () - { - var projectDefinition = new ProjectDefinition ("MyProject", assemblyLocator.Object, factory.Object, new List ()); - Assert.Throws (() => projectDefinition.GetTypeForAssemblies (null, Platform.iOS)); - } - } -} diff --git a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs deleted file mode 100644 index 98933167fb6d..000000000000 --- a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/AssemblyLocatorTest.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.IO; -using NUnit.Framework; -using Xharness.TestImporter; -using Xharness.TestImporter.Xamarin; - -namespace Xharness.Tests.TestImporter.Xamarin.Tests { - - // very simple class, but we want to make sure that iOS, tvOS get the iosDownload and the mac - // versions get the mac download - [TestFixture] - public class AssemblyLocatorTest { - - const string iOSPath = "/path/to/ios/download"; - const string macOSPath = "/path/to/mac/download"; - AssemblyLocator assemblyLocator = new AssemblyLocator { - iOSMonoSDKPath = iOSPath, - MacMonoSDKPath = macOSPath, - }; - - [TestCase (Platform.iOS, iOSPath)] - [TestCase (Platform.TvOS, iOSPath)] - public void GetAssembliesRootLocationTest (Platform platform, string expected) - => Assert.AreEqual (expected, assemblyLocator.GetAssembliesRootLocation (platform)); - } -} diff --git a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/TestAssemblyDefinitionTest.cs b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/TestAssemblyDefinitionTest.cs deleted file mode 100644 index 536261224452..000000000000 --- a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/TestAssemblyDefinitionTest.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using Moq; -using NUnit.Framework; -using Xharness.TestImporter; -using Xharness.TestImporter.Xamarin; - -namespace Xharness.Tests.TestImporter.Tests { - public class TestAssemblyDefinitionTest { - - Mock assemblyLocator; - - [SetUp] - public void SetUp () - { - assemblyLocator = new Mock (); - } - - [TearDown] - public void TearDown () - { - assemblyLocator = null; - } - - [Test] - public void GetPathNullMonoRoot () - { - var testAssemblyDefinition = new TestAssemblyDefinition ("monotouch_System.Json.Microsoft_test.dll", assemblyLocator.Object); - Assert.Throws (() => testAssemblyDefinition.GetPath (Platform.iOS)); - } - - [Test] - public void IsNotXUnit () - { - var testAssemblyDefinition = new TestAssemblyDefinition ("monotouch_System.Json.Microsoft_test.dll", assemblyLocator.Object); - Assert.False (testAssemblyDefinition.IsXUnit); - } - - [Test] - public void IsXUnit () - { - var testAssemblyDefinition = new TestAssemblyDefinition ("monotouch_System.Json.Microsoft_xunit-test.dll", assemblyLocator.Object); - Assert.True (testAssemblyDefinition.IsXUnit); - } - - } -} diff --git a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs b/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs deleted file mode 100644 index c58af8e9e845..000000000000 --- a/tests/xharness/Xharness.Tests/TestImporter/Xamarin/Tests/XamariniOSTemplateTest.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System.IO; -using System.Text; -using Moq; -using NUnit.Framework; -using Xharness.TestImporter; -using Xharness.TestImporter.Templates; -using Xharness.TestImporter.Templates.Managed; - -namespace Xharness.Tests.TestImporter.Xamarin.Tests { - - [TestFixture] - public class XamariniOSTemplateTest { - - string outputdir; - Mock assemlyLocator; - Mock projectFilter; - XamariniOSTemplate template; - - [SetUp] - public void SetUp () - { - outputdir = Path.GetTempFileName (); - File.Delete (outputdir); - Directory.CreateDirectory (outputdir); - assemlyLocator = new Mock (); - projectFilter = new Mock (); - template = new XamariniOSTemplate { - AssemblyLocator = assemlyLocator.Object, - ProjectFilter = projectFilter.Object, - OutputDirectoryPath = outputdir, - }; - } - - [TearDown] - public void TearDown () - { - if (Directory.Exists (outputdir)) - Directory.Delete (outputdir, true); - outputdir = null; - assemlyLocator = null; - projectFilter = null; - template = null; - } - [TestCase ("iOSProject", Platform.iOS, "iOSProject.csproj")] - [TestCase ("TvOSProject", Platform.TvOS, "TvOSProject-tvos.csproj")] - public void GetProjectPathTest (string projectName, Platform platform, string expectedName) - { - // ignore the fact that all params are the same, we do not care - var path = template.GetProjectPath (projectName, platform); - Assert.AreEqual (Path.Combine (template.OutputDirectoryPath, "generated", platform.ToString (), projectName, expectedName), path); - } - - [TestCase ("/usr/path", Platform.iOS, "Info.plist")] - [TestCase ("/usr/second/path", Platform.TvOS, "Info-tvos.plist")] - public void GetPListPathTest (string rootDir, Platform platform, string expectedName) - { - var path = XamariniOSTemplate.GetPListPath (rootDir, platform); - Assert.AreEqual (Path.Combine (rootDir, expectedName), path); - } - - [TestCase ("System.Xml.dll")] - [TestCase ("MyAssembly.dll")] - public void GetReferenceNodeNullHintTest (string assembly) - { - var expected = $""; - Assert.AreEqual (expected, XamariniOSTemplate.GetReferenceNode (assembly)); - } - - [TestCase ("System.Xml.dll", "my/path/to/the/dll")] - [TestCase ("MyAssembly.dll", "thepath")] - public void GetReferenceNodeTest (string assembly, string hint) - { - var fixedHint = hint.Replace ("/", "\\"); - var sb = new StringBuilder (); - sb.AppendLine ($""); - sb.AppendLine ($"{fixedHint}"); - sb.AppendLine (""); - var expected = sb.ToString (); - Assert.AreEqual (expected, XamariniOSTemplate.GetReferenceNode (assembly, hint)); - } - - [TestCase ("my/path/to/the/dll")] - [TestCase ("my/other/path/to/the/dll")] - public void GetRegisterTypeNodeTest (string registerPath) - { - var fixedPath = registerPath.Replace ("/", "\\"); - var sb = new StringBuilder (); - sb.AppendLine ($""); - sb.AppendLine ($"{Path.GetFileName (registerPath)}"); - sb.AppendLine (""); - var expected = sb.ToString (); - Assert.AreEqual (expected, XamariniOSTemplate.GetRegisterTypeNode (registerPath)); - } - - [TestCase ("/path/to/resource/my-ignore-file.ignore")] - [TestCase ("/path/to/mono/my-trait-file.txt")] - public void GetContentNodeTest (string contentFile) - { - var fixedPath = contentFile.Replace ("/", "\\"); - var sb = new StringBuilder (); - sb.AppendLine ($""); - sb.AppendLine ($"{Path.GetFileName (contentFile)}"); - sb.AppendLine ("PreserveNewest"); - sb.AppendLine (""); - var expected = sb.ToString (); - Assert.AreEqual (expected, XamariniOSTemplate.GetContentNode (contentFile)); - } - } -} diff --git a/tests/xharness/Xharness.Tests/Tests/AppRunnerTests.cs b/tests/xharness/Xharness.Tests/Tests/AppRunnerTests.cs deleted file mode 100644 index 0554c9791900..000000000000 --- a/tests/xharness/Xharness.Tests/Tests/AppRunnerTests.cs +++ /dev/null @@ -1,803 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.DotNet.XHarness.Common.CLI; -using Microsoft.DotNet.XHarness.Common.Execution; -using Microsoft.DotNet.XHarness.Common.Logging; -using Microsoft.DotNet.XHarness.Common.Utilities; -using Microsoft.DotNet.XHarness.iOS.Shared; -using Microsoft.DotNet.XHarness.iOS.Shared.Execution; -using Microsoft.DotNet.XHarness.iOS.Shared.Hardware; -using Microsoft.DotNet.XHarness.iOS.Shared.Listeners; -using Microsoft.DotNet.XHarness.iOS.Shared.Logging; -using Moq; -using NUnit.Framework; - -namespace Xharness.Tests { - [TestFixture] - public class AppRunnerTests { - - const string appName = "com.xamarin.bcltests.SystemXunit"; - const string xcodePath = "/path/to/xcode"; - const string mlaunchPath = "/path/to/mlaunch"; - const int listenerPort = 1020; - - static readonly string outputPath = Path.GetDirectoryName (Assembly.GetAssembly (typeof (AppRunnerTests)).Location); - static readonly string sampleProjectPath = Path.Combine (outputPath, "Samples", "TestProject"); - static readonly string appPath = Path.Combine (sampleProjectPath, "bin", appName + ".app"); - static readonly string projectFilePath = Path.Combine (sampleProjectPath, "SystemXunit.csproj"); - - static readonly IHardwareDevice [] mockDevices = new IHardwareDevice [] { - new Device( - buildVersion: "17A577", - deviceClass: DeviceClass.iPhone, - deviceIdentifier: "8A450AA31EA94191AD6B02455F377CC1", - interfaceType: "Usb", - isUsableForDebugging: true, - name: "Test iPhone", - productType: "iPhone12,1", - productVersion: "13.0" - ), - new Device( - buildVersion: "13G36", - deviceClass: DeviceClass.iPad, - deviceIdentifier: "E854B2C3E7C8451BAF8053EC4DAAEE49", - interfaceType: "Usb", - isUsableForDebugging: true, - name: "Test iPad", - productType: "iPad2,1", - productVersion: "9.3.5" - ) - }; - - Mock processManager; - Mock simulators; - Mock devices; - Mock simpleListener; - Mock snapshotReporter; - Mock logs; - Mock mainLog; - - ISimulatorLoaderFactory simulatorsFactory; - IDeviceLoaderFactory devicesFactory; - ISimpleListenerFactory listenerFactory; - ICrashSnapshotReporterFactory snapshotReporterFactory; - IAppBundleInformationParser appBundleInformationParser; - - [SetUp] - public void SetUp () - { - logs = new Mock (); - logs.SetupGet (x => x.Directory).Returns (Path.Combine (outputPath, "logs")); - - processManager = new Mock (); - simulators = new Mock (); - devices = new Mock (); - simpleListener = new Mock (); - snapshotReporter = new Mock (); - - var mock1 = new Mock (); - mock1.Setup (m => m.CreateLoader ()).Returns (simulators.Object); - simulatorsFactory = mock1.Object; - - var mock2 = new Mock (); - mock2.Setup (m => m.CreateLoader ()).Returns (devices.Object); - devicesFactory = mock2.Object; - - var mock3 = new Mock (); - mock3 - .Setup (m => m.Create (It.IsAny (), It.IsAny (), It.IsAny (), It.IsAny (), It.IsAny (), It.IsAny ())) - .Returns ((ListenerTransport.Tcp, simpleListener.Object, "listener-temp-file")); - listenerFactory = mock3.Object; - simpleListener.Setup (x => x.InitializeAndGetPort ()).Returns (listenerPort); - - var mock4 = new Mock (); - mock4.Setup (m => m.Create (It.IsAny (), It.IsAny (), It.IsAny (), It.IsAny ())).Returns (snapshotReporter.Object); - snapshotReporterFactory = mock4.Object; - - var mock5 = new Mock (); - mock5 - .Setup (x => x.ParseFromProject (It.IsAny (), It.IsAny (), It.IsAny ())) - .ReturnsAsync (new AppBundleInformation (appName, appName, appPath, appPath, true, null)); - - appBundleInformationParser = mock5.Object; - - mainLog = new Mock (); - - Directory.CreateDirectory (appPath); - } - - [TearDown] - public void TearDown () - { - Directory.Delete (appPath, true); - } - - [Test] - public void InitializeTest () - { - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Simulator_iOS64, - Mock.Of (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - Assert.AreEqual (appName, appRunner.AppInformation.AppName); - Assert.AreEqual (appPath, appRunner.AppInformation.AppPath); - Assert.AreEqual (appPath, appRunner.AppInformation.LaunchAppPath); - Assert.AreEqual (appName, appRunner.AppInformation.BundleIdentifier); - } - - [Test] - public void InstallToSimulatorTest () - { - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Simulator_iOS64, - Mock.Of (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - var exception = Assert.ThrowsAsync ( - async () => await appRunner.InstallAsync (new CancellationToken ()), - "Install should not be allowed on a simulator"); - } - - [Test] - public void UninstallToSimulatorTest () - { - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Simulator_iOS64, - Mock.Of (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - var exception = Assert.ThrowsAsync ( - async () => await appRunner.UninstallAsync (), - "Uninstall should not be allowed on a simulator"); - } - - [Test] - public void InstallWhenNoDevicesTest () - { - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Device_iOS, - Mock.Of (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - devices.Setup (x => x.ConnectedDevices).Returns (new IHardwareDevice [0]); - - Assert.ThrowsAsync ( - async () => await appRunner.InstallAsync (new CancellationToken ()), - "Install requires connected devices"); - } - - [Test] - public async Task InstallOnDeviceTest () - { - var harness = Mock.Of (x => x.Verbosity == 2); - - var processResult = new ProcessExecutionResult () { ExitCode = 1, TimedOut = false }; - processManager.SetReturnsDefault (Task.FromResult (processResult)); - - devices.Setup (d => d.FindDevice (It.IsAny (), It.IsAny (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [0]); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Device_iOS, - harness, - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - CancellationToken cancellationToken = new CancellationToken (); - var result = await appRunner.InstallAsync (cancellationToken); - - // Verify - Assert.AreEqual (1, result.ExitCode); - - var expectedArgs = $"-v -v -v --installdev {StringUtils.FormatArguments (appPath)} --devname \"{mockDevices [0].Name}\""; - - processManager.Verify (x => x.ExecuteCommandAsync ( - It.Is (args => args.AsCommandLine () == expectedArgs), - mainLog.Object, - TimeSpan.FromHours (1), - null, - 5, - cancellationToken)); - } - - [Test] - public async Task UninstallFromDeviceTest () - { - var harness = Mock.Of (x => x.Verbosity == 1); - - var processResult = new ProcessExecutionResult () { ExitCode = 3, TimedOut = false }; - processManager.SetReturnsDefault (Task.FromResult (processResult)); - - devices.Setup (d => d.FindDevice (It.IsAny (), It.IsAny (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - snapshotReporterFactory, - Mock.Of (), - Mock.Of (), - Mock.Of (), - TestTarget.Device_iOS, - harness, - mainLog.Object, - logs.Object, - projectFilePath: Path.Combine (sampleProjectPath, "SystemXunit.csproj"), - buildConfiguration: "Debug"); - appRunner.InitializeAsync ().Wait (); - - var result = await appRunner.UninstallAsync (); - - // Verify - Assert.AreEqual (3, result.ExitCode); - - var expectedArgs = $"-v -v --uninstalldevbundleid {StringUtils.FormatArguments (appName)} --devname \"Test iPad\""; - - processManager.Verify (x => x.ExecuteCommandAsync ( - It.Is (args => args.AsCommandLine () == expectedArgs), - mainLog.Object, - TimeSpan.FromMinutes (1), - null, - 5, - null)); - } - - [Test] - public async Task RunOnSimulatorWithNoAvailableSimulatorTest () - { - devices.Setup (x => x.ConnectedDevices).Returns (mockDevices.Reverse ()); - - // Crash reporter - var crashReporterFactory = new Mock (); - crashReporterFactory - .Setup (x => x.Create (mainLog.Object, It.IsAny (), false, null)) - .Returns (snapshotReporter.Object); - - // Mock finding simulators - simulators - .Setup (x => x.LoadDevices (It.IsAny (), false, false, false, true, CancellationToken.None)) - .Returns (Task.FromResult (true)); - - string simulatorLogPath = Path.Combine (Path.GetTempPath (), "simulator-logs"); - - simulators - .Setup (x => x.FindSimulators (TestTarget.Simulator_tvOS, mainLog.Object, true, false, CancellationToken.None)) - .ReturnsAsync ((null, null)); - - var listenerLogFile = new Mock (); - - logs - .Setup (x => x.Create (It.IsAny (), "TestLog", It.IsAny ())) - .Returns (listenerLogFile.Object); - - simpleListener.SetupGet (x => x.ConnectedTask).Returns (Task.FromResult (true)); - - var captureLog = new Mock (); - captureLog.SetupGet (x => x.FullPath).Returns (simulatorLogPath); - - var captureLogFactory = new Mock (); - captureLogFactory - .Setup (x => x.Create ( - Path.Combine (logs.Object.Directory, "tvos.log"), - "/path/to/simulator.log", - true, - It.IsAny ())) - .Returns (captureLog.Object); - var testReporterFactory = new Mock (); - var testReporter = new Mock (); - testReporterFactory.SetReturnsDefault (testReporter.Object); - testReporter.Setup (r => r.ParseResult ()).Returns (() => { - return Task.FromResult<(TestExecutingResult, string)> ((TestExecutingResult.Succeeded, null)); - }); - testReporter.Setup (r => r.Success).Returns (true); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - crashReporterFactory.Object, - captureLogFactory.Object, - Mock.Of (), - testReporterFactory.Object, - TestTarget.Simulator_tvOS, - GetMockedHarness (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug", - timeoutMultiplier: 2); - appRunner.InitializeAsync ().Wait (); - - var result = await appRunner.RunAsync (); - - // Verify - Assert.AreEqual (1, result); - - mainLog.Verify (x => x.WriteLine ("Test run completed"), Times.Never); - - simpleListener.Verify (x => x.InitializeAndGetPort (), Times.AtLeastOnce); - simpleListener.Verify (x => x.StartAsync (), Times.AtLeastOnce); - - simulators.VerifyAll (); - } - - [Test] - public async Task RunOnSimulatorSuccessfullyTest () - { - var harness = GetMockedHarness (); - - devices.Setup (x => x.ConnectedDevices).Returns (mockDevices.Reverse ()); - - // Crash reporter - var crashReporterFactory = new Mock (); - crashReporterFactory - .Setup (x => x.Create (mainLog.Object, It.IsAny (), false, null)) - .Returns (snapshotReporter.Object); - - // Mock finding simulators - simulators - .Setup (x => x.LoadDevices (It.IsAny (), false, false, false, true, CancellationToken.None)) - .Returns (Task.FromResult (true)); - - string simulatorLogPath = Path.Combine (Path.GetTempPath (), "simulator-logs"); - - var simulator = new Mock (); - simulator.SetupGet (x => x.Name).Returns ("Test iPhone simulator"); - simulator.SetupGet (x => x.UDID).Returns ("58F21118E4D34FD69EAB7860BB9B38A0"); - simulator.SetupGet (x => x.LogPath).Returns (simulatorLogPath); - simulator.SetupGet (x => x.SystemLog).Returns (Path.Combine (simulatorLogPath, "system.log")); - - simulators - .Setup (x => x.FindSimulators (TestTarget.Simulator_iOS64, mainLog.Object, true, false, CancellationToken.None)) - .ReturnsAsync ((simulator.Object, null)); - - var testResultFilePath = Path.GetTempFileName (); - var listenerLogFile = Mock.Of (x => x.FullPath == testResultFilePath); - File.WriteAllLines (testResultFilePath, new [] { "Some result here", "Tests run: 124", "Some result there" }); - - logs - .Setup (x => x.Create (It.IsAny (), It.IsAny (), It.IsAny ())) - .Returns (listenerLogFile); - - logs - .Setup (x => x.CreateFile (It.IsAny (), It.IsAny ())) - .Returns ($"/path/to/log-{Guid.NewGuid ()}.log"); - - simpleListener.SetupGet (x => x.ConnectedTask).Returns (Task.FromResult (true)); - - var captureLog = new Mock (); - captureLog.SetupGet (x => x.FullPath).Returns (simulatorLogPath); - - var captureLogFactory = new Mock (); - captureLogFactory - .Setup (x => x.Create ( - Path.Combine (logs.Object.Directory, simulator.Object.Name + ".log"), - simulator.Object.SystemLog, - true, - It.IsAny ())) - .Returns (captureLog.Object); - - var expectedArgs = $"--sdkroot {StringUtils.FormatArguments (xcodePath)} -v -v " + - $"-argument=-connection-mode -argument=none -argument=-app-arg:-autostart " + - $"-setenv=NUNIT_AUTOSTART=true -argument=-app-arg:-autoexit -setenv=NUNIT_AUTOEXIT=true " + - $"-argument=-app-arg:-enablenetwork -setenv=NUNIT_ENABLE_NETWORK=true " + - $"-setenv=DISABLE_SYSTEM_PERMISSION_TESTS=1 -argument=-app-arg:-hostname:127.0.0.1 " + - $"-setenv=NUNIT_HOSTNAME=127.0.0.1 -argument=-app-arg:-transport:Tcp -setenv=NUNIT_TRANSPORT=TCP " + - $"-argument=-app-arg:-hostport:{listenerPort} -setenv=NUNIT_HOSTPORT={listenerPort} " + - $"-setenv=env1=value1 -setenv=env2=value2 --launchsim {StringUtils.FormatArguments (appPath)} " + - $"--stdout=tty1 --stderr=tty1 --device=:v2:udid={simulator.Object.UDID}"; - - processManager - .Setup (x => x.ExecuteCommandAsync ( - It.Is (args => args.AsCommandLine () == expectedArgs), - mainLog.Object, - TimeSpan.FromMinutes (harness.Timeout * 2), - null, - 5, - It.IsAny ())) - .ReturnsAsync (new ProcessExecutionResult () { ExitCode = 0 }); - - var xmlResultFile = Path.ChangeExtension (testResultFilePath, "xml"); - var testReporterFactory = new Mock (); - var testReporter = new Mock (); - testReporterFactory.SetReturnsDefault (testReporter.Object); - testReporter.Setup (r => r.ParseResult ()).Returns (() => { - return Task.FromResult<(TestExecutingResult, string)> ((TestExecutingResult.Succeeded, null)); - }); - testReporter.Setup (r => r.Success).Returns (true); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - crashReporterFactory.Object, - captureLogFactory.Object, - Mock.Of (), // Use for devices only - testReporterFactory.Object, - TestTarget.Simulator_iOS64, - harness, - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug", - timeoutMultiplier: 2, - ensureCleanSimulatorState: true); - appRunner.InitializeAsync ().Wait (); - - var result = await appRunner.RunAsync (); - - // Verify - Assert.AreEqual (0, result); - - simpleListener.Verify (x => x.InitializeAndGetPort (), Times.AtLeastOnce); - simpleListener.Verify (x => x.StartAsync (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Cancel (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Dispose (), Times.AtLeastOnce); - - simulators.VerifyAll (); - - captureLog.Verify (x => x.StartCapture (), Times.AtLeastOnce); - captureLog.Verify (x => x.StopCapture (null), Times.AtLeastOnce); - - // When ensureCleanSimulatorState == true - simulator.Verify (x => x.PrepareSimulator (It.IsAny (), appName)); - simulator.Verify (x => x.KillEverything (mainLog.Object)); - } - - [Test] - public void RunOnDeviceWithNoAvailableSimulatorTest () - { - devices.Setup (d => d.FindDevice (It.IsAny (), It.IsAny (), false, false, CancellationToken.None)).ReturnsAsync ((IHardwareDevice) null); - simulators - .Setup (s => s.FindSimulators (It.IsAny (), It.IsAny (), true, false, CancellationToken.None)) - .ReturnsAsync ((null, null)); - - // Crash reporter - var crashReporterFactory = new Mock (); - crashReporterFactory - .Setup (x => x.Create (mainLog.Object, It.IsAny (), false, null)) - .Returns (snapshotReporter.Object); - - var listenerLogFile = new Mock (); - var testReporterFactory = new Mock (); - var testReporter = new Mock (); - testReporterFactory.SetReturnsDefault (testReporter.Object); - testReporter.Setup (r => r.ParseResult ()).Returns (() => { - return Task.FromResult<(TestExecutingResult, string)> ((TestExecutingResult.Succeeded, null)); - }); - testReporter.Setup (r => r.Success).Returns (true); - - logs - .Setup (x => x.Create (It.IsAny (), "TestLog", It.IsAny ())) - .Returns (listenerLogFile.Object); - - simpleListener.SetupGet (x => x.ConnectedTask).Returns (Task.FromResult (true)); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - crashReporterFactory.Object, - Mock.Of (), - Mock.Of (), - testReporterFactory.Object, - TestTarget.Device_tvOS, - GetMockedHarness (), - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug", - timeoutMultiplier: 2); - appRunner.InitializeAsync ().Wait (); - - Assert.ThrowsAsync ( - async () => await appRunner.RunAsync (), - "Running requires connected devices"); - } - - [Test] - public async Task RunOnDeviceSuccessfullyTest () - { - var harness = GetMockedHarness (); - - devices.Setup (d => d.FindDevice (It.IsAny (), It.IsAny (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]); - - // Crash reporter - var crashReporterFactory = new Mock (); - crashReporterFactory - .Setup (x => x.Create (mainLog.Object, It.IsAny (), true, "Test iPad")) - .Returns (snapshotReporter.Object); - - var deviceSystemLog = new Mock (); - deviceSystemLog.SetupGet (x => x.FullPath).Returns (Path.GetTempFileName ()); - - var testResultFilePath = Path.GetTempFileName (); - var listenerLogFile = Mock.Of (x => x.FullPath == testResultFilePath); - File.WriteAllLines (testResultFilePath, new [] { "Some result here", "Some result there", "Tests run: 3" }); - - logs - .Setup (x => x.Create (It.Is (s => s.StartsWith ("test-ios-")), "TestLog", It.IsAny ())) - .Returns (listenerLogFile); - - logs - .Setup (x => x.Create (It.Is (s => s.StartsWith ("device-Test iPad-")), "Device log", It.IsAny ())) - .Returns (deviceSystemLog.Object); - - simpleListener.SetupGet (x => x.ConnectedTask).Returns (Task.FromResult (true)); - - var deviceLogCapturer = new Mock (); - - var deviceLogCapturerFactory = new Mock (); - deviceLogCapturerFactory - .Setup (x => x.Create (mainLog.Object, deviceSystemLog.Object, "Test iPad")) - .Returns (deviceLogCapturer.Object); - - var ips = new StringBuilder (); - var ipAddresses = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()).AddressList; - for (int i = 0; i < ipAddresses.Length; i++) { - if (i > 0) - ips.Append (','); - ips.Append (ipAddresses [i].ToString ()); - } - - var expectedArgs = $"-v -v -argument=-connection-mode -argument=none " + - $"-argument=-app-arg:-autostart -setenv=NUNIT_AUTOSTART=true -argument=-app-arg:-autoexit " + - $"-setenv=NUNIT_AUTOEXIT=true -argument=-app-arg:-enablenetwork -setenv=NUNIT_ENABLE_NETWORK=true " + - $"-setenv=DISABLE_SYSTEM_PERMISSION_TESTS=1 -argument=-app-arg:-hostname:{ips} -setenv=NUNIT_HOSTNAME={ips} " + - $"-argument=-app-arg:-transport:Tcp -setenv=NUNIT_TRANSPORT=TCP -argument=-app-arg:-hostport:{listenerPort} " + - $"-setenv=NUNIT_HOSTPORT={listenerPort} -setenv=env1=value1 -setenv=env2=value2 " + - $"--launchdev {StringUtils.FormatArguments (appPath)} --disable-memory-limits --wait-for-exit --devname \"Test iPad\""; - - processManager - .Setup (x => x.ExecuteCommandAsync ( - It.Is (args => args.AsCommandLine () == expectedArgs), - It.IsAny (), - TimeSpan.FromMinutes (harness.Timeout * 2), - null, - 5, - It.IsAny ())) - .ReturnsAsync (new ProcessExecutionResult () { ExitCode = 0 }); - - var xmlResultFile = Path.ChangeExtension (testResultFilePath, "xml"); - var testReporterFactory = new Mock (); - var testReporter = new Mock (); - testReporterFactory.SetReturnsDefault (testReporter.Object); - testReporter.Setup (r => r.ParseResult ()).Returns (() => { - return Task.FromResult<(TestExecutingResult, string)> ((TestExecutingResult.Succeeded, null)); - }); - testReporter.Setup (r => r.Success).Returns (true); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - crashReporterFactory.Object, - Mock.Of (), // Used for simulators only - deviceLogCapturerFactory.Object, - testReporterFactory.Object, - TestTarget.Device_iOS, - harness, - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug", - timeoutMultiplier: 2); - appRunner.InitializeAsync ().Wait (); - - var result = await appRunner.RunAsync (); - - // Verify - Assert.AreEqual (0, result); - - processManager.VerifyAll (); - - simpleListener.Verify (x => x.InitializeAndGetPort (), Times.AtLeastOnce); - simpleListener.Verify (x => x.StartAsync (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Cancel (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Dispose (), Times.AtLeastOnce); - - snapshotReporter.Verify (x => x.StartCaptureAsync (), Times.AtLeastOnce); - snapshotReporter.Verify (x => x.StartCaptureAsync (), Times.AtLeastOnce); - - deviceSystemLog.Verify (x => x.Dispose (), Times.AtLeastOnce); - } - - [Test] - public async Task RunOnDeviceWithFailedTestsTest () - { - var harness = GetMockedHarness (); - - devices.Setup (d => d.FindDevice (It.IsAny (), It.IsAny (), false, false, CancellationToken.None)).ReturnsAsync (mockDevices [1]); - - // Crash reporter - var crashReporterFactory = new Mock (); - crashReporterFactory - .Setup (x => x.Create (mainLog.Object, It.IsAny (), true, "Test iPad")) - .Returns (snapshotReporter.Object); - - var deviceSystemLog = new Mock (); - deviceSystemLog.SetupGet (x => x.FullPath).Returns (Path.GetTempFileName ()); - - var testResultFilePath = Path.GetTempFileName (); - var listenerLogFile = Mock.Of (x => x.FullPath == testResultFilePath); - File.WriteAllLines (testResultFilePath, new [] { "Some result here", "[FAIL] This test failed", "Some result there", "Tests run: 3" }); - - logs - .Setup (x => x.Create (It.Is (s => s.StartsWith ("test-ios-")), "TestLog", It.IsAny ())) - .Returns (listenerLogFile); - - logs - .Setup (x => x.Create (It.Is (s => s.StartsWith ("device-Test iPad-")), "Device log", It.IsAny ())) - .Returns (deviceSystemLog.Object); - - simpleListener.SetupGet (x => x.ConnectedTask).Returns (Task.FromResult (true)); - - var deviceLogCapturer = new Mock (); - - var deviceLogCapturerFactory = new Mock (); - deviceLogCapturerFactory - .Setup (x => x.Create (mainLog.Object, deviceSystemLog.Object, "Test iPad")) - .Returns (deviceLogCapturer.Object); - - var ips = new StringBuilder (); - var ipAddresses = System.Net.Dns.GetHostEntry (System.Net.Dns.GetHostName ()).AddressList; - for (int i = 0; i < ipAddresses.Length; i++) { - if (i > 0) - ips.Append (','); - ips.Append (ipAddresses [i].ToString ()); - } - - var expectedArgs = $"-v -v -argument=-connection-mode -argument=none " + - $"-argument=-app-arg:-autostart -setenv=NUNIT_AUTOSTART=true -argument=-app-arg:-autoexit " + - $"-setenv=NUNIT_AUTOEXIT=true -argument=-app-arg:-enablenetwork -setenv=NUNIT_ENABLE_NETWORK=true " + - $"-setenv=DISABLE_SYSTEM_PERMISSION_TESTS=1 -argument=-app-arg:-hostname:{ips} -setenv=NUNIT_HOSTNAME={ips} " + - $"-argument=-app-arg:-transport:Tcp -setenv=NUNIT_TRANSPORT=TCP -argument=-app-arg:-hostport:{listenerPort} " + - $"-setenv=NUNIT_HOSTPORT={listenerPort} -setenv=env1=value1 -setenv=env2=value2 " + - $"--launchdev {StringUtils.FormatArguments (appPath)} --disable-memory-limits --wait-for-exit --devname \"Test iPad\""; - - processManager - .Setup (x => x.ExecuteCommandAsync ( - It.Is (args => args.AsCommandLine () == expectedArgs), - It.IsAny (), - TimeSpan.FromMinutes (harness.Timeout * 2), - null, - 5, - It.IsAny ())) - .ReturnsAsync (new ProcessExecutionResult () { ExitCode = 0 }); - - var xmlResultFile = Path.ChangeExtension (testResultFilePath, "xml"); - var testReporterFactory = new Mock (); - var testReporter = new Mock (); - testReporterFactory.SetReturnsDefault (testReporter.Object); - testReporter.Setup (r => r.ParseResult ()).Returns (() => { - return Task.FromResult<(TestExecutingResult, string)> ((TestExecutingResult.Failed, null)); - }); - testReporter.Setup (r => r.Success).Returns (false); - - // Act - var appRunner = new AppRunner (processManager.Object, - appBundleInformationParser, - simulatorsFactory, - listenerFactory, - devicesFactory, - crashReporterFactory.Object, - Mock.Of (), // Used for simulators only - deviceLogCapturerFactory.Object, - testReporterFactory.Object, - TestTarget.Device_iOS, - harness, - mainLog.Object, - logs.Object, - projectFilePath: projectFilePath, - buildConfiguration: "Debug", - timeoutMultiplier: 2); - appRunner.InitializeAsync ().Wait (); - - var result = await appRunner.RunAsync (); - - // Verify - Assert.AreEqual (1, result); - - processManager.VerifyAll (); - - simpleListener.Verify (x => x.InitializeAndGetPort (), Times.AtLeastOnce); - simpleListener.Verify (x => x.StartAsync (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Cancel (), Times.AtLeastOnce); - simpleListener.Verify (x => x.Dispose (), Times.AtLeastOnce); - - snapshotReporter.Verify (x => x.StartCaptureAsync (), Times.AtLeastOnce); - snapshotReporter.Verify (x => x.StartCaptureAsync (), Times.AtLeastOnce); - - deviceSystemLog.Verify (x => x.Dispose (), Times.AtLeastOnce); - } - - IHarness GetMockedHarness () - { - return Mock.Of (x => x.Action == HarnessAction.Run - && x.Verbosity == 1 - && x.HarnessLog == mainLog.Object - && x.InCI == false - && x.EnvironmentVariables == new Dictionary () { - { "env1", "value1" }, - { "env2", "value2" }, - } - && x.Timeout == 1d); - } - } -} diff --git a/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs b/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs deleted file mode 100644 index b9e49c859ec8..000000000000 --- a/tests/xharness/Xharness.Tests/Tests/TestPlatformExtensionsTests.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.Collections; -using Microsoft.DotNet.XHarness.iOS.Shared; -using NUnit.Framework; - -namespace Xharness.Tests.Tests { - - [TestFixture] - public class TestPlatformExtensionsTests { - - public class TestCasesData { - public static IEnumerable GetSimulatorTestCases { - get { - foreach (var platform in new [] { TestPlatform.iOS }) { - yield return new TestCaseData (platform).Returns ("iOS " + Xamarin.SdkVersions.MiniOSSimulator); - } - yield return new TestCaseData (TestPlatform.tvOS).Returns ("tvOS " + Xamarin.SdkVersions.MinTVOSSimulator); - } - } - - public static IEnumerable IsMacTestCases { - get { - - foreach (var platform in new [] { TestPlatform.None, - TestPlatform.All, - TestPlatform.iOS, - TestPlatform.tvOS }) { - yield return new TestCaseData (platform).Returns (false); - } - - foreach (var platform in new [] { TestPlatform.Mac }) { - yield return new TestCaseData (platform).Returns (true); - } - } - } - } - - [Test, TestCaseSource (typeof (TestCasesData), "GetSimulatorTestCases")] - public string GetSimulatorMinVersionTest (TestPlatform platform) - => platform.GetSimulatorMinVersion (); - - [Test, TestCaseSource (typeof (TestCasesData), "IsMacTestCases")] - public bool IsMacTest (TestPlatform platform) => platform.IsMac (); - - } - -} diff --git a/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs b/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs deleted file mode 100644 index 6ff560f46f9c..000000000000 --- a/tests/xharness/Xharness.Tests/Tests/TestTargetExtensionsTests.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections; -using Microsoft.DotNet.XHarness.iOS.Shared; -using NUnit.Framework; - -namespace Xharness.Tests.Tests { - - [TestFixture] - public class TestTargetExtensionsTests { - - [TestCase (TestPlatform.tvOS, new [] { TestTarget.Simulator_tvOS })] - public void GetAppRunnerTargetsTest (TestPlatform platform, TestTarget [] expectedTargets) - { - var targets = platform.GetTestTargetsForSimulator (); - Assert.AreEqual (expectedTargets.Length, targets.Length); - foreach (var t in expectedTargets) { - Assert.Contains (t, targets); - } - } - } -} diff --git a/tests/xharness/Xharness.Tests/Xharness.Tests.csproj b/tests/xharness/Xharness.Tests/Xharness.Tests.csproj deleted file mode 100644 index 904eaf9e99e4..000000000000 --- a/tests/xharness/Xharness.Tests/Xharness.Tests.csproj +++ /dev/null @@ -1,62 +0,0 @@ - - - - net$(BundledNETCoreAppTargetFrameworkVersion) - Xharness.Tests - Xharness.Tests - latest - false - Nullable - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - {e1f53f80-8399-499b-8017-c414b9cd263b} - xharness - - - - - - - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - diff --git a/tests/xharness/Xharness.Tests/app.config b/tests/xharness/Xharness.Tests/app.config deleted file mode 100644 index 2833cc4412da..000000000000 --- a/tests/xharness/Xharness.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tests/xharness/XmlDocumentExtensions.cs b/tests/xharness/XmlDocumentExtensions.cs index db1cec8eb345..9b4b962b2ee5 100644 --- a/tests/xharness/XmlDocumentExtensions.cs +++ b/tests/xharness/XmlDocumentExtensions.cs @@ -5,13 +5,13 @@ namespace Xharness { public static class XmlDocumentExtensions { - public static void Save (this XmlDocument doc, string path, IHarness harness) => + public static void Save (this XmlDocument doc, string path, Harness harness) => doc.Save (path, (level, message) => harness.Log (level, message)); public static void Save (this XmlDocument doc, string path, Action log) { if (!File.Exists (path)) { - Directory.CreateDirectory (Path.GetDirectoryName (path)); + Directory.CreateDirectory (Path.GetDirectoryName (path)!); doc.Save (path); log?.Invoke (1, $"Created {path}"); } else { diff --git a/tests/xharness/xharness.csproj b/tests/xharness/xharness.csproj index 5b160168cb37..03169bf8a1da 100644 --- a/tests/xharness/xharness.csproj +++ b/tests/xharness/xharness.csproj @@ -6,9 +6,8 @@ Xharness xharness latest - false Nullable - + enable false @@ -27,9 +26,6 @@ Project --verbose --jenkins --rootdir .. --label=skip-mac-tests,skip-ios-simulator-tests,skip-ios-msbuild-tests,skip-system-permission-tests,run-ios-device-tests,run-ios-extensions-tests --markdown-summary=../TestSummary.md - - - @@ -38,92 +34,23 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - StringUtils.cs + tools\common\StringUtils.cs - NullableAttributes.cs + tools\common\NullableAttributes.cs - Cache.cs + tests\mtouch\Cache.cs - ApplePlatform.cs + tools\common\ApplePlatform.cs - - ParseTrxFile.cs + tests\common\ParseTrxFile.cs - - - SdkVersions.cs + tools\common\SdkVersions.cs @@ -134,9 +61,4 @@ PreserveNewest - - - - - diff --git a/tests/xharness/xharness.slnx b/tests/xharness/xharness.slnx index e85b6d9eb2b2..b9a0957f809b 100644 --- a/tests/xharness/xharness.slnx +++ b/tests/xharness/xharness.slnx @@ -1,4 +1,3 @@ - diff --git a/tests/xtro-sharpie/api-annotations-dotnet/common-AppKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/common-AppKit.ignore index d8151a01de31..8151545229e9 100644 --- a/tests/xtro-sharpie/api-annotations-dotnet/common-AppKit.ignore +++ b/tests/xtro-sharpie/api-annotations-dotnet/common-AppKit.ignore @@ -4,7 +4,6 @@ ## unsorted -!unknown-field! item bound !missing-field! NSImageNameColumnViewTemplate not bound !missing-field! NSImageNameGoBackTemplate not bound !missing-field! NSImageNameGoForwardTemplate not bound diff --git a/tools/common/DerivedLinkContext.cs b/tools/common/DerivedLinkContext.cs index 35a39f09f125..8e679a69de81 100644 --- a/tools/common/DerivedLinkContext.cs +++ b/tools/common/DerivedLinkContext.cs @@ -48,6 +48,10 @@ public class DerivedLinkContext : LinkContext { // so we need a second dictionary Dictionary LinkedAwayTypeMap = new Dictionary (); + public bool DidRunApplyPreserveAttributeStep { get; set; } + public bool DidRunMarkForStaticRegistrarStep { get; set; } + public bool DidRunMarkNSObjectsStep { get; set; } + public DerivedLinkContext (LinkerConfiguration configuration, Application app) #if !LEGACY_TOOLS : base (configuration) diff --git a/tools/common/create-makefile-fragment.sh b/tools/common/create-makefile-fragment.sh index 2b398007b962..076245d65ca2 100755 --- a/tools/common/create-makefile-fragment.sh +++ b/tools/common/create-makefile-fragment.sh @@ -42,6 +42,11 @@ fi BUILD_EXECUTABLE="dotnet build" +if ! dotnet --version >& /dev/null; then + # if we don't have a working .NET version, then we can't do anything here. + exit 0 +fi + if test -z "$BUILD_VERBOSITY"; then BUILD_VERBOSITY=/verbosity:diag fi @@ -51,10 +56,14 @@ fi # ProjectFile variable) and writes all the project references (recursively) to # a file (the ReferenceListPath variable). ( -cp ProjectInspector.csproj "$PROJECT_DIR" -cd "$PROJECT_DIR" -$BUILD_EXECUTABLE ProjectInspector.csproj "/t:WriteProjectReferences" "/p:ProjectFile=$PROJECT_FILE" "/p:ReferenceListPath=$REFERENCES_PATH" $BUILD_VERBOSITY /nologo -rm -f ProjectInspector.csproj + function upon_exit () + { + rm -f "$PROJECT_DIR/ProjectInspector.csproj" + } + trap upon_exit EXIT + cp ProjectInspector.csproj "$PROJECT_DIR" + cd "$PROJECT_DIR" + $BUILD_EXECUTABLE ProjectInspector.csproj "/t:WriteProjectReferences" "/p:ProjectFile=$PROJECT_FILE" "/p:ReferenceListPath=$REFERENCES_PATH" $BUILD_VERBOSITY /nologo ) # Now we have a list of all the project referenced by the input project. The diff --git a/tools/devops/automation/build-pull-request.yml b/tools/devops/automation/build-pull-request.yml index 07a31fe1dd70..b6e7f76620cf 100644 --- a/tools/devops/automation/build-pull-request.yml +++ b/tools/devops/automation/build-pull-request.yml @@ -48,19 +48,7 @@ variables: - name: Packaging.EnableSBOMSigning value: false - -# only allow triggers from specific branches -trigger: - branches: - include: - - refs/heads/dev/* - - refs/heads/darc-* - - refs/heads/backport-pr-* - - refs/heads/lego/* - - refs/heads/locfiles/* - - refs/heads/copilot/* - - refs/heads/dependabot/* - - refs/heads/merge/* +trigger: none pr: autoCancel: true diff --git a/tools/devops/automation/templates/mac/build.yml b/tools/devops/automation/templates/mac/build.yml index fd4bcfacc0c4..a6c20308996f 100644 --- a/tools/devops/automation/templates/mac/build.yml +++ b/tools/devops/automation/templates/mac/build.yml @@ -219,6 +219,7 @@ steps: sourcePath: '$(BUILD_REPOSITORY_TITLE)/jenkins-results' detailedLog: true usePat: true + timeoutInMinutes: 30 continueOnError: true condition: succeededOrFailed() diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 0e925c2505b3..55f5d8d5a7be 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -191,6 +191,7 @@ steps: sourcePath: '$(BUILD_REPOSITORY_TITLE)/jenkins-results' detailedLog: true usePat: true + timeoutInMinutes: 30 continueOnError: true condition: succeededOrFailed() diff --git a/tools/devops/automation/templates/windows/build.yml b/tools/devops/automation/templates/windows/build.yml index a3ee0e1ed478..7145baec4ee5 100644 --- a/tools/devops/automation/templates/windows/build.yml +++ b/tools/devops/automation/templates/windows/build.yml @@ -353,6 +353,7 @@ steps: sourcePath: '$(BUILD_REPOSITORY_TITLE)/jenkins-results' detailedLog: true usePat: true + timeoutInMinutes: 30 continueOnError: true condition: succeededOrFailed() diff --git a/tools/dotnet-linker/AppBundleRewriter.cs b/tools/dotnet-linker/AppBundleRewriter.cs index e96fc999cfea..b2d8538ee74a 100644 --- a/tools/dotnet-linker/AppBundleRewriter.cs +++ b/tools/dotnet-linker/AppBundleRewriter.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Linq; +using System.Text; using Mono.Cecil; using Mono.Cecil.Cil; @@ -1257,6 +1258,14 @@ public void ClearCurrentAssembly () field_map.Clear (); } + CustomAttribute CreateAttribute (MethodReference constructor) + { + // For some reason the trimmer doesn't mark attribute constructors + // This is probably only needed when running as a custom linker step. + configuration.Context.Annotations.Mark (constructor.Resolve ()); + return new CustomAttribute (constructor); + } + // We only need to add dependency attributes if the target dependency is in a trimmed assembly, // otherwise the target dependency won't be trimmed away. bool IsAssemblyTrimmed (IMemberDefinition member) @@ -1272,7 +1281,7 @@ public bool AddDynamicDependencyAttribute (MethodDefinition addToMethod, MethodD return false; if (addToMethod.DeclaringType == dependsOn.DeclaringType) { - var attribute = new CustomAttribute (DynamicDependencyAttribute_ctor__String); + var attribute = CreateAttribute (DynamicDependencyAttribute_ctor__String); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_String, DocumentationComments.GetSignature (dependsOn))); return AddAttributeOnlyOnce (addToMethod, attribute); } else if (addToMethod.DeclaringType.Module == dependsOn.DeclaringType.Module) { @@ -1289,7 +1298,7 @@ public CustomAttribute CreateDynamicDependencyAttribute (string memberSignature, if (type.HasGenericParameters) return CreateDynamicDependencyAttribute (memberSignature, type, type.Module.Assembly); - var attribute = new CustomAttribute (DynamicDependencyAttribute_ctor__String_Type); + var attribute = CreateAttribute (DynamicDependencyAttribute_ctor__String_Type); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_String, memberSignature)); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_Type, type)); return attribute; @@ -1302,7 +1311,7 @@ public CustomAttribute CreateDynamicDependencyAttribute (string memberSignature, public CustomAttribute CreateDynamicDependencyAttribute (string memberSignature, string typeName, string assemblyName) { - var attribute = new CustomAttribute (DynamicDependencyAttribute_ctor__String_String_String); + var attribute = CreateAttribute (DynamicDependencyAttribute_ctor__String_String_String); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_String, memberSignature)); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_String, typeName)); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_String, assemblyName)); @@ -1311,7 +1320,7 @@ public CustomAttribute CreateDynamicDependencyAttribute (string memberSignature, public CustomAttribute CreateDynamicDependencyAttribute (DynamicallyAccessedMemberTypes memberTypes, TypeDefinition type) { - var attribute = new CustomAttribute (DynamicDependencyAttribute_ctor__DynamicallyAccessedMemberTypes_Type); + var attribute = CreateAttribute (DynamicDependencyAttribute_ctor__DynamicallyAccessedMemberTypes_Type); // typed as 'int' because that's how the linker expects it: https://github.com/dotnet/runtime/blob/3c5ad6c677b4a3d12bc6a776d654558cca2c36a9/src/tools/illink/src/linker/Linker/DynamicDependency.cs#L97 attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_Diagnostics_CodeAnalysis_DynamicallyAccessedMemberTypes, (int) memberTypes)); attribute.ConstructorArguments.Add (new CustomAttributeArgument (System_Type, type)); @@ -1384,7 +1393,7 @@ public bool AddAttributeToStaticConstructor (TypeDefinition onType, CustomAttrib return modified; } - MethodDefinition GetOrCreateStaticConstructor (TypeDefinition type, out bool modified) + public MethodDefinition GetOrCreateStaticConstructor (TypeDefinition type, out bool modified) { modified = false; @@ -1408,7 +1417,7 @@ MethodDefinition GetOrCreateStaticConstructor (TypeDefinition type, out bool mod /// The provider to which the attribute should be added. /// The attribute to add. /// Whether the attribute was added or not. - bool AddAttributeOnlyOnce (ICustomAttributeProvider provider, CustomAttribute attribute) + public bool AddAttributeOnlyOnce (ICustomAttributeProvider provider, CustomAttribute attribute) { if (provider.HasCustomAttributes) { foreach (var ca in provider.CustomAttributes) { @@ -1460,7 +1469,18 @@ bool AddAttributeOnlyOnce (ICustomAttributeProvider provider, CustomAttribute at } } provider.CustomAttributes.Add (attribute); + if (DebugAttributes) + Console.WriteLine ($"Added {attribute.RenderAttribute ()} to {provider}"); return true; } + + static bool? debug_attributes; + static bool DebugAttributes { + get { + if (!debug_attributes.HasValue) + debug_attributes = !string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("PRINT_ATTRIBUTES")); + return debug_attributes.Value; + } + } } } diff --git a/tools/dotnet-linker/ApplyPreserveAttributeBase.cs b/tools/dotnet-linker/ApplyPreserveAttributeBase.cs index 4b67b0195d1a..1d4bc9520977 100644 --- a/tools/dotnet-linker/ApplyPreserveAttributeBase.cs +++ b/tools/dotnet-linker/ApplyPreserveAttributeBase.cs @@ -1,167 +1,229 @@ // This is copied from https://github.com/mono/linker/blob/fa9ccbdaf6907c69ef1bb117906f8f012218d57f/src/tuner/Mono.Tuner/ApplyPreserveAttributeBase.cs // and modified to work without a Profile class. -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; + using System.Linq; -using System.Text; using Mono.Linker; using Mono.Linker.Steps; using Mono.Cecil; -using Mono.Cecil.Cil; - -using Xamarin.Bundler; -using Xamarin.Linker; -using Xamarin.Utils; +using Mono.Tuner; #nullable enable -namespace Mono.Tuner { +namespace Xamarin.Linker.Steps { - public abstract class ApplyPreserveAttributeBase : ConfigurationAwareSubStep { - - AppBundleRewriter? abr; - Queue deferredActions = new (); + public partial class ApplyPreserveAttribute : ConfigurationAwareSubStep, IApplyPreserveAttribute { + ApplyPreserveAttributeImpl impl; protected override string Name { get => "Apply Preserve Attribute"; } protected override int ErrorCode { get => 2450; } - // set 'removeAttribute' to true if you want the preserved attribute to be removed from the final assembly - protected abstract bool IsPreservedAttribute (ICustomAttributeProvider provider, CustomAttribute attribute, out bool removeAttribute); - public override SubStepTargets Targets => SubStepTargets.Assembly; - public override void Initialize (LinkContext context) + public ApplyPreserveAttribute () + { + impl = new ApplyPreserveAttributeImpl (this); + } + + public override bool IsActiveFor (AssemblyDefinition assembly) { - base.Initialize (context); + // It's either this step, or ApplyPreserveAttributeStep. If ApplyPreserveAttributeStep already ran, then we shouldn't run this step. + if (Configuration.DerivedLinkContext.DidRunApplyPreserveAttributeStep) + return false; - if (Configuration.Application.XamarinRuntime == XamarinRuntime.NativeAOT) - abr = Configuration.AppBundleRewriter; + return Annotations.GetAction (assembly) == AssemblyAction.Link; } protected override void Process (AssemblyDefinition assembly) { - BrowseTypes (assembly.MainModule.Types); - ProcessDeferredActions (); + impl.Process (assembly); + } + + bool IApplyPreserveAttribute.PreserveUnconditional (IMetadataTokenProvider provider) + { + if (provider is MethodDefinition method) + Annotations.SetAction (method, MethodAction.Parse); + Annotations.Mark (provider); + return true; + } + + bool IApplyPreserveAttribute.PreserveType (TypeDefinition type, bool allMembers) + { + Annotations.Mark (type); + if (allMembers) + Annotations.SetPreserve (type, TypePreserve.All); + return true; + } + + bool IApplyPreserveAttribute.PreserveConditional (TypeDefinition onType, MethodDefinition forMethod) + { + Annotations.SetAction (forMethod, MethodAction.Parse); + Annotations.AddPreservedMethod (onType, forMethod); + return true; + } + } + + public interface IApplyPreserveAttribute { + bool PreserveType (TypeDefinition type, bool allMembers); + bool PreserveUnconditional (IMetadataTokenProvider provider); + bool PreserveConditional (TypeDefinition onType, MethodDefinition forMethod); + } + + public class ApplyPreserveAttributeImpl { + IApplyPreserveAttribute applyPreserveAttribute; + + public ApplyPreserveAttributeImpl (IApplyPreserveAttribute applyPreserveAttribute) + { + this.applyPreserveAttribute = applyPreserveAttribute; + } + + bool IsPreservedAttribute (ICustomAttributeProvider provider, CustomAttribute attribute) + { + TypeReference type = attribute.Constructor.DeclaringType; + return type.Name == "PreserveAttribute"; + } + + public bool Process (AssemblyDefinition assembly) + { + var modified = false; + modified |= BrowseTypes (assembly.MainModule.Types); + modified |= ProcessAssemblyAttributes (assembly); + return modified; } - void BrowseTypes (IEnumerable types) + bool ProcessAssemblyAttributes (AssemblyDefinition assembly) { - foreach (TypeDefinition type in types) { - ProcessType (type); + if (!assembly.HasCustomAttributes) + return false; + + var modified = false; + foreach (var attribute in assembly.CustomAttributes) { + if (!attribute.Constructor.DeclaringType.Is (Namespaces.Foundation, "PreserveAttribute")) + continue; + + if (!attribute.HasConstructorArguments) + continue; + var tr = (attribute.ConstructorArguments [0].Value as TypeReference); + if (tr is null) + continue; + + // we do not call `this.ProcessType` since + // (a) we're potentially processing a different assembly and `is_active` represent the current one + // (b) it will try to fetch the [Preserve] attribute on the type (and it's not there) as `base` would + var type = tr.Resolve (); + + modified |= PreserveType (type, attribute); + } + return modified; + } + + bool BrowseTypes (IEnumerable types) + { + var modified = false; + foreach (var type in (new List (types))) { + modified |= ProcessType (type); if (type.HasFields) { - foreach (FieldDefinition field in type.Fields) - ProcessField (field); + foreach (var field in type.Fields.ToArray ()) + modified |= ProcessField (field); } if (type.HasMethods) { - foreach (MethodDefinition method in type.Methods) - ProcessMethod (method); + foreach (var method in type.Methods.ToArray ()) + modified |= ProcessMethod (method); } if (type.HasProperties) { - foreach (PropertyDefinition property in type.Properties) - ProcessProperty (property); + foreach (var property in type.Properties.ToArray ()) + modified |= ProcessProperty (property); } if (type.HasEvents) { - foreach (EventDefinition @event in type.Events) - ProcessEvent (@event); + foreach (var @event in type.Events.ToArray ()) + modified |= ProcessEvent (@event); } if (type.HasNestedTypes) { - BrowseTypes (type.NestedTypes); + modified |= BrowseTypes (type.NestedTypes); } } + return modified; } - void ProcessDeferredActions () + bool ProcessType (TypeDefinition type) { - while (deferredActions.Count > 0) { - var action = deferredActions.Dequeue (); - action.Invoke (); - } - } - - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return Annotations.GetAction (assembly) == AssemblyAction.Link; + return TryApplyPreserveAttribute (type); } - protected override void Process (TypeDefinition type) - { - TryApplyPreserveAttribute (type); - } - - protected override void Process (FieldDefinition field) + bool ProcessField (FieldDefinition field) { + var modified = false; foreach (var attribute in GetPreserveAttributes (field)) - Mark (field, attribute); + modified |= Mark (field, attribute); + return modified; } - protected override void Process (MethodDefinition method) + bool ProcessMethod (MethodDefinition method) { - MarkMethodIfPreserved (method); + return MarkMethodIfPreserved (method); } - protected override void Process (PropertyDefinition property) + bool ProcessProperty (PropertyDefinition property) { + var modified = false; foreach (var attribute in GetPreserveAttributes (property)) { - MarkMethod (property.GetMethod, attribute); - MarkMethod (property.SetMethod, attribute); + modified |= MarkMethod (property.GetMethod, attribute); + modified |= MarkMethod (property.SetMethod, attribute); } + return modified; } - protected override void Process (EventDefinition @event) + bool ProcessEvent (EventDefinition @event) { + var modified = false; foreach (var attribute in GetPreserveAttributes (@event)) { - MarkMethod (@event.AddMethod, attribute); - MarkMethod (@event.InvokeMethod, attribute); - MarkMethod (@event.RemoveMethod, attribute); + modified |= MarkMethod (@event.AddMethod, attribute); + modified |= MarkMethod (@event.InvokeMethod, attribute); + modified |= MarkMethod (@event.RemoveMethod, attribute); } + return modified; } - void MarkMethodIfPreserved (MethodDefinition method) + bool MarkMethodIfPreserved (MethodDefinition method) { + var modified = false; foreach (var attribute in GetPreserveAttributes (method)) - MarkMethod (method, attribute); + modified |= MarkMethod (method, attribute); + return modified; } - void MarkMethod (MethodDefinition? method, CustomAttribute? preserve_attribute) + bool MarkMethod (MethodDefinition? method, CustomAttribute? preserve_attribute) { if (method is null) - return; + return false; - Mark (method, preserve_attribute); - Annotations.SetAction (method, MethodAction.Parse); + return Mark (method, preserve_attribute); } - void Mark (IMetadataTokenProvider provider, CustomAttribute? preserve_attribute) + bool Mark (IMetadataTokenProvider provider, CustomAttribute? preserve_attribute) { - if (IsConditionalAttribute (preserve_attribute)) { - PreserveConditional (provider); - return; - } + if (IsConditionalAttribute (preserve_attribute)) + return PreserveConditional (provider); - PreserveUnconditional (provider); + return PreserveUnconditional (provider); } - void PreserveConditional (IMetadataTokenProvider provider) + bool PreserveConditional (IMetadataTokenProvider provider) { var method = provider as MethodDefinition; if (method is null) { // workaround to support (uncommon but valid) conditional fields form [Preserve] - PreserveUnconditional (provider); - return; + return PreserveUnconditional (provider); } - Annotations.AddPreservedMethod (method.DeclaringType, method); - AddConditionalDynamicDependencyAttribute (method.DeclaringType, method); + return applyPreserveAttribute.PreserveConditional (method.DeclaringType, method); } static bool IsConditionalAttribute (CustomAttribute? attribute) @@ -176,55 +238,39 @@ static bool IsConditionalAttribute (CustomAttribute? attribute) return false; } - void PreserveUnconditional (IMetadataTokenProvider provider) + bool PreserveUnconditional (IMetadataTokenProvider provider) { - Annotations.Mark (provider); + var modified = false; - // We want to add a dynamic dependency attribute to preserve methods and fields - // but not to preserve types while we're marking the chain of declaring types. - if (provider is not TypeDefinition) { - AddDynamicDependencyAttribute (provider); - } + modified |= applyPreserveAttribute.PreserveUnconditional (provider); var member = provider as IMemberDefinition; if (member is null || member.DeclaringType is null) - return; + return modified; - Mark (member.DeclaringType, null); + modified |= Mark (member.DeclaringType, null); + + return modified; } - void TryApplyPreserveAttribute (TypeDefinition type) + bool TryApplyPreserveAttribute (TypeDefinition type) { + var modified = false; foreach (var attribute in GetPreserveAttributes (type)) { - PreserveType (type, attribute); + modified |= PreserveType (type, attribute); } + return modified; } List GetPreserveAttributes (ICustomAttributeProvider provider) { - List attrs = new List (); - if (!provider.HasCustomAttributes) - return attrs; - - var attributes = provider.CustomAttributes; - - for (int i = attributes.Count - 1; i >= 0; i--) { - var attribute = attributes [i]; + return new List (); - bool remote_attribute; - if (!IsPreservedAttribute (provider, attribute, out remote_attribute)) - continue; - - attrs.Add (attribute); - if (remote_attribute) - attributes.RemoveAt (i); - } - - return attrs; + return provider.CustomAttributes.Where (a => IsPreservedAttribute (provider, a)).ToList (); } - protected void PreserveType (TypeDefinition type, CustomAttribute preserveAttribute) + protected bool PreserveType (TypeDefinition type, CustomAttribute preserveAttribute) { var allMembers = false; if (preserveAttribute.HasFields) { @@ -233,114 +279,12 @@ protected void PreserveType (TypeDefinition type, CustomAttribute preserveAttrib allMembers = true; } - PreserveType (type, allMembers); - } - - protected void PreserveType (TypeDefinition type, bool allMembers) - { - Annotations.Mark (type); - if (allMembers) - Annotations.SetPreserve (type, TypePreserve.All); - AddDynamicDependencyAttribute (type, allMembers); + return PreserveType (type, allMembers); } - MethodDefinition GetOrCreateModuleConstructor (ModuleDefinition @module) + bool PreserveType (TypeDefinition type, bool allMembers) { - var moduleType = @module.GetModuleType (); - return GetOrCreateStaticConstructor (moduleType); - } - - // We want to avoid `DynamicallyAccessedMemberTypes.All` because the semantics are different - // from `[Preserve (AllMembers = true)]`. Specifically, we don't want to preserve nested types. - // `All` would also keep unused private members of base types which `Preserve` also doesn't cover. - const DynamicallyAccessedMemberTypes allMemberTypes = - DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields - | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties - | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods - | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors - | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents - | DynamicallyAccessedMemberTypes.Interfaces; - - void AddDynamicDependencyAttribute (TypeDefinition type, bool allMembers) - { - if (abr is null) - return; - - abr.ClearCurrentAssembly (); - abr.SetCurrentAssembly (type.Module.Assembly); - - var moduleConstructor = GetOrCreateModuleConstructor (type.GetModule ()); - var members = allMembers - ? allMemberTypes - : DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors; - - // only preserve fields for enums - if (type.IsEnum) { - members = DynamicallyAccessedMemberTypes.PublicFields; - } - - var attrib = abr.CreateDynamicDependencyAttribute (members, type); - moduleConstructor.CustomAttributes.Add (attrib); - - abr.ClearCurrentAssembly (); - } - - void AddConditionalDynamicDependencyAttribute (TypeDefinition onType, MethodDefinition forMethod) - { - if (abr is null) - return; - - deferredActions.Enqueue (() => AddDynamicDependencyAttributeToStaticConstructor (onType, forMethod)); - } - - void AddDynamicDependencyAttribute (IMetadataTokenProvider provider) - { - if (abr is null) - return; - - var member = provider as IMemberDefinition; - if (member is null) - throw ErrorHelper.CreateError (99, $"Unable to add dynamic dependency attribute to {provider.GetType ().FullName}"); - - var module = member.GetModule (); - abr.ClearCurrentAssembly (); - abr.SetCurrentAssembly (module.Assembly); - - var moduleConstructor = GetOrCreateModuleConstructor (module); - var signature = DocumentationComments.GetSignature (member); - var attrib = abr.CreateDynamicDependencyAttribute (signature, member.DeclaringType); - moduleConstructor.CustomAttributes.Add (attrib); - - abr.ClearCurrentAssembly (); - } - - void AddDynamicDependencyAttributeToStaticConstructor (TypeDefinition onType, MethodDefinition forMethod) - { - if (abr is null) - return; - - abr.ClearCurrentAssembly (); - abr.SetCurrentAssembly (onType.Module.Assembly); - - var cctor = GetOrCreateStaticConstructor (onType); - var signature = DocumentationComments.GetSignature (forMethod); - var attrib = abr.CreateDynamicDependencyAttribute (signature, onType); - cctor.CustomAttributes.Add (attrib); - Annotations.AddPreservedMethod (onType, cctor); - - abr.ClearCurrentAssembly (); - } - - MethodDefinition GetOrCreateStaticConstructor (TypeDefinition type) - { - var staticCtor = type.GetTypeConstructor (); - if (staticCtor is null) { - staticCtor = type.AddMethod (".cctor", MethodAttributes.Private | MethodAttributes.HideBySig | MethodAttributes.RTSpecialName | MethodAttributes.SpecialName | MethodAttributes.Static, abr!.System_Void); - staticCtor.CreateBody (out var il); - il.Emit (OpCodes.Ret); - } - - return staticCtor; + return applyPreserveAttribute.PreserveType (type, allMembers); } } } diff --git a/tools/dotnet-linker/ApplyPreserveAttributeStep.cs b/tools/dotnet-linker/ApplyPreserveAttributeStep.cs new file mode 100644 index 000000000000..d25a335b4d0c --- /dev/null +++ b/tools/dotnet-linker/ApplyPreserveAttributeStep.cs @@ -0,0 +1,307 @@ +using System.IO; +using System.Linq; +using System.Xml.Linq; + +using Mono.Cecil; +using Mono.Linker; +using Mono.Linker.Steps; +using Xamarin.Bundler; +using Xamarin.Tuner; +using Xamarin.Utils; + +#nullable enable + +namespace Xamarin.Linker.Steps { + + public class ApplyPreserveAttributeStep : AssemblyModifierStep, IApplyPreserveAttribute { + sealed class XmlTypeDescription { + public XmlTypeDescription (TypeDefinition type) + { + Type = type; + } + + public TypeDefinition Type { get; } + public bool PreserveAllMembers { get; set; } + public bool PreserveFields { get; set; } + public bool PreserveType { get; set; } + public Dictionary Fields { get; } = new (StringComparer.Ordinal); + public Dictionary Methods { get; } = new (StringComparer.Ordinal); + } + + ApplyPreserveAttributeImpl impl; + readonly Dictionary> xmlDescriptions = new (StringComparer.Ordinal); + protected override string Name { get => "Apply Preserve Attribute"; } + protected override int ErrorCode { get => 2450; } + + bool? create_xml_description_file; + public bool CreateXmlDescriptionFile { + get { + if (create_xml_description_file.HasValue) + return create_xml_description_file.Value; + return Configuration.Application.XamarinRuntime == XamarinRuntime.NativeAOT; + } + set { + create_xml_description_file = value; + } + } + + public bool UseXmlDescriptionFile { get; set; } = true; + public string XmlDescriptionPath { get; set; } = string.Empty; + + public ApplyPreserveAttributeStep () + { + impl = new ApplyPreserveAttributeImpl (this); + } + + protected override void TryProcess () + { + DerivedLinkContext.DidRunApplyPreserveAttributeStep = true; + base.TryProcess (); + } + + protected override bool IsActiveFor (AssemblyDefinition assembly) + { + // We only care about assemblies that are being linked. + if (Annotations.GetAction (assembly) != AssemblyAction.Link) + return false; + + return true; + } + + protected override bool ModifyAssembly (AssemblyDefinition assembly) + { + return impl.Process (assembly); + } + + protected override void TryEndProcess () + { + if (!UseXmlDescriptionFile) + return; + + WriteXmlDescription (); + } + + bool IApplyPreserveAttribute.PreserveUnconditional (IMetadataTokenProvider provider) + { + if (UseXmlDescriptionFile) { + AddUnconditionalXmlDescription (provider); + return false; + } + + // We want to add a dynamic dependency attribute to preserve methods and fields + // but not to preserve types while we're marking the chain of declaring types. + if (provider is not TypeDefinition) { + return AddDynamicDependencyAttribute (provider); + } + return false; + } + + bool IApplyPreserveAttribute.PreserveType (TypeDefinition type, bool allMembers) + { + if (UseXmlDescriptionFile) { + AddXmlDescription (type, allMembers); + return false; + } + + return AddDynamicDependencyAttribute (type, allMembers); + } + + MethodDefinition GetOrCreateModuleConstructor (ModuleDefinition @module, out bool modified) + { + var moduleType = @module.GetModuleType (); + return abr.GetOrCreateStaticConstructor (moduleType, out modified); + } + + bool IApplyPreserveAttribute.PreserveConditional (TypeDefinition onType, MethodDefinition forMethod) + { + if (UseXmlDescriptionFile) { + AddXmlDescription (onType, forMethod, conditional: true); + return false; + } + + return AddConditionalDynamicDependencyAttribute (onType, forMethod); + } + + // We want to avoid `DynamicallyAccessedMemberTypes.All` because the semantics are different + // from `[Preserve (AllMembers = true)]`. Specifically, we don't want to preserve nested types. + // `All` would also keep unused private members of base types which `Preserve` also doesn't cover. + const DynamicallyAccessedMemberTypes allMemberTypes = + DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields + | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties + | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods + | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors + | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents + | DynamicallyAccessedMemberTypes.Interfaces; + + bool AddDynamicDependencyAttribute (TypeDefinition type, bool allMembers) + { + var moduleConstructor = GetOrCreateModuleConstructor (abr.CurrentAssembly.MainModule, out var modified); + var members = allMembers + ? allMemberTypes + : DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors; + + // only preserve fields for enums + if (type.IsEnum) { + members = DynamicallyAccessedMemberTypes.PublicFields; + } + + var attrib = abr.CreateDynamicDependencyAttribute (members, type); + modified |= abr.AddAttributeOnlyOnce (moduleConstructor, attrib); + return modified; + } + + bool AddConditionalDynamicDependencyAttribute (TypeDefinition onType, MethodDefinition forMethod) + { + return abr.AddDynamicDependencyAttributeToStaticConstructor (onType, forMethod); + } + + bool AddDynamicDependencyAttribute (IMetadataTokenProvider provider) + { + var member = provider as IMemberDefinition; + if (member is null) + throw ErrorHelper.CreateError (99, $"Unable to add dynamic dependency attribute to {provider.GetType ().FullName}"); + + var moduleConstructor = GetOrCreateModuleConstructor (member.GetModule (), out var modified); + var signature = DocumentationComments.GetSignature (member); + var attrib = abr.CreateDynamicDependencyAttribute (signature, member.DeclaringType); + modified |= abr.AddAttributeOnlyOnce (moduleConstructor, attrib); + return modified; + } + + string GetXmlDescriptionFilePath () + { + if (!string.IsNullOrEmpty (XmlDescriptionPath)) + return XmlDescriptionPath; + + return Path.Combine (Configuration.CacheDirectory, "apply-preserve-attribute.xml"); + } + + static string GetXmlSignature (MethodDefinition method) + { + var marker = method.DeclaringType.FullName + "::"; + var index = method.FullName.IndexOf (marker, System.StringComparison.Ordinal); + if (index < 0) + return method.FullName; + + return method.FullName.Substring (0, index) + method.FullName.Substring (index + marker.Length); + } + + XmlTypeDescription GetOrCreateXmlDescription (TypeDefinition type) + { + var assemblyName = type.Module.Assembly.Name.Name; + if (!xmlDescriptions.TryGetValue (assemblyName, out var types)) { + types = new Dictionary (System.StringComparer.Ordinal); + xmlDescriptions.Add (assemblyName, types); + } + + if (!types.TryGetValue (type.FullName, out var description)) { + description = new XmlTypeDescription (type); + types.Add (type.FullName, description); + } + + return description; + } + + void AddXmlDescription (TypeDefinition type, bool allMembers) + { + var description = GetOrCreateXmlDescription (type); + description.PreserveType = true; + if (allMembers) { + description.PreserveAllMembers = true; + return; + } + + if (type.IsEnum) { + description.PreserveFields = true; + return; + } + } + + void AddXmlDescription (TypeDefinition onType, MethodDefinition forMethod, bool conditional) + { + var description = GetOrCreateXmlDescription (onType); + if (!conditional) + description.PreserveType = true; + description.Methods [GetXmlSignature (forMethod)] = conditional; + } + + void AddUnconditionalXmlDescription (IMetadataTokenProvider provider) + { + switch (provider) { + case MethodDefinition method: + AddXmlDescription (method.DeclaringType, method, false); + break; + case FieldDefinition field: + var description = GetOrCreateXmlDescription (field.DeclaringType); + description.Fields [field.Name] = false; + description.PreserveType = true; + break; + } + } + + XElement CreateXmlTypeElement (XmlTypeDescription description) + { + var type = new XElement ("type", new XAttribute ("fullname", description.Type.FullName)); + + if (description.PreserveAllMembers) { + type.SetAttributeValue ("preserve", "all"); + return type; + } + + if (description.PreserveFields && description.Fields.Count == 0 && description.Methods.Count == 0) { + type.SetAttributeValue ("preserve", "fields"); + return type; + } + + if (!description.PreserveType) + type.SetAttributeValue ("required", "false"); + + type.SetAttributeValue ("preserve", "nothing"); + + foreach (var field in description.Fields.OrderBy (v => v.Key, System.StringComparer.Ordinal)) + type.Add (new XElement ("field", new XAttribute ("name", field.Key), new XAttribute ("required", field.Value ? "false" : "true"))); + + foreach (var method in description.Methods.OrderBy (v => v.Key, System.StringComparer.Ordinal)) + type.Add (new XElement ("method", new XAttribute ("signature", method.Key), new XAttribute ("required", method.Value ? "false" : "true"))); + + return type; + } + + void WriteXmlDescription () + { + var xmlPath = GetXmlDescriptionFilePath (); + var directory = Path.GetDirectoryName (xmlPath); + if (!string.IsNullOrEmpty (directory)) + Directory.CreateDirectory (directory); + + var document = new XDocument ( + new XElement ("linker", + xmlDescriptions + .OrderBy (v => v.Key, System.StringComparer.Ordinal) + .Select (assembly => new XElement ("assembly", + new XAttribute ("fullname", assembly.Key), + assembly.Value + .OrderBy (v => v.Key, System.StringComparer.Ordinal) + .Select (v => CreateXmlTypeElement (v.Value)))))); + document.Save (xmlPath); + + if (CreateXmlDescriptionFile) { + var items = new List (); + var item = new MSBuildItem (xmlPath); + items.Add (item); + Configuration.WriteOutputForMSBuild ("TrimmerRootDescriptor", items); + } + + // The current linker run still needs these roots immediately. Writing the TrimmerRootDescriptor item only + // makes the descriptor available to MSBuild after this step has already finished running. + var applyXmlStepType = Context.GetType ().Assembly.GetType ("Mono.Linker.Steps.ResolveFromXmlStep"); + if (applyXmlStepType is not null) { + var documentStream = File.OpenRead (xmlPath); // ResolveFromXmlStep will dispose the stream. + var applyXmlStep = (BaseStep) Activator.CreateInstance (applyXmlStepType, new object [] { documentStream, xmlPath })!; + applyXmlStep.Process (Context); + } else { + throw ErrorHelper.CreateError (99, $"Unable to find Mono.Linker.Steps.ResolveFromXmlStep to apply the generated XML description file {xmlPath}"); + } + } + } +} diff --git a/tools/dotnet-linker/CecilExtensions.cs b/tools/dotnet-linker/CecilExtensions.cs index 810cc0db91a5..705b5bcda241 100644 --- a/tools/dotnet-linker/CecilExtensions.cs +++ b/tools/dotnet-linker/CecilExtensions.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using System.Text; using Mono.Cecil; using Mono.Cecil.Cil; @@ -161,5 +162,49 @@ public static TypeDefinition GetModuleType (this ModuleDefinition @module) return moduleType; } + public static string RenderAttribute (this CustomAttribute ca) + { + var render = new Func (v => { + if (v is string s) + return $"\"{s}\""; + else if (v is TypeReference tr) + return $"typeof ({tr.FullName})"; + else + return v?.ToString () ?? "null"; + }); + + var sb = new StringBuilder (); + sb.Append ("["); + sb.Append (ca.AttributeType.Name.EndsWith ("Attribute") ? ca.AttributeType.Name.Substring (0, ca.AttributeType.Name.Length - "Attribute".Length) : ca.AttributeType.Name); + if (ca.HasFields || ca.HasConstructorArguments || ca.HasProperties) { + sb.Append ("("); + var first = true; + foreach (var arg in ca.ConstructorArguments) { + if (!first) + sb.Append (", "); + first = false; + sb.Append (render (arg.Value)); + } + foreach (var prop in ca.Properties) { + if (!first) + sb.Append (", "); + first = false; + sb.Append (prop.Name); + sb.Append (" = "); + sb.Append (render (prop.Argument.Value)); + } + foreach (var field in ca.Fields) { + if (!first) + sb.Append (", "); + first = false; + sb.Append (field.Name); + sb.Append (" = "); + sb.Append (render (field.Argument.Value)); + } + sb.Append (")"); + } + sb.Append ("]"); + return sb.ToString (); + } } } diff --git a/tools/dotnet-linker/MarkForStaticRegistrar.cs b/tools/dotnet-linker/MarkForStaticRegistrar.cs index e78759e16057..9590920980cb 100644 --- a/tools/dotnet-linker/MarkForStaticRegistrar.cs +++ b/tools/dotnet-linker/MarkForStaticRegistrar.cs @@ -23,6 +23,10 @@ public class MarkForStaticRegistrar : ConfigurationAwareSubStep { public override bool IsActiveFor (AssemblyDefinition assembly) { + // It's either this step, or MarkForStaticRegistrarStep. If MarkForStaticRegistrarStep already ran, then we shouldn't run this step. + if (Configuration.DerivedLinkContext.DidRunMarkForStaticRegistrarStep) + return false; + if (Configuration.Application.Optimizations.OptimizeBlockLiteralSetupBlock != true) return false; diff --git a/tools/dotnet-linker/MarkForStaticRegistrarStep.cs b/tools/dotnet-linker/MarkForStaticRegistrarStep.cs new file mode 100644 index 000000000000..55b18ecd053f --- /dev/null +++ b/tools/dotnet-linker/MarkForStaticRegistrarStep.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using System.Linq; + +using Mono.Cecil; +using Mono.Linker; +using Registrar; +using Xamarin.Bundler; + +#nullable enable + +namespace Xamarin.Linker.Steps { + + // This class marks APIs referenced by the native code generated by the static registrar. + public class MarkForStaticRegistrarStep : AssemblyModifierStep { + protected override string Name { get => "Mark For Static Registrar"; } + + protected override int ErrorCode { get => 2460; } + + protected override bool IsActiveFor (AssemblyDefinition assembly) + { + if (Configuration.Application.Optimizations.OptimizeBlockLiteralSetupBlock != true) + return false; + + if (Configuration.Application.Registrar != RegistrarMode.Static) + return false; + + return Annotations.GetAction (assembly) == AssemblyAction.Link; + } + + protected override void TryProcess () + { + DerivedLinkContext.DidRunMarkForStaticRegistrarStep = true; + base.TryProcess (); + } + + protected override bool ProcessType (TypeDefinition type) + { + return base.ProcessMethods (type); + } + + protected override bool ProcessMethod (MethodDefinition method) + { + return ProcessDelegateProxyAttribute (method); + } + + // Mark the Invoke method in the type pointed to by the DelegateProxy attribute, + // because it may only be referenced from native code when using the static registrar. + bool ProcessDelegateProxyAttribute (MethodDefinition method) + { + if (!StaticRegistrar.IsDelegate (method.ReturnType.Resolve ())) + return false; + + var getDelegateProxyType = DerivedLinkContext.StaticRegistrar.GetDelegateProxyType (method); + if (getDelegateProxyType is null) + return false; + + var invokeMethod = getDelegateProxyType.Methods.SingleOrDefault (m => m.Name == "Invoke"); + if (invokeMethod is null) + return false; + + return abr.AddDynamicDependencyAttribute (method, invokeMethod); + } + } +} diff --git a/tools/dotnet-linker/MarkNSObjectsStep.cs b/tools/dotnet-linker/MarkNSObjectsStep.cs new file mode 100644 index 000000000000..3338ec181260 --- /dev/null +++ b/tools/dotnet-linker/MarkNSObjectsStep.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Mono.Cecil; +using Mono.Linker; + +using Xamarin.Tuner; + +#nullable enable + +namespace Xamarin.Linker.Steps { + public class MarkNSObjectsStep : AssemblyModifierStep, IMarkNSObjects { + protected override string Name { get; } = "MarkNSObjects"; + protected override int ErrorCode { get; } = 2080; + + protected override bool IsActiveFor (AssemblyDefinition assembly) + { + // We only care about assemblies that are being linked. + if (Annotations.GetAction (assembly) != AssemblyAction.Link) + return false; + + // We only care about assemblies that is or references our product assembly, because those are the only + // assemblies that can have NSObject subclasses. + if (!Configuration.Profile.IsOrReferencesProductAssembly (assembly)) + return false; + + return true; + } + + protected override void TryProcess () + { + DerivedLinkContext.DidRunMarkNSObjectsStep = true; + base.TryProcess (); + } + + AnnotationStore IMarkNSObjects.Annotations => Annotations; + DerivedLinkContext IMarkNSObjects.Context => Configuration.DerivedLinkContext; + + protected override bool ProcessType (TypeDefinition type) + { + return MarkNSObjectsImpl.ProcessType (this, type); + } + + public bool PreserveType (TypeDefinition type, bool allMembers) + { + var moduleConstructor = abr.GetOrCreateStaticConstructor (type.Module.GetModuleType (), out var modified); + var attrib = CreateDynamicDependencyAttribute (type, allMembers); + modified |= abr.AddAttributeOnlyOnce (moduleConstructor, attrib); + return modified; + } + + public bool PreserveType (TypeDefinition onType, TypeDefinition type) + { + return abr.AddDynamicDependencyAttributeToStaticConstructor (onType, type); + } + + // We want to avoid `DynamicallyAccessedMemberTypes.All` because it preserves nested types. + // `All` would also keep unused private members of base types. + const DynamicallyAccessedMemberTypes allMemberTypes = + DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields + | DynamicallyAccessedMemberTypes.PublicProperties | DynamicallyAccessedMemberTypes.NonPublicProperties + | DynamicallyAccessedMemberTypes.PublicMethods | DynamicallyAccessedMemberTypes.NonPublicMethods + | DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors + | DynamicallyAccessedMemberTypes.PublicEvents | DynamicallyAccessedMemberTypes.NonPublicEvents + | DynamicallyAccessedMemberTypes.Interfaces; + + CustomAttribute CreateDynamicDependencyAttribute (TypeDefinition type, bool allMembers) + { + var members = allMembers + ? allMemberTypes + : DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors; + + return abr.CreateDynamicDependencyAttribute (members, type); + } + + public bool PreserveMethod (TypeDefinition onType, MethodDefinition method) + { + return abr.AddDynamicDependencyAttributeToStaticConstructor (onType, method); + } + } +} diff --git a/tools/dotnet-linker/Steps/AssemblyModifierStep.cs b/tools/dotnet-linker/Steps/AssemblyModifierStep.cs index da3fcb5e5608..2e3e971d4d87 100644 --- a/tools/dotnet-linker/Steps/AssemblyModifierStep.cs +++ b/tools/dotnet-linker/Steps/AssemblyModifierStep.cs @@ -17,19 +17,25 @@ namespace Xamarin.Linker.Steps; public abstract class AssemblyModifierStep : ConfigurationAwareStep { private protected AppBundleRewriter abr => Configuration.AppBundleRewriter; - protected override void TryProcessAssembly (AssemblyDefinition assembly) + protected sealed override void TryProcessAssembly (AssemblyDefinition assembly) { var modified = false; abr.SetCurrentAssembly (assembly); - foreach (var type in assembly.MainModule.Types) - modified |= ProcessTypeImpl (type); - + modified |= ModifyAssembly (assembly); if (modified) abr.SaveCurrentAssembly (); abr.ClearCurrentAssembly (); } + protected virtual bool ModifyAssembly (AssemblyDefinition assembly) + { + var modified = false; + foreach (var type in assembly.MainModule.Types) + modified |= ProcessTypeImpl (type); + return modified; + } + protected virtual bool ProcessType (TypeDefinition type) { return false; diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs index 2b9e55e9a9dd..f72d3ae9e26a 100644 --- a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs +++ b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs @@ -351,6 +351,11 @@ void CreateUnmanagedCallersMethod (MethodDefinition method, AssemblyTrampolineIn proxyInterface = new TypeDefinition ("ObjCRuntime", proxyInterfaceName, TypeAttributes.NotPublic | TypeAttributes.Interface | TypeAttributes.Abstract); method.DeclaringType.Interfaces.Add (new InterfaceImplementation (proxyInterface)); proxyInterfaces.Add (proxyInterface); + + // The trimmer may just remove the interface implementation, because it thinks it's not used - which it technically + // isn't, because the consuming code is generated in the ManagedRegistrarLookupTables step, which happens after trimming. + var attrib = abr.CreateDynamicDependencyAttribute (DynamicallyAccessedMemberTypes.Interfaces, method.DeclaringType); + abr.AddAttributeToStaticConstructor (method.DeclaringType, attrib); } var methodName = $"{proxyInterfaceName}_{method.Name}"; @@ -365,6 +370,9 @@ void CreateUnmanagedCallersMethod (MethodDefinition method, AssemblyTrampolineIn callback.ReturnType = implementationMethod.ReturnType; interfaceMethod.ReturnType = implementationMethod.ReturnType; + // make the interface method depend on the implementation method, so that the trimmer doesn't remove the implementation method + abr.AddDynamicDependencyAttribute (interfaceMethod, implementationMethod); + foreach (var parameter in implementationMethod.Parameters) { callback.AddParameter (parameter.Name, parameter.ParameterType); interfaceMethod.AddParameter (parameter.Name, parameter.ParameterType); diff --git a/tools/dotnet-linker/Steps/RemoveAttributesStep.cs b/tools/dotnet-linker/Steps/RemoveAttributesStep.cs index af9acee94086..7fa016caab70 100644 --- a/tools/dotnet-linker/Steps/RemoveAttributesStep.cs +++ b/tools/dotnet-linker/Steps/RemoveAttributesStep.cs @@ -35,6 +35,9 @@ bool IsRemovedAttribute (CustomAttribute attribute) { // this avoids calling FullName (which allocates a string) var attr_type = attribute.Constructor.DeclaringType; + if (attr_type.Name == "PreserveAttribute") + return true; + switch (attr_type.Namespace) { case Namespaces.ObjCRuntime: switch (attr_type.Name) { diff --git a/tools/dotnet-linker/Steps/SetBeforeFieldInitStep.cs b/tools/dotnet-linker/Steps/SetBeforeFieldInitStep.cs index 1ea1dcb0943b..22f70f051ef0 100644 --- a/tools/dotnet-linker/Steps/SetBeforeFieldInitStep.cs +++ b/tools/dotnet-linker/Steps/SetBeforeFieldInitStep.cs @@ -45,12 +45,6 @@ protected override void Process (TypeDefinition type) if (Configuration.DerivedLinkContext.App.Optimizations.RegisterProtocols != true) return; - if (Configuration.DerivedLinkContext.App.XamarinRuntime == Bundler.XamarinRuntime.NativeAOT) { - // We can't remove the static constructor in the trimmer if we're using NativeAOT, - // because NativeAOT needs it for its own trimming logic. - return; - } - if (!type.IsBeforeFieldInit && type.IsInterface && type.HasMethods) { var cctor = type.GetTypeConstructor (); if (cctor is not null && cctor.IsBindingImplOptimizableCode (LinkContext)) diff --git a/tools/dotnet-linker/dotnet-linker.csproj b/tools/dotnet-linker/dotnet-linker.csproj index 1cd515ca90b8..5b8b4c66d39e 100644 --- a/tools/dotnet-linker/dotnet-linker.csproj +++ b/tools/dotnet-linker/dotnet-linker.csproj @@ -163,9 +163,6 @@ external/src/ObjCRuntime/NativeNameAttribute.cs - - external/tools/linker/ApplyPreserveAttribute.cs - external/tools/linker/ExceptionalSubStep.cs diff --git a/tools/linker/ApplyPreserveAttribute.cs b/tools/linker/ApplyPreserveAttribute.cs deleted file mode 100644 index 9eea0bb1c5ca..000000000000 --- a/tools/linker/ApplyPreserveAttribute.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2011-2013 Xamarin Inc. All rights reserved. - -using System; -using System.Collections.Generic; - -using Mono.Cecil; -using Mono.Linker; -using Mono.Tuner; - -using Xamarin.Tuner; - -namespace Xamarin.Linker.Steps { - - public class ApplyPreserveAttribute : ApplyPreserveAttributeBase { - // We need to run the ApplyPreserveAttribute step even if we're only linking sdk assemblies, because even - // though we know that sdk assemblies will never have Preserve attributes, user assemblies may have - // [assembly: LinkSafe] attributes, which means we treat them as sdk assemblies and those may have - // Preserve attributes. - public override bool IsActiveFor (AssemblyDefinition assembly) - { - return Annotations.GetAction (assembly) == AssemblyAction.Link; - } - - protected override void Process (AssemblyDefinition assembly) - { - base.Process (assembly); - ProcessAssemblyAttributes (assembly); - } - - void ProcessAssemblyAttributes (AssemblyDefinition assembly) - { - if (!assembly.HasCustomAttributes) - return; - - foreach (var attribute in assembly.CustomAttributes) { - if (!attribute.Constructor.DeclaringType.Is (Namespaces.Foundation, "PreserveAttribute")) - continue; - - if (!attribute.HasConstructorArguments) - continue; - var tr = (attribute.ConstructorArguments [0].Value as TypeReference); - if (tr is null) - continue; - - // we do not call `this.ProcessType` since - // (a) we're potentially processing a different assembly and `is_active` represent the current one - // (b) it will try to fetch the [Preserve] attribute on the type (and it's not there) as `base` would - var type = tr.Resolve (); - - PreserveType (type, attribute); - } - } - - protected override bool IsPreservedAttribute (ICustomAttributeProvider provider, CustomAttribute attribute, out bool removeAttribute) - { - removeAttribute = false; - TypeReference type = attribute.Constructor.DeclaringType; - - if (type.Name == "PreserveAttribute") { - // there's no need to keep the [Preserve] attribute in the assembly once it was processed - removeAttribute = true; - return true; - } - return false; - } - } -} diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs index 27fe2ccad3ca..a69aeb3239c9 100644 --- a/tools/linker/MarkNSObjects.cs +++ b/tools/linker/MarkNSObjects.cs @@ -28,23 +28,19 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -using System; - using Mono.Cecil; using Mono.Linker; using Mono.Tuner; -#if NET using Mono.Linker.Steps; -#endif + +using Xamarin.Bundler; +using Xamarin.Tuner; #nullable enable namespace Xamarin.Linker.Steps { - public class MarkNSObjects : ExceptionalSubStep { - - static string? ProductAssembly; - + public class MarkNSObjects : ExceptionalSubStep, IMarkNSObjects { protected override string Name { get; } = "MarkNSObjects"; protected override int ErrorCode { get; } = 2080; @@ -52,59 +48,111 @@ public override SubStepTargets Targets { get { return SubStepTargets.Type; } } + AnnotationStore IMarkNSObjects.Annotations => Annotations; + public Application App => base.LinkContext.App; + DerivedLinkContext IMarkNSObjects.Context => Configuration.DerivedLinkContext; + + public override bool IsActiveFor (AssemblyDefinition assembly) + { + if (Configuration.DerivedLinkContext.DidRunMarkNSObjectsStep) + return false; + + return base.IsActiveFor (assembly); + } + protected override void Process (TypeDefinition type) { - if (ProductAssembly is null) - ProductAssembly = (Profile.Current as BaseProfile)?.ProductAssembly; + MarkNSObjectsImpl.ProcessType (this, type); + } + + public bool PreserveType (TypeDefinition type, bool allMembers) + { + Annotations.Mark (type); + if (allMembers) + Annotations.SetPreserve (type, TypePreserve.All); + return true; + } + + public bool PreserveType (TypeDefinition onType, TypeDefinition type) + { + return PreserveType (type, allMembers: false); + } + + public bool PreserveMethod (TypeDefinition onType, MethodDefinition method) + { + Annotations.AddPreservedMethod (onType, method); + return true; + } + } + + public interface IMarkNSObjects { + bool PreserveType (TypeDefinition type, bool allMembers); + // Preserve 'type' if 'onType' is marked. + bool PreserveType (TypeDefinition onType, TypeDefinition type); + // Preserve 'method' if 'onType' is marked. + bool PreserveMethod (TypeDefinition onType, MethodDefinition method); + AnnotationStore Annotations { get; } + Application App { get; } + DerivedLinkContext Context { get; } + } + + public class MarkNSObjectsImpl { + + public static bool ProcessType (IMarkNSObjects marker, TypeDefinition type) + { + var modified = false; - bool nsobject = type.IsNSObject (LinkContext); + bool nsobject = type.IsNSObject (marker.Context); if (!nsobject && !type.IsNativeObject ()) - return; + return modified; - if (!IsProductType (type)) { + if (!IsProductType (marker, type)) { // we need to annotate the parent type(s) of a nested type // otherwise the sweeper will not keep the parents (nor the children) if (type.IsNested) { var parent = type.DeclaringType; while (parent is not null) { - Annotations.Mark (parent); + marker.PreserveType (type, parent); parent = parent.DeclaringType; } } - Annotations.Mark (type); - Annotations.SetPreserve (type, TypePreserve.All); + marker.PreserveType (type, allMembers: true); } else if (type.HasMethods) { - PreserveIntPtrConstructor (type); + modified |= PreserveIntPtrConstructor (marker, type); if (nsobject) - PreserveExportedMethods (type); + modified |= PreserveExportedMethods (marker, type); } + + return modified; } - void PreserveExportedMethods (TypeDefinition type) + static bool PreserveExportedMethods (IMarkNSObjects marker, TypeDefinition type) { + var modified = false; foreach (var method in type.Methods) { if (!IsExportedMethod (method)) continue; // not optimal if "Link all" is used as the override might be removed later - if (!IsOverridenInUserCode (method)) + if (!IsOverridenInUserCode (marker, method)) continue; - Annotations.AddPreservedMethod (type, method); + modified |= marker.PreserveMethod (type, method); } + return modified; } - bool IsOverridenInUserCode (MethodDefinition method) + static bool IsOverridenInUserCode (IMarkNSObjects marker, MethodDefinition method) { if (!method.IsVirtual) return false; - var overrides = Annotations.GetOverrides (method); + var overrides = marker.Annotations.GetOverrides (method); if (overrides is null) return false; foreach (var @override in overrides) - if (!IsProductMethod (@override.Override)) + if (!IsProductMethod (marker, @override.Override)) return true; return false; @@ -122,44 +170,34 @@ static bool IsExportedMethod (MethodDefinition method) return false; } - void PreserveIntPtrConstructor (TypeDefinition type) + static bool PreserveIntPtrConstructor (IMarkNSObjects marker, TypeDefinition type) { + var modified = false; foreach (MethodDefinition constructor in type.GetConstructors ()) { if (!constructor.HasParameters) continue; -#if NET if (constructor.Parameters.Count != 1 || !constructor.Parameters [0].ParameterType.Is ("ObjCRuntime", "NativeHandle")) -#else - if (constructor.Parameters.Count != 1 || !constructor.Parameters [0].ParameterType.Is ("System", "IntPtr")) -#endif continue; - Annotations.AddPreservedMethod (type, constructor); + modified |= marker.PreserveMethod (type, constructor); break; // only one .ctor can match this } + return modified; } - static bool IsProductMethod (MethodDefinition method) + static bool IsProductMethod (IMarkNSObjects marker, MethodDefinition method) { - return (method.DeclaringType.Module.Assembly.Name.Name == ProductAssembly); + return method.DeclaringType.Module.Assembly.Name.Name == marker.App.Configuration.PlatformAssembly; } - bool IsProductType (TypeDefinition type) + static bool IsProductType (IMarkNSObjects marker, TypeDefinition type) { - if (LinkContext.App.SkipMarkingNSObjectsInUserAssemblies) + if (marker.App.SkipMarkingNSObjectsInUserAssemblies) return true; var name = type.Module.Assembly.Name.Name; - switch (name) { - case "Xamarin.Forms.Platform.iOS": - return true; - case "Xamarin.iOS": - // for Catalyst this has extra stubs and must be considered has _product_ to remove extra binding code - return true; - default: - return name == ProductAssembly; - } + return name == marker.App.Configuration.PlatformAssembly; } } } diff --git a/tools/sharpie/RELEASE.md b/tools/sharpie/RELEASE.md new file mode 100644 index 000000000000..18c80c71b73a --- /dev/null +++ b/tools/sharpie/RELEASE.md @@ -0,0 +1,47 @@ +# Release + +This document describes how to make a new sharpie release. + +We have a single release branch for Objective-Sharpie: `release/sharpie`. + +1. Merge `main` into `release/sharpie` + + The first step to make a release is to merge `main` into `release/sharpie`, + and then push that change. The only difference between the `main` and + `release/sharpie` branches should be the value of the `NUGET_RELEASE_BRANCH` + variable in `Make.config`. + +2. Create a tag for the commit to be released. + + Run `make show-versions` to get the sharpie version. Then: + + ``` + $ git tag sharpie- + $ git push origin sharpie-:sharpie- + ``` + +3. Write release notes + +4. Run the release pipeline + + Note: this can only be done once our pipeline has built the sharpie nupkg, and + published it to a maestro channel (which is done automatically when anything + is pushed to the `release/sharpie` branch). + + Run our [release pipeline](https://dev.azure.com/dnceng/internal/_build?definitionId=1445) + + Set: + + * GitHub repository name: `macios` + * Commit hash to download nupkgs from: the hash of the `release/sharpie` + branch + * Push workload set channel stage: unchecked + * Semi-colon (';') separated list of nugets packages to include: the package + name of the sharpie package. Example: `Sharpie.Bind.Tool.26.3.0.6.nupkg`. + The exact package name will be in the GitHub comment the CI adds to the + commit in question. You can also run `make show-versions` in the root + directory to get the version to use. + +5. Approve the 'Release packs' review / validation for the pipeline. + + You can reject the "Wait to push manifests" review / validation, it's not used for sharpie releases.