diff --git a/.github/aw/actions-lock.json b/.github/aw/actions-lock.json
index 97077a3bc29e..e44fd6da3ec8 100644
--- a/.github/aw/actions-lock.json
+++ b/.github/aw/actions-lock.json
@@ -1,9 +1,26 @@
{
"entries": {
- "github/gh-aw-actions/setup@v0.68.3": {
+ "actions/github-script@v9.0.0": {
+ "repo": "actions/github-script",
+ "version": "v9.0.0",
+ "sha": "3a2844b7e9c422d3c10d287c895573f7108da1b3"
+ },
+ "github/gh-aw-actions/setup@v0.71.1": {
"repo": "github/gh-aw-actions/setup",
- "version": "v0.68.3",
- "sha": "ba90f2186d7ad780ec640f364005fa24e797b360"
+ "version": "v0.71.1",
+ "sha": "239aec45b78c8799417efdd5bc6d8cc036629ec1"
+ }
+ },
+ "containers": {
+ "ghcr.io/github/gh-aw-mcpg:v0.3.0": {
+ "image": "ghcr.io/github/gh-aw-mcpg:v0.3.0",
+ "digest": "sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d",
+ "pinned_image": "ghcr.io/github/gh-aw-mcpg:v0.3.0@sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d"
+ },
+ "ghcr.io/github/github-mcp-server:v1.0.2": {
+ "image": "ghcr.io/github/github-mcp-server:v1.0.2",
+ "digest": "sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba",
+ "pinned_image": "ghcr.io/github/github-mcp-server:v1.0.2@sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba"
}
}
}
diff --git a/.github/skills/fix-random-ci-test-failure/SKILL.md b/.github/skills/fix-random-ci-test-failure/SKILL.md
new file mode 100644
index 000000000000..2d9335b0bb26
--- /dev/null
+++ b/.github/skills/fix-random-ci-test-failure/SKILL.md
@@ -0,0 +1,108 @@
+---
+name: fix-random-ci-test-failure
+description: >-
+ Investigate and fix flaky/random CI test failures in dotnet/macios. Trigger on
+ GitHub issues describing intermittent test failures, CI postmortem issues, or when
+ asked to fix a flaky test. Analyzes test code, identifies root causes
+ (shared state, environment dependencies, race conditions), and applies fixes.
+---
+
+# Fix Random CI Test Failure
+
+Investigate and fix flaky CI test failures reported in GitHub issues for dotnet/macios.
+
+## When to Use
+
+- User shares a GitHub issue about a flaky/intermittent test failure
+- Issue has the `ci-postmortem` label
+- User asks to fix a randomly failing test
+- Test failures appear across unrelated PRs (indicating environment-dependent flakiness)
+
+## Workflow
+
+### 1. Gather Failure Context
+
+Read the GitHub issue to extract:
+- **Test name** and **test suite** (e.g., monotouch-test)
+- **Error message** and **assertion failure details**
+- **Platform** (iOS, macOS, tvOS, Mac Catalyst)
+- **Affected builds** — check if failures span unrelated PRs (confirms flakiness vs. regression)
+
+If build URLs are provided, inspect logs for additional context (stack traces, timing info).
+
+### 2. Locate and Analyze the Test
+
+Find the test source file:
+```
+grep -r "TestMethodName" tests/
+```
+
+Read the **full test method** and all helper methods it calls. Understand:
+- What external resources does it use? (keychain, file system, network, simulators)
+- Does it use shared/hardcoded identifiers that could collide across parallel runs?
+- Does it properly clean up before and after execution?
+- Are there error paths that silently swallow failures?
+
+### 3. Identify Root Cause Category
+
+Common flaky test root causes in this repo:
+
+#### Shared State / Resource Conflicts
+- **Symptom**: Test uses hardcoded identifiers (e.g., fixed keychain entries, file paths, port numbers)
+- **Fix**: Use process-unique identifiers (PID, GUID, bundle ID + test name)
+- **Reference**: `tests/monotouch-test/Security/KeyChainTest.cs` uses per-process unique IDs
+
+#### Environment-Dependent State
+- **Symptom**: Test depends on OS-level state (keychain, permissions, network availability)
+- **Fix**: Add robust setup/teardown, handle unexpected initial states, add retry logic for transient errors
+
+#### Unhandled Error Codes
+- **Symptom**: Code only handles expected success/failure codes, silently fails on unexpected ones
+- **Fix**: Add fallback handling for unexpected status codes, log diagnostic info
+
+#### Race Conditions / Timing
+- **Symptom**: Test passes locally but fails intermittently in CI
+- **Fix**: Add proper synchronization, increase timeouts, avoid timing-dependent assertions
+
+#### LAContext / Authentication Issues (Security tests)
+- **Symptom**: `InvalidRecord` or authentication-related errors on keychain operations
+- **Fix**: Only attach `LAContext` where actually needed (not on plain query/delete operations)
+
+### 4. Apply the Fix
+
+When fixing:
+
+1. **Prefer unique identifiers over shared ones.** Use `Process.GetCurrentProcess ().Id`, `Guid.NewGuid ()`, or `{bundleId}-{testType}-{pid}` patterns for resource identifiers.
+
+2. **Create minimal query records.** For search/delete operations, don't attach unnecessary attributes (like `LAContext`) that can cause intermittent errors.
+
+3. **Handle all status codes.** Never silently return `false` for unexpected error codes. Either handle them with a fallback path or fail with a descriptive assertion message.
+
+4. **Add diagnostic logging.** Use `TestContext.Out.WriteLine` to log operation results that would help diagnose future failures.
+
+5. **Clean up legacy state.** If renaming identifiers, also clean up entries from old names that may linger on CI agents.
+
+6. **Always clean up in `finally` blocks.** Ensure test resources are released even on failure.
+
+### 5. If the Fix is Unclear
+
+If you cannot determine the root cause with available information:
+
+1. **Add diagnostic logging** to capture operation results (status codes, error details) in future failures.
+2. **Log the initial state** at test start (e.g., does the resource already exist before the test runs?).
+3. **Include all relevant status codes** in assertion failure messages.
+4. Explain to the user what additional information the logging will provide and what hypotheses it will help test.
+
+### 6. Create the PR
+
+- Branch naming: `dev/{username}/fix-{test-name}` or similar
+- Commit message should explain all root causes addressed
+- Reference the GitHub issue with `Fixes #NNNN` if the change actually fixes the problem, or `Ref #NNNN` if it only adds logging/diagnostics
+- Add the `copilot` label to the PR
+
+## Key Patterns in This Repo
+
+- Keychain tests in `tests/monotouch-test/Security/` are particularly prone to flakiness due to shared macOS keychain state on CI agents
+- `InitSecRecord` in `RecordTest.cs` attaches `LAContext` to all `SecRecord` instances — this is sometimes unnecessary and can cause `InvalidRecord` errors
+- `KeyChainTest.cs` demonstrates the recommended pattern: per-process unique identifiers using bundle ID + test type + PID
+- Tests run on shared CI agent machines where leftover state from previous runs can cause interference
diff --git a/.github/workflows/macios-reviewer.lock.yml b/.github/workflows/macios-reviewer.lock.yml
index 660a02993332..96544eebf0de 100644
--- a/.github/workflows/macios-reviewer.lock.yml
+++ b/.github/workflows/macios-reviewer.lock.yml
@@ -1,5 +1,5 @@
-# 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"}]}
+# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"a4ffe1d52364aca7fafba9ba975ec40a3f4fc4908801119268fc1812f9b09cbe","compiler_version":"v0.71.1","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":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9"},{"repo":"actions/setup-node","sha":"48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e","version":"v6.4.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"},{"repo":"github/gh-aw-actions/setup","sha":"239aec45b78c8799417efdd5bc6d8cc036629ec1","version":"v0.71.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28","digest":"sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a","pinned_image":"ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28","digest":"sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb","pinned_image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28","digest":"sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474","pinned_image":"ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.0","digest":"sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.0@sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d"},{"image":"ghcr.io/github/github-mcp-server:v1.0.2","digest":"sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba","pinned_image":"ghcr.io/github/github-mcp-server:v1.0.2@sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba"},{"image":"node:lts-alpine","digest":"sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f","pinned_image":"node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f"}]}
# ___ _ _
# / _ \ | | (_)
# | |_| | __ _ ___ _ __ | |_ _ ___
@@ -14,7 +14,7 @@
# \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \
# \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/
#
-# This file was automatically generated by gh-aw (v0.68.3). DO NOT EDIT.
+# This file was automatically generated by gh-aw (v0.71.1). DO NOT EDIT.
#
# To update this file, edit the corresponding .md file and run:
# gh aw compile
@@ -32,17 +32,18 @@
# Custom actions used:
# - actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# - actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
-# - actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+# - actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
+# - actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
# - actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
-# - github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+# - github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
#
# 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
+# - ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a
+# - ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb
+# - ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474
+# - ghcr.io/github/gh-aw-mcpg:v0.3.0@sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d
+# - ghcr.io/github/github-mcp-server:v1.0.2@sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba
+# - node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f
name: ".NET for Apple Platforms PR Reviewer"
"on":
@@ -70,14 +71,13 @@ jobs:
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 }}
+ engine_id: ${{ steps.generate_aw_info.outputs.engine_id }}
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 }}
@@ -89,7 +89,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -100,20 +100,20 @@ jobs:
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_VERSION: "1.0.35"
+ GH_AW_INFO_AGENT_VERSION: "1.0.35"
+ GH_AW_INFO_CLI_VERSION: "v0.71.1"
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_AWF_VERSION: "v0.25.28"
GH_AW_INFO_AWMG_VERSION: ""
GH_AW_INFO_FIREWALL_TYPE: "squid"
GH_AW_COMPILED_STRICT: "true"
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -123,7 +123,7 @@ jobs:
- 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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_REACTION: "eyes"
with:
@@ -145,11 +145,22 @@ jobs:
sparse-checkout: |
.github
.agents
+ .claude
+ .codex
+ .crush
+ .gemini
+ .opencode
sparse-checkout-cone-mode: true
fetch-depth: 1
+ - name: Save agent config folders for base branch restoration
+ env:
+ GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode"
+ GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md opencode.jsonc"
+ # poutine:ignore untrusted_checkout_exec
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/save_base_github_folders.sh"
- name: Check workflow lock file
id: check-lock-file
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_WORKFLOW_FILE: "macios-reviewer.lock.yml"
GH_AW_CONTEXT_WORKFLOW_REF: "${{ github.workflow_ref }}"
@@ -160,9 +171,9 @@ jobs:
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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
- GH_AW_COMPILED_VERSION: "v0.68.3"
+ GH_AW_COMPILED_VERSION: "v0.71.1"
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -171,7 +182,9 @@ jobs:
await main();
- name: Compute current body text
id: sanitized
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
+ env:
+ 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"
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -181,7 +194,7 @@ jobs:
- 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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer"
with:
@@ -257,7 +270,7 @@ jobs:
GH_AW_PROMPT_31522cd090dd3137_EOF
} > "$GH_AW_PROMPT"
- name: Interpolate variables and render templates
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
with:
@@ -267,7 +280,7 @@ jobs:
const { main } = require('${{ runner.temp }}/gh-aw/actions/interpolate_prompt.cjs');
await main();
- name: Substitute placeholders
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_PROMPT: /tmp/gh-aw/aw-prompts/prompt.txt
GH_AW_GITHUB_ACTOR: ${{ github.actor }}
@@ -324,6 +337,7 @@ jobs:
/tmp/gh-aw/aw_info.json
/tmp/gh-aw/aw-prompts/prompt.txt
/tmp/gh-aw/github_rate_limits.jsonl
+ /tmp/gh-aw/base
if-no-files-found: ignore
retention-days: 1
@@ -355,7 +369,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -395,7 +409,7 @@ jobs:
id: checkout-pr
if: |
github.event.pull_request || github.event.issue.pull_request
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_TOKEN: ${{ secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
with:
@@ -406,11 +420,11 @@ jobs:
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
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.35
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.28
- name: Parse integrity filter lists
id: parse-guard-vars
env:
@@ -418,8 +432,19 @@ jobs:
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 activation artifact
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
+ with:
+ name: activation
+ path: /tmp/gh-aw
+ - name: Restore agent config folders from base branch
+ if: steps.checkout-pr.outcome == 'success'
+ env:
+ GH_AW_AGENT_FOLDERS: ".agents .claude .codex .crush .gemini .github .opencode"
+ GH_AW_AGENT_FILES: ".crush.json AGENTS.md CLAUDE.md GEMINI.md opencode.jsonc"
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/restore_base_github_folders.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
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474 ghcr.io/github/gh-aw-mcpg:v0.3.0@sha256:9c2228324fb1f26f39dc9471612e530ae3efc3156dac05efb2e8d212878d454d ghcr.io/github/github-mcp-server:v1.0.2@sha256:26db03408086a99cf1916348dcc4f9614206658f9082a8060dc7c81ad787f4ba node:lts-alpine@sha256:d1b3b4da11eefd5941e7f0b9cf17783fc99d9c6fc34884a665f40a06dbdfc94f
- name: Write Safe Outputs Config
run: |
mkdir -p "${RUNNER_TEMP}/gh-aw/safeoutputs"
@@ -570,7 +595,7 @@ jobs:
}
}
}
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -626,10 +651,10 @@ jobs:
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
+ mkdir -p "${RUNNER_TEMP}/gh-aw/mcp-config"
# Export gateway environment variables for MCP config and gateway script
- export MCP_GATEWAY_PORT="80"
+ export MCP_GATEWAY_PORT="8080"
export MCP_GATEWAY_DOMAIN="host.docker.internal"
MCP_GATEWAY_API_KEY=$(openssl rand -base64 45 | tr -d '/+=')
echo "::add-mask::${MCP_GATEWAY_API_KEY}"
@@ -640,15 +665,19 @@ jobs:
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'
+ MCP_GATEWAY_UID=$(id -u 2>/dev/null || echo '0')
+ MCP_GATEWAY_GID=$(id -g 2>/dev/null || echo '0')
+ DOCKER_SOCK_GID=$(stat -c '%g' /var/run/docker.sock 2>/dev/null || echo '0')
+ export MCP_GATEWAY_DOCKER_COMMAND='docker run -i --rm --network host --add-host host.docker.internal:127.0.0.1 --user '"${MCP_GATEWAY_UID}"':'"${MCP_GATEWAY_GID}"' --group-add '"${DOCKER_SOCK_GID}"' -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.3.0'
mkdir -p /home/runner/.copilot
- cat << GH_AW_MCP_CONFIG_8d4f4bdb31699167_EOF | bash "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.sh"
+ GH_AW_NODE=$(which node 2>/dev/null || command -v node 2>/dev/null || echo node)
+ cat << GH_AW_MCP_CONFIG_8d4f4bdb31699167_EOF | "$GH_AW_NODE" "${RUNNER_TEMP}/gh-aw/actions/start_mcp_gateway.cjs"
{
"mcpServers": {
"github": {
"type": "stdio",
- "container": "ghcr.io/github/github-mcp-server:v0.32.0",
+ "container": "ghcr.io/github/github-mcp-server:v1.0.2",
"env": {
"GITHUB_HOST": "\${GITHUB_SERVER_URL}",
"GITHUB_PERSONAL_ACCESS_TOKEN": "\${GITHUB_MCP_SERVER_TOKEN}",
@@ -688,11 +717,6 @@ jobs:
}
}
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"
@@ -703,21 +727,25 @@ jobs:
run: |
set -o pipefail
touch /tmp/gh-aw/agent-step-summary.md
+ GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true)
+ export GH_AW_NODE_BIN
(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
+ 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 --allow-host-ports 80,443,8080 --image-tag 0.25.28,squid=sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474,agent=sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a,api-proxy=sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb,cli-proxy=sha256:fdf310e4678ce58d248c466b89399e9680a3003038fd19322c388559016aaac7 --skip-pull --enable-api-proxy \
+ -- /bin/bash -c 'GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${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-file /tmp/gh-aw/aw-prompts/prompt.txt' 2>&1 | tee -a /tmp/gh-aw/agent-stdio.log
env:
COPILOT_AGENT_RUNNER_TYPE: STANDALONE
+ COPILOT_API_KEY: dummy-byok-key-for-offline-mode
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
+ GH_AW_VERSION: v0.71.1
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
+ GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
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 }}
@@ -762,7 +790,7 @@ jobs:
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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -788,7 +816,7 @@ jobs:
- name: Ingest agent output
id: collect_output
if: always()
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 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"
@@ -803,7 +831,7 @@ jobs:
await main();
- name: Parse agent logs for step summary
if: always()
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_AGENT_OUTPUT: /tmp/gh-aw/sandbox/agent/logs/
with:
@@ -815,7 +843,7 @@ jobs:
- name: Parse MCP Gateway logs for step summary
if: always()
id: parse-mcp-gateway
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -828,9 +856,9 @@ jobs:
env:
AWF_LOGS_DIR: /tmp/gh-aw/sandbox/firewall/logs
run: |
- # Fix permissions on firewall logs so they can be uploaded as artifacts
+ # Fix permissions on firewall logs/audit dirs 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
+ sudo chmod -R a+r /tmp/gh-aw/sandbox/firewall 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"
@@ -840,7 +868,7 @@ jobs:
- name: Parse token usage for step summary
if: always()
continue-on-error: true
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
with:
script: |
const { setupGlobals } = require('${{ runner.temp }}/gh-aw/actions/setup_globals.cjs');
@@ -902,7 +930,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -923,7 +951,7 @@ jobs:
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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
GH_AW_NOOP_MAX: "1"
@@ -940,7 +968,7 @@ jobs:
await main();
- name: Log detection run
id: detection_runs
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 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"
@@ -956,7 +984,7 @@ jobs:
await main();
- name: Record missing tool
id: missing_tool
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
GH_AW_MISSING_TOOL_CREATE_ISSUE: "true"
@@ -970,7 +998,7 @@ jobs:
await main();
- name: Record incomplete
id: report_incomplete
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_AGENT_OUTPUT: ${{ steps.setup-agent-output-env.outputs.GH_AW_AGENT_OUTPUT }}
GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true"
@@ -985,13 +1013,14 @@ jobs:
- name: Handle agent failure
id: handle_agent_failure
if: always()
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 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_ACTION_FAILURE_ISSUE_EXPIRES_HOURS: "168"
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 }}
@@ -1013,7 +1042,7 @@ jobs:
await main();
- name: Update reaction comment with completion status
id: conclusion
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 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 }}
@@ -1047,7 +1076,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1077,7 +1106,7 @@ jobs:
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
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/download_docker_images.sh" ghcr.io/github/gh-aw-firewall/agent:0.25.28@sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a ghcr.io/github/gh-aw-firewall/api-proxy:0.25.28@sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb ghcr.io/github/gh-aw-firewall/squid:0.25.28@sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474
- name: Check if detection needed
id: detection_guard
if: always()
@@ -1095,7 +1124,7 @@ jobs:
- 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 "${RUNNER_TEMP}/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
@@ -1114,7 +1143,7 @@ jobs:
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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer"
WORKFLOW_DESCRIPTION: "No description provided"
@@ -1130,12 +1159,17 @@ jobs:
run: |
mkdir -p /tmp/gh-aw/threat-detection
touch /tmp/gh-aw/threat-detection/detection.log
+ - name: Setup Node.js
+ uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
+ with:
+ node-version: '24'
+ package-manager-cache: false
- name: Install GitHub Copilot CLI
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.21
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_copilot_cli.sh" 1.0.35
env:
GH_HOST: github.com
- name: Install AWF binary
- run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.20
+ run: bash "${RUNNER_TEMP}/gh-aw/actions/install_awf_binary.sh" v0.25.28
- name: Execute GitHub Copilot CLI
if: always() && steps.detection_guard.outputs.run_detection == 'true'
id: detection_agentic_execution
@@ -1144,19 +1178,23 @@ jobs:
run: |
set -o pipefail
touch /tmp/gh-aw/agent-step-summary.md
+ GH_AW_NODE_BIN=$(command -v node 2>/dev/null || true)
+ export GH_AW_NODE_BIN
(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
+ 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 --allow-host-ports 80,443,8080 --image-tag 0.25.28,squid=sha256:844c18280f82cd1b06345eb2f4e91966b34185bfc51c9f237c3e022e848fb474,agent=sha256:a8834e285807654bf680154faa710d43fe4365a0868142f5c20e48c85e137a7a,api-proxy=sha256:93290f2393752252911bd7c39a047f776c0b53063575e7bde4e304962a9a61cb,cli-proxy=sha256:fdf310e4678ce58d248c466b89399e9680a3003038fd19322c388559016aaac7 --skip-pull --enable-api-proxy \
+ -- /bin/bash -c 'GH_AW_NODE_EXEC="${GH_AW_NODE_BIN:-}"; if [ -z "$GH_AW_NODE_EXEC" ] || [ ! -x "$GH_AW_NODE_EXEC" ]; then GH_AW_NODE_EXEC="$(command -v node 2>/dev/null || echo node)"; fi; "$GH_AW_NODE_EXEC" ${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-file /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_API_KEY: dummy-byok-key-for-offline-mode
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
+ GH_AW_VERSION: v0.71.1
GITHUB_API_URL: ${{ github.api_url }}
GITHUB_AW: true
+ GITHUB_COPILOT_INTEGRATION_ID: agentic-workflows
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_SERVER_URL: ${{ github.server_url }}
@@ -1177,7 +1215,7 @@ jobs:
- name: Parse and conclude threat detection
id: detection_conclusion
if: always()
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
RUN_DETECTION: ${{ steps.detection_guard.outputs.run_detection }}
GH_AW_DETECTION_CONTINUE_ON_ERROR: "true"
@@ -1198,13 +1236,13 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
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
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_REQUIRED_ROLES: "admin,maintainer,write"
with:
@@ -1216,7 +1254,7 @@ jobs:
await main();
- name: Check command position
id: check_command_position
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
env:
GH_AW_COMMANDS: "[\"review\"]"
with:
@@ -1244,6 +1282,7 @@ jobs:
GH_AW_EFFECTIVE_TOKENS: ${{ needs.agent.outputs.effective_tokens }}
GH_AW_ENGINE_ID: "copilot"
GH_AW_ENGINE_MODEL: "claude-sonnet-4.5"
+ GH_AW_ENGINE_VERSION: "1.0.35"
GH_AW_WORKFLOW_ID: "macios-reviewer"
GH_AW_WORKFLOW_NAME: ".NET for Apple Platforms PR Reviewer"
outputs:
@@ -1256,7 +1295,7 @@ jobs:
steps:
- name: Setup Scripts
id: setup
- uses: github/gh-aw-actions/setup@ba90f2186d7ad780ec640f364005fa24e797b360 # v0.68.3
+ uses: github/gh-aw-actions/setup@239aec45b78c8799417efdd5bc6d8cc036629ec1 # v0.71.1
with:
destination: ${{ runner.temp }}/gh-aw/actions
job-name: ${{ github.job }}
@@ -1286,7 +1325,7 @@ jobs:
echo "GH_HOST=${GH_HOST}" >> "$GITHUB_ENV"
- name: Process Safe Outputs
id: process_safe_outputs
- uses: actions/github-script@373c709c69115d41ff229c7e5df9f8788daa9553 # v9
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # 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"
diff --git a/Makefile b/Makefile
index 0dcd1bcd2fa1..f60d19b26180 100644
--- a/Makefile
+++ b/Makefile
@@ -98,4 +98,3 @@ git-clean-all:
@echo "Done"
SUBDIRS += tests
-
diff --git a/NuGet.config b/NuGet.config
index 16e5efc02d96..e2a0475c4a3b 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -10,6 +10,7 @@
+
diff --git a/README.md b/README.md
index 5222508613f6..6ee9d03482fd 100644
--- a/README.md
+++ b/README.md
@@ -42,15 +42,21 @@ If you are interested in fixing issues and contributing directly to the code bas
## Downloads
-The preferred method for installing Xamarin.iOS and Mac is to use the Visual Studio installers ([Windows](https://docs.microsoft.com/xamarin/ios/get-started/installation/windows/?pivots=windows), [Mac](https://docs.microsoft.com/visualstudio/mac/installation?view=vsmac-2019)).
+Install the .NET workloads for Apple platforms using the .NET CLI:
-The team also [strongly recommends](https://docs.microsoft.com/xamarin/ios/troubleshooting/questions/old-version-xcode) using the latest Xamarin SDK and Xcode whenever possible.
+```sh
+dotnet workload install ios macos tvos maccatalyst
+```
-However, we provide links to older Xamarin.iOS and Mac packages for macOS downgrades and build machine configuration, see [Downloads](DOWNLOADS.md).
+For more information, see the [.NET workload documentation][workload-docs].
+
+For legacy Xamarin.iOS and Xamarin.Mac downloads (discontinued), see [Downloads](DOWNLOADS.md).
+
+[workload-docs]: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload-install
## Feedback
-- Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/xamarin.ios) or the [Xamarin Forums](https://learn.microsoft.com/en-us/answers/tags/18/xamarin)
+- [File an issue or ask a question](https://github.com/dotnet/macios/issues) on GitHub
- [Request a new feature](https://github.com/dotnet/macios/wiki/Submitting-Bugs-&-Suggestions#writing-good-bug-reports-and-feature-requests) on GitHub
- [Vote on existing feature requests](https://github.com/dotnet/macios/wiki/Submitting-Bugs-&-Suggestions#before-submitting-an-issue)
- [Submit bugs to GitHub Issues](https://github.com/dotnet/macios/wiki/Submitting-Bugs-&-Suggestions)
diff --git a/dotnet/targets/Xamarin.Shared.Sdk.targets b/dotnet/targets/Xamarin.Shared.Sdk.targets
index 6e2e0c4b4a8b..670fe72a8864 100644
--- a/dotnet/targets/Xamarin.Shared.Sdk.targets
+++ b/dotnet/targets/Xamarin.Shared.Sdk.targets
@@ -554,7 +554,10 @@
-
+
-
+
@@ -601,6 +613,8 @@
true
+ $(_TypeMapAssemblyName)
+
+ <_IsTrimmableStaticRegistrarFeature Condition="'$(Registrar)' == 'trimmable-static'">true
+ <_IsTrimmableStaticRegistrarFeature Condition="'$(Registrar)' != 'trimmable-static'">false
+
<_IsNativeAOTFeature Condition="'$(_XamarinRuntime)' == 'NativeAOT'">true
<_IsNativeAOTFeature Condition="'$(_XamarinRuntime)' != 'NativeAOT'">false
@@ -691,6 +709,8 @@
SkipMarkingNSObjectsInUserAssemblies=$(_SkipMarkingNSObjectsInUserAssemblies)
TargetArchitectures=$(TargetArchitectures)
TargetFramework=$(_ComputedTargetFrameworkMoniker)
+ TypeMapAssemblyName=$(_TypeMapAssemblyName)
+ TypeMapOutputDirectory=$(_TypeMapOutputDirectory)
UseLlvm=$(MtouchUseLlvm)
Verbosity=$(_BundlerVerbosity)
Warn=$(_BundlerWarn)
@@ -773,6 +793,7 @@
+
@@ -810,7 +831,8 @@
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.RegistrarRemovalTrackingStep" />
<_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true'" Type="Xamarin.Linker.Steps.PreMarkDispatcher" />
- <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.ManagedRegistrarStep" Condition="'$(Registrar)' == 'managed-static'" />
+ <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.ManagedRegistrarStep" Condition="'$(Registrar)' == 'managed-static' Or '$(Registrar)' == 'trimmable-static'" />
+ <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.TrimmableRegistrarStep" Condition="'$(Registrar)' == 'trimmable-static'" />
<_UnmanagedEntryPointsAssembliesToAdd Include="@(_UpdatedManagedAssemblyToLink->'%(Filename)')" />
diff --git a/eng/Version.Details.props b/eng/Version.Details.props
index da51f16a7df7..305a7ba797aa 100644
--- a/eng/Version.Details.props
+++ b/eng/Version.Details.props
@@ -4,53 +4,53 @@ Do not edit it manually, as it will get overwritten by automation.
This file should be imported by eng/Versions.props
-->
-
-
- 11.0.0-beta.26229.113
- 11.0.0-beta.26229.113
- 0.11.5-preview.26229.113
- 11.0.0-beta.26229.113
- 11.0.0-preview.5.26229.113
- 11.0.0-preview.5.26229.113
- 11.0.0-preview.5.26229.113
- 11.0.100-preview.5.26229.113
- 11.0.0-preview.5.26229.113
- 11.0.100-preview.5.26229.113
-
- 26.0.11017
- 26.4.10259
- 26.0.11017
- 26.4.10259
- 26.0.11017
- 26.4.10259
- 26.0.11017
- 26.4.10259
-
- 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)
-
+
+
+ 11.0.0-beta.26229.113
+ 11.0.0-beta.26229.113
+ 0.11.5-preview.26229.113
+ 11.0.0-beta.26229.113
+ 11.0.0-preview.5.26229.113
+ 11.0.0-preview.5.26229.113
+ 11.0.0-preview.5.26229.113
+ 11.0.100-preview.5.26229.113
+ 11.0.0-preview.5.26229.113
+ 11.0.100-preview.5.26229.113
+
+ 26.0.11017
+ 26.4.10259
+ 26.0.11017
+ 26.4.10259
+ 26.0.11017
+ 26.4.10259
+ 26.0.11017
+ 26.4.10259
+
+ 11.0.0-prerelease.26224.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)
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 8a9be39bd6d5..071736f6b80c 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -73,9 +73,9 @@
https://github.com/dotnet/dotnet
4c4e7f410fc876590f219fc6022b6c18d6f6a475
-
+
https://github.com/dotnet/xharness
- 866707736d49c2323628744716cda2475b3af9ee
+ 888ef3e553a0716745ecab689e13b816639b5a5a
https://github.com/dotnet/dotnet
diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.props b/msbuild/Xamarin.Shared/Xamarin.Shared.props
index 4b2c9b8173b7..01c764d59679 100644
--- a/msbuild/Xamarin.Shared/Xamarin.Shared.props
+++ b/msbuild/Xamarin.Shared/Xamarin.Shared.props
@@ -224,6 +224,10 @@ Copyright (C) 2020 Microsoft. All rights reserved.
<_NativeExecutableName Condition="'$(_NativeExecutableName)' == ''">$(AssemblyName)
+
+
+ <_TypeMapAssemblyName Condition="'$(_TypeMapAssemblyName)' == ''">_Microsoft.$(_PlatformName).TypeMaps
+ <_TypeMapOutputDirectory Condition="'$(_TypeMapOutputDirectory)' == ''">$(DeviceSpecificIntermediateOutputPath)typemap\
diff --git a/msbuild/Xamarin.Shared/Xamarin.Shared.targets b/msbuild/Xamarin.Shared/Xamarin.Shared.targets
index ffc82202b601..241e6635c950 100644
--- a/msbuild/Xamarin.Shared/Xamarin.Shared.targets
+++ b/msbuild/Xamarin.Shared/Xamarin.Shared.targets
@@ -2611,20 +2611,27 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<_ComputeLinkModeDependsOn>
$(_ComputeLinkModeDependsOn);
- _DetectSdkLocations;
-
+
-
- <_AssembliesWithCustomTrimMode>@(ManagedAssemblyToLink->HasMetadata('TrimMode')->Count())
- <_AssembliesWithCopyTrimMode>@(ManagedAssemblyToLink->WithMetadataValue('TrimMode', 'copy')->Count())
- <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(TrimMode)' == 'copy' And '$(_AssembliesWithCustomTrimMode)' == '$(_AssembliesWithCopyTrimMode)'">false
- <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == ''">true
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(_UseNativeAot)' == 'true'">true
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(TrimMode)' == 'full'">true
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(TrimMode)' == 'partial'">true
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(TrimMode)' == 'copy'">false
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == '' And '$(TrimMode)' == 'link'">true
+
+
+ <_AreAnyAssembliesTrimmed Condition="'$(_AreAnyAssembliesTrimmed)' == ''">false
diff --git a/runtime/Delegates.cs.t4 b/runtime/Delegates.cs.t4
index c113d2935358..3ad9caacd8e7 100644
--- a/runtime/Delegates.cs.t4
+++ b/runtime/Delegates.cs.t4
@@ -72,7 +72,7 @@ namespace ObjCRuntime {
Write ("\t\t\tif (IsCoreCLR) {\n\t");
}
if (d.SkipManagedStaticRegistrar) {
- Write ("\t\t\tif (!Runtime.IsManagedStaticRegistrar) {\n\t");
+ Write ("\t\t\tif (!Runtime.IsManagedStaticRegistrar && !Runtime.IsTrimmableStaticRegistrar) {\n\t");
}
#>
options->Delegates-><#= d.SimpleEntryPoint #> = (IntPtr) (void *) <#= d.UnmanagedDelegateCast #> &<#= d.SimpleEntryPoint #>;
diff --git a/runtime/delegates.t4 b/runtime/delegates.t4
index 783a278042fe..42bd87081b07 100644
--- a/runtime/delegates.t4
+++ b/runtime/delegates.t4
@@ -674,7 +674,8 @@
new XDelegate ("void *", "IntPtr", "xamarin_lookup_unmanaged_function",
"const char *", "IntPtr", "assembly",
"const char *", "IntPtr", "symbol",
- "int32_t", "int", "id"
+ "int32_t", "int", "id",
+ "const char *", "IntPtr", "objcClassName"
) {
WrappedManagedFunction = "LookupUnmanagedFunction",
},
diff --git a/runtime/runtime.m b/runtime/runtime.m
index 106650caf60c..74ad2e77af44 100644
--- a/runtime/runtime.m
+++ b/runtime/runtime.m
@@ -137,7 +137,7 @@
enum InitializationFlags : int {
InitializationFlagsIsPartialStaticRegistrar = 0x01,
InitializationFlagsIsManagedStaticRegistrar = 0x02,
- /* unused = 0x04,*/
+ InitializationFlagsIsTrimmableStaticRegistrar = 0x04,
/* unused = 0x08,*/
InitializationFlagsIsSimulator = 0x10,
InitializationFlagsIsCoreCLR = 0x20,
@@ -2642,7 +2642,7 @@ -(struct NSObjectData*) xamarinGetNSObjectData;
}
void
-xamarin_registrar_dlsym (void **function_pointer, const char *assembly, const char *symbol, int32_t id)
+xamarin_registrar_dlsym (void **function_pointer, const char *assembly, const char *symbol, int32_t id, const char* objcClassName)
{
if (*function_pointer != NULL)
return;
@@ -2652,7 +2652,7 @@ -(struct NSObjectData*) xamarinGetNSObjectData;
return;
GCHandle exception_gchandle = INVALID_GCHANDLE;
- *function_pointer = xamarin_lookup_unmanaged_function (assembly, symbol, id, &exception_gchandle);
+ *function_pointer = xamarin_lookup_unmanaged_function (assembly, symbol, id, objcClassName, &exception_gchandle);
if (*function_pointer != NULL)
return;
@@ -3142,6 +3142,16 @@ -(struct NSObjectData*) xamarinGetNSObjectData
}
}
+void
+xamarin_set_is_trimmable_static_registrar (bool value)
+{
+ if (value) {
+ options.flags = (InitializationFlags) (options.flags | InitializationFlagsIsTrimmableStaticRegistrar);
+ } else {
+ options.flags = (InitializationFlags) (options.flags & ~InitializationFlagsIsTrimmableStaticRegistrar);
+ }
+}
+
bool
xamarin_is_managed_exception_marshaling_disabled ()
{
diff --git a/runtime/xamarin/runtime.h b/runtime/xamarin/runtime.h
index 5323ffe95a51..fd5c697efff5 100644
--- a/runtime/xamarin/runtime.h
+++ b/runtime/xamarin/runtime.h
@@ -256,6 +256,7 @@ void xamarin_check_objc_type (id obj, Class expected_class, SEL sel, id self,
#endif
void xamarin_set_is_managed_static_registrar (bool value);
+void xamarin_set_is_trimmable_static_registrar (bool value);
void xamarin_process_nsexception (NSException *exc);
void xamarin_process_nsexception_using_mode (NSException *ns_exception, bool throwManagedAsDefault, GCHandle *output_exception);
@@ -308,7 +309,7 @@ bool xamarin_is_user_type (Class cls);
* symbol: the symbol to look up. Can be NULL to save space (this value isn't used except in error messages).
* id: a numerical id for faster lookup (than doing string comparisons on the symbol name).
*/
-void xamarin_registrar_dlsym (void **function_pointer, const char *assembly, const char *symbol, int32_t id);
+void xamarin_registrar_dlsym (void **function_pointer, const char *assembly, const char *symbol, int32_t id, const char* objcClassName);
/*
* Wrapper GCHandle functions that takes pointer sized handles instead of ints,
diff --git a/src/AppKit/NSControlTextEditingEventArgs.cs b/src/AppKit/NSControlTextEditingEventArgs.cs
new file mode 100644
index 000000000000..9dfb384b7531
--- /dev/null
+++ b/src/AppKit/NSControlTextEditingEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSControlTextEditingEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public NSTextView? FieldEditor {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSFieldEditor");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSMenuItemEventArgs.cs b/src/AppKit/NSMenuItemEventArgs.cs
new file mode 100644
index 000000000000..2a7a17669e8a
--- /dev/null
+++ b/src/AppKit/NSMenuItemEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSMenuItemEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public NSMenu? MenuItem {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("MenuItem");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSMenuItemIndexEventArgs.cs b/src/AppKit/NSMenuItemIndexEventArgs.cs
new file mode 100644
index 000000000000..18a7adb56b9a
--- /dev/null
+++ b/src/AppKit/NSMenuItemIndexEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSMenuItemIndexEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint MenuItemIndex {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSMenuItemIndex");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSOutlineViewItemEventArgs.cs b/src/AppKit/NSOutlineViewItemEventArgs.cs
new file mode 100644
index 000000000000..6689a784cd50
--- /dev/null
+++ b/src/AppKit/NSOutlineViewItemEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSOutlineViewItemEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public Foundation.NSObject? Item {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSObject");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSTextAlternativesSelectedAlternativeStringEventArgs.cs b/src/AppKit/NSTextAlternativesSelectedAlternativeStringEventArgs.cs
new file mode 100644
index 000000000000..a7cafe7256aa
--- /dev/null
+++ b/src/AppKit/NSTextAlternativesSelectedAlternativeStringEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSTextAlternativesSelectedAlternativeStringEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public string? AlternativeString {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSAlternativeString");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return CoreFoundation.CFString.FromHandle (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSTextDidEndEditingEventArgs.cs b/src/AppKit/NSTextDidEndEditingEventArgs.cs
new file mode 100644
index 000000000000..64d2e5883a6f
--- /dev/null
+++ b/src/AppKit/NSTextDidEndEditingEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSTextDidEndEditingEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint Movement {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSTextMovement");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSTextViewDidChangeSelectionEventArgs.cs b/src/AppKit/NSTextViewDidChangeSelectionEventArgs.cs
new file mode 100644
index 000000000000..2d0665dd98f8
--- /dev/null
+++ b/src/AppKit/NSTextViewDidChangeSelectionEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSTextViewDidChangeSelectionEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public Foundation.NSValue? OldSelectedCharacterRange {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSOldSelectedCharacterRange");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs b/src/AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs
new file mode 100644
index 000000000000..ff3e1690a0b3
--- /dev/null
+++ b/src/AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSTextViewWillChangeNotifyingTextViewEventArgs : NSNotificationEventArgs {
+ // These properties need manual bindings, because they're not using constant string values,
+ // they're using literal string values (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public NSTextView? OldView {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSOldNotifyingTextView");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public NSTextView? NewView {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSNewNotifyingTextView");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSViewColumnMoveEventArgs.cs b/src/AppKit/NSViewColumnMoveEventArgs.cs
new file mode 100644
index 000000000000..4e92648a349b
--- /dev/null
+++ b/src/AppKit/NSViewColumnMoveEventArgs.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSViewColumnMoveEventArgs : NSNotificationEventArgs {
+ // These properties need manual bindings, because they're not using constant string values,
+ // they're using literal string values (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint OldColumn {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSOldColumn");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint NewColumn {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSNewColumn");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSViewColumnResizeEventArgs.cs b/src/AppKit/NSViewColumnResizeEventArgs.cs
new file mode 100644
index 000000000000..afeed8cf851e
--- /dev/null
+++ b/src/AppKit/NSViewColumnResizeEventArgs.cs
@@ -0,0 +1,36 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSViewColumnResizeEventArgs : NSNotificationEventArgs {
+ // These properties need manual bindings, because they're not using constant string values,
+ // they're using literal string values (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public NSTableColumn? Column {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return null;
+
+ using var key = new TransientCFString ("NSTableColumn");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value);
+ }
+ }
+
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint OldWidth {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSOldWidth");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/AppKit/NSWorkspaceFileOperationEventArgs.cs b/src/AppKit/NSWorkspaceFileOperationEventArgs.cs
new file mode 100644
index 000000000000..999df713aade
--- /dev/null
+++ b/src/AppKit/NSWorkspaceFileOperationEventArgs.cs
@@ -0,0 +1,23 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !__MACCATALYST__
+namespace AppKit;
+
+partial class NSWorkspaceFileOperationEventArgs : NSNotificationEventArgs {
+ // This property needs a manual binding, because it's not using a constant string value,
+ // it's using a literal string value (as per Apple's documentation).
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ public nint FileType {
+ get {
+ var userinfo = Notification.UserInfo;
+ if (userinfo is null)
+ return 0;
+
+ using var key = new TransientCFString ("NSOperationNumber");
+ var value = userinfo.LowlevelObjectForKey (key);
+ return Runtime.GetNSObject (value)?.NIntValue ?? 0;
+ }
+ }
+}
+#endif // !__MACCATALYST__
diff --git a/src/CoreML/MLModelCollection.cs b/src/CoreML/MLModelCollection.cs
new file mode 100644
index 000000000000..35f2b33e2cfc
--- /dev/null
+++ b/src/CoreML/MLModelCollection.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System.ComponentModel;
+
+#nullable enable
+
+namespace CoreML;
+
+#if !XAMCORE_5_0 && !__TVOS__
+partial class MLModelCollection : NSObject {
+ /// This property always returns .
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This property always returns null.")]
+ public static NSString? DidChangeNotification {
+ get {
+ return null;
+ }
+ }
+
+ public static partial class Notifications {
+ /// This method does nothing, and only returns a placeholder instance.
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This method does nothing.")]
+ public static NSObject ObserveDidChange (EventHandler handler)
+ {
+ return new NSObject ();
+ }
+
+ /// This method does nothing, and only returns a placerholder instance.
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This method does nothing.")]
+ public static NSObject ObserveDidChange (NSObject objectToObserve, EventHandler handler)
+ {
+ return new NSObject ();
+ }
+ }
+}
+#endif // !XAMCORE_5_0 && !__TVOS__
+
diff --git a/src/Foundation/NSObject2.cs b/src/Foundation/NSObject2.cs
index 67db516a5cec..f27d8abdd8fb 100644
--- a/src/Foundation/NSObject2.cs
+++ b/src/Foundation/NSObject2.cs
@@ -373,6 +373,10 @@ public void Dispose ()
[UnconditionalSuppressMessage ("", "IL2072", Justification = "The APIs this method tries to access are marked by other means, so this is linker-safe.")]
internal static IntPtr CreateNSObject (IntPtr type_gchandle, IntPtr handle, Flags flags)
{
+ // This method should never be called when using the trimmable static registrar, so assert that never happens by throwing an exception in that case.
+ if (Runtime.IsTrimmableStaticRegistrar)
+ throw new System.Diagnostics.UnreachableException ();
+
// Note that the code in this method doesn't necessarily work with NativeAOT, so assert that never happens by throwing an exception if using the managed static registrar (which is required for NativeAOT)
if (Runtime.IsManagedStaticRegistrar) {
throw new System.Diagnostics.UnreachableException ();
diff --git a/src/ILLink.Substitutions.MacCatalyst.xml b/src/ILLink.Substitutions.MacCatalyst.xml
index 0b0f7e6d032b..da45aabaf46c 100644
--- a/src/ILLink.Substitutions.MacCatalyst.xml
+++ b/src/ILLink.Substitutions.MacCatalyst.xml
@@ -10,6 +10,8 @@
+
+
diff --git a/src/ILLink.Substitutions.iOS.xml b/src/ILLink.Substitutions.iOS.xml
index 6daa15a685fe..3436035d8aff 100644
--- a/src/ILLink.Substitutions.iOS.xml
+++ b/src/ILLink.Substitutions.iOS.xml
@@ -12,6 +12,8 @@
+
+
diff --git a/src/ILLink.Substitutions.macOS.xml b/src/ILLink.Substitutions.macOS.xml
index 6ebaaeb61271..d93fac786837 100644
--- a/src/ILLink.Substitutions.macOS.xml
+++ b/src/ILLink.Substitutions.macOS.xml
@@ -9,6 +9,8 @@
+
+
diff --git a/src/ILLink.Substitutions.tvOS.xml b/src/ILLink.Substitutions.tvOS.xml
index 2ef886730f0f..7131bcf39363 100644
--- a/src/ILLink.Substitutions.tvOS.xml
+++ b/src/ILLink.Substitutions.tvOS.xml
@@ -12,6 +12,8 @@
+
+
diff --git a/src/ObjCRuntime/Blocks.cs b/src/ObjCRuntime/Blocks.cs
index e492ab7307cc..be694cb1c7eb 100644
--- a/src/ObjCRuntime/Blocks.cs
+++ b/src/ObjCRuntime/Blocks.cs
@@ -511,6 +511,10 @@ public static bool IsManagedBlock (IntPtr block)
[UnconditionalSuppressMessage ("", "IL2072", Justification = "The APIs this method tries to access are marked by other means, so this is linker-safe.")]
static Type? GetDelegateProxyType (MethodInfo minfo, uint token_ref, out MethodInfo? baseMethod)
{
+ // This method should never be called when using the trimmable static registrar, so assert that never happens by throwing an exception in that case.
+ if (Runtime.IsTrimmableStaticRegistrar)
+ throw new System.Diagnostics.UnreachableException ();
+
// Note that the code in this method doesn't necessarily work with NativeAOT, so assert that never happens by throwing an exception if using the managed static registrar (which is required for NativeAOT)
if (Runtime.IsManagedStaticRegistrar)
throw new System.Diagnostics.UnreachableException ();
@@ -610,6 +614,10 @@ static IntPtr CreateBlockForDelegate (Delegate @delegate, Delegate delegateProxy
[UnconditionalSuppressMessage ("", "IL2075", Justification = "The APIs this method tries to access are marked by other means, so this is linker-safe.")]
internal static IntPtr GetBlockForDelegate (MethodInfo minfo, object? @delegate, uint token_ref, string? signature)
{
+ // This method should never be called when using the trimmable static registrar, so assert that never happens by throwing an exception in that case.
+ if (Runtime.IsTrimmableStaticRegistrar)
+ throw new System.Diagnostics.UnreachableException ();
+
// Note that the code in this method doesn't necessarily work with NativeAOT, so assert that never happens by throwing an exception if using the managed static registrar (which is required for NativeAOT)
if (Runtime.IsManagedStaticRegistrar)
throw new System.Diagnostics.UnreachableException ();
diff --git a/src/ObjCRuntime/Class.cs b/src/ObjCRuntime/Class.cs
index 819122f30246..525649662392 100644
--- a/src/ObjCRuntime/Class.cs
+++ b/src/ObjCRuntime/Class.cs
@@ -6,12 +6,14 @@
//
// #define LOG_TYPELOAD
+// #define LOG_TRIMMABLE_TYPEMAP
#nullable enable
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Collections.Generic;
+using System.Linq;
using System.Runtime.CompilerServices;
#if !COREBUILD
@@ -313,6 +315,36 @@ static string GetAssemblyName (Assembly assembly)
// Find the given managed type in the tables generated by the static registrar.
unsafe static IntPtr FindClass (Type type, out bool is_custom_type)
{
+ if (Runtime.IsTrimmableStaticRegistrar) {
+ if (TypeMaps.TryGetNSObjectProxyAttribute (type, out var proxyAttribute)) {
+ var rv = proxyAttribute.GetClassHandle (out is_custom_type);
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindClass ({type}): found type: {rv} (is_custom_type: {is_custom_type})");
+#endif
+ return rv;
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindClass ({type}): did not find type in NSObjectProxyTypes");
+#endif
+ // The type we're looking for might be a type the registrar skipped, in which case we must
+ // find it in the mapping of skipped types.
+ if (TypeMaps.IsSkippedType (type, out var actualType)) {
+ var rv = FindClass (actualType, out is_custom_type);
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindClass ({type}): skipped type, actual type: {actualType} with handle {rv} (is_custom_type: {is_custom_type})");
+#endif
+ return rv;
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindClass ({type}): did not find type");
+#endif
+
+ is_custom_type = false;
+ return IntPtr.Zero;
+ }
+
var map = Runtime.options->RegistrationMap;
is_custom_type = false;
@@ -432,8 +464,40 @@ internal static unsafe int FindMapIndex (Runtime.MTClassMap* array, int lo, int
return -1;
}
+ static Type? FindTypeInTrimmableMap (NativeHandle @class, out bool is_custom_type)
+ {
+ is_custom_type = false;
+
+ var className = GetClassName (@class);
+ if (!TypeMaps.TryGetNSObjectProxyAttribute (className, out var attrib, out var managedType)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindTypeInTrimmableMap (0x{@class:X} = {className}) could not get proxy attribute");
+#endif
+ return null;
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ var ch = attrib.GetClassHandle (out is_custom_type);
+ if (ch != @class) {
+ Runtime.NSLog ($"FindTypeInTrimmableMap (0x{@class:X} = {className}) found in proxy type map, and attribute, but attribute's class handle doesn't match (0x{ch:X} != 0x{@class:X})");
+ }
+
+ Runtime.NSLog ($"FindTypeInTrimmableMap (0x{@class:X} = {className}) found {managedType}");
+#endif
+
+ return managedType;
+ }
+
internal unsafe static Type? FindType (NativeHandle @class, out bool is_custom_type)
{
+ if (Runtime.IsTrimmableStaticRegistrar) {
+ var rv = FindTypeInTrimmableMap (@class, out is_custom_type);
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"FindType (0x{@class:X}, {is_custom_type}) found {rv}");
+#endif
+ return rv;
+ }
+
var map = Runtime.options->RegistrationMap;
#if LOG_TYPELOAD
@@ -561,6 +625,10 @@ internal static unsafe int FindMapIndex (Runtime.MTClassMap* array, int lo, int
static MemberInfo? ResolveToken (Assembly assembly, Module? module, uint token)
{
+ // This method should never be called when using the trimmable static registrar, so assert that never happens by throwing an exception in that case.
+ if (Runtime.IsTrimmableStaticRegistrar)
+ throw new System.Diagnostics.UnreachableException ();
+
if (!Runtime.IsManagedStaticRegistrar)
return ResolveTokenNonManagedStatic (assembly, module, token);
@@ -588,6 +656,10 @@ internal static unsafe int FindMapIndex (Runtime.MTClassMap* array, int lo, int
[UnconditionalSuppressMessage ("", "IL2026", Justification = "The APIs this method tries to access are marked by other means, so this is linker-safe.")]
static MemberInfo? ResolveTokenNonManagedStatic (Assembly assembly, Module? module, uint token)
{
+ // This method should never be called when using the trimmable static registrar, so assert that never happens by throwing an exception in that case.
+ if (Runtime.IsTrimmableStaticRegistrar)
+ throw new System.Diagnostics.UnreachableException ();
+
// This method should never be called when using the managed static registrar, so assert that never happens by throwing an exception in that case.
// This also takes care of NativeAOT, because the managed static registrar is required when using NativeAOT.
if (Runtime.IsManagedStaticRegistrar)
diff --git a/src/ObjCRuntime/Dlfcn.cs b/src/ObjCRuntime/Dlfcn.cs
index 48cc2ba31a39..354fcaa2b16e 100644
--- a/src/ObjCRuntime/Dlfcn.cs
+++ b/src/ObjCRuntime/Dlfcn.cs
@@ -55,9 +55,6 @@ static public class OpenGLES {
static public readonly IntPtr Handle = Dlfcn._dlopen (Constants.OpenGLESLibrary, 0);
}
#endif
- static public class AudioToolbox {
- static public readonly IntPtr Handle = Dlfcn._dlopen (Constants.AudioToolboxLibrary, 0);
- }
#endif
}
diff --git a/src/ObjCRuntime/Registrar.cs b/src/ObjCRuntime/Registrar.cs
index 3e7c62a06ecb..173bf5645c4d 100644
--- a/src/ObjCRuntime/Registrar.cs
+++ b/src/ObjCRuntime/Registrar.cs
@@ -148,6 +148,10 @@ internal class ObjCType {
public bool IsCategory { get { return CategoryAttribute is not null; } }
+ public bool IsStubClass {
+ get => RegisterAttribute?.IsStubClass == true;
+ }
+
public ObjCType (Registrar registrar, TType type)
{
this.Registrar = registrar;
diff --git a/src/ObjCRuntime/RegistrarHelper.cs b/src/ObjCRuntime/RegistrarHelper.cs
index e334ebf10c59..0ebe56b1e0c3 100644
--- a/src/ObjCRuntime/RegistrarHelper.cs
+++ b/src/ObjCRuntime/RegistrarHelper.cs
@@ -173,7 +173,7 @@ static void Register (IManagedRegistrar registrar)
static Stopwatch? lookupWatch;
#endif
- internal static IntPtr LookupUnmanagedFunction (IntPtr assembly, string? symbol, int id)
+ internal static IntPtr LookupUnmanagedFunction (IntPtr assembly, string? symbol, int id, string? objcClassName)
{
IntPtr rv;
@@ -200,7 +200,39 @@ internal static IntPtr LookupUnmanagedFunction (IntPtr assembly, string? symbol,
if (rv != IntPtr.Zero)
return rv;
- throw ErrorHelper.CreateError (8001, "Unable to find the managed function with id {0} ({1})", id, symbol);
+ if (Runtime.IsTrimmableStaticRegistrar && !string.IsNullOrEmpty (objcClassName)) {
+ rv = LookupUnmanagedFunctionInType (objcClassName, symbol);
+ }
+
+#if TRACE
+ lookupWatch.Stop ();
+
+ Console.WriteLine ("LookupUnmanagedFunction (0x{0} = {1}, {2}, {3}) => 0x{4} ElapsedMilliseconds: {5}", assembly.ToString ("x"), Marshal.PtrToStringAuto (assembly), symbol, id, rv.ToString ("x"), lookupWatch.ElapsedMilliseconds);
+#endif
+
+ if (rv != IntPtr.Zero)
+ return rv;
+
+ throw ErrorHelper.CreateError (8061, Errors.MX8061 /* Unable to find the managed function with id {0} ({1}, {2}). Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new). */, id, symbol, objcClassName);
+ }
+
+ static IntPtr LookupUnmanagedFunctionInType (string objcTypeName, string? symbol)
+ {
+ if (!TypeMaps.TryGetNSObjectProxyAttribute (objcTypeName, out var attrib, out var _)) {
+#if TRACE
+ Console.WriteLine ($"LookupUnmanagedFunctionInType ({objcTypeName}, {symbol}) could not find proxy type");
+#endif
+ return IntPtr.Zero;
+ }
+
+
+ var rv = attrib.LookupUnmanagedFunction (symbol);
+
+#if TRACE
+ Console.WriteLine ($"LookupUnmanagedFunctionInType ({objcTypeName}, {symbol}) called {attrib.GetType ().FullName}::LookupUnmanagedFunction, got 0x{rv:x} back");
+#endif
+
+ return rv;
}
static IntPtr LookupUnmanagedFunctionInAssembly (IntPtr assembly_name, string? symbol, int id)
diff --git a/src/ObjCRuntime/Runtime.cs b/src/ObjCRuntime/Runtime.cs
index 896fd1b62741..55378e8e6128 100644
--- a/src/ObjCRuntime/Runtime.cs
+++ b/src/ObjCRuntime/Runtime.cs
@@ -6,6 +6,8 @@
//
// Copyright 2013 Xamarin Inc.
+// #define LOG_TRIMMABLE_TYPEMAP
+
#nullable enable
using System.Collections.Generic;
@@ -164,7 +166,7 @@ internal struct Trampolines {
internal enum InitializationFlags : int {
IsPartialStaticRegistrar = 0x01,
IsManagedStaticRegistrar = 0x02,
- /* unused = 0x04,*/
+ IsTrimmableStaticRegistrar = 0x04,
/* unused = 0x08,*/
IsSimulator = 0x10,
IsCoreCLR = 0x20,
@@ -251,6 +253,14 @@ internal unsafe static bool IsManagedStaticRegistrar {
}
}
+ [BindingImpl (BindingImplOptions.Optimizable)]
+ internal unsafe static bool IsTrimmableStaticRegistrar {
+ get {
+ // The linker may turn calls to this property into a constant
+ return options->Flags.HasFlag (InitializationFlags.IsTrimmableStaticRegistrar);
+ }
+ }
+
/// If dynamic registration is supported.
/// If dynamic registration is supported.
///
@@ -298,6 +308,12 @@ unsafe static void SafeInitialize (InitializationOptions* options, IntPtr* excep
Initialize (options);
} catch (Exception e) {
*exception_gchandle = AllocGCHandle (e);
+ try {
+ Runtime.NSLog ($"Failed to initialize the runtime: {e}");
+ } catch {
+ // Ignore any exceptions here, we do absolutely not want to leak exceptions to native code (which will crash the process),
+ // and if the call to Runtime.NSLog went wrong, then something is seriously wrong, so it's likely nothing is safe to do.
+ }
}
}
@@ -337,6 +353,11 @@ unsafe static void Initialize (InitializationOptions* options)
block_lifetime_table = new ConditionalWeakTable ();
lock_obj = new object ();
+#if NET11_0_OR_GREATER
+ if (IsTrimmableStaticRegistrar)
+ TypeMaps.Initialize ();
+#endif
+
NSObjectClass = NSObject.Initialize ();
if (DynamicRegistrationSupported) {
@@ -1334,6 +1355,42 @@ static void AppendAdditionalInformation (StringBuilder msg, IntPtr sel, RuntimeM
if (type is null)
throw new ArgumentNullException (nameof (type));
+ if (Runtime.IsTrimmableStaticRegistrar) {
+ var lookupType = type;
+ if (typeof (T) == type && type.IsGenericType) {
+ var inst = ConstructNSObjectViaFactoryMethod (ptr);
+ if (inst is not null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructNSObject<{typeof (T).FullName}> (0x{@ptr:X}, {type}) created '{inst.GetType ().FullName}' instance using static interface factory method.");
+#endif
+ return inst;
+ }
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructNSObject<{typeof (T).FullName}> (0x{@ptr:X}, {type}) failed to create instance using static interface factory method.");
+#endif
+ CannotCreateManagedInstanceOfGenericType (ptr, IntPtr.Zero, type, missingCtorResolution, sel, method_handle);
+ return null;
+ }
+
+ if (TypeMaps.TryGetNSObjectProxyAttribute (lookupType, out var proxyAttribute)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructNSObject<{typeof (T).FullName}> (0x{@ptr:X}, {type}) found proxy attribute for lookup type '{lookupType.FullName}'");
+#endif
+ var instance = (T?) (object?) proxyAttribute.CreateObject (ptr);
+ if (instance is not null)
+ return instance;
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructNSObject<{typeof (T).FullName}> (0x{@ptr:X}, {type}) proxy attribute didn't create instance?");
+#endif
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructNSObject<{typeof (T).FullName}> (0x{@ptr:X}, {type}) did not find type '{lookupType.FullName}' in proxy map");
+#endif
+ MissingCtor (ptr, IntPtr.Zero, type, missingCtorResolution, sel, method_handle);
+ return null;
+ }
+
if (Runtime.IsManagedStaticRegistrar) {
T? instance = default;
var nativeHandle = new NativeHandle (ptr);
@@ -1404,7 +1461,7 @@ static void AppendAdditionalInformation (StringBuilder msg, IntPtr sel, RuntimeM
}
// The generic argument T is only used to cast the return value.
- static T? ConstructINativeObject (IntPtr ptr, bool owns, Type type, MissingCtorResolution missingCtorResolution, IntPtr sel, RuntimeMethodHandle method_handle) where T : INativeObject
+ static T? ConstructINativeObject (IntPtr ptr, bool owns, Type type, Type target_type, MissingCtorResolution missingCtorResolution, IntPtr sel, RuntimeMethodHandle method_handle) where T : INativeObject
{
if (type is null)
throw new ArgumentNullException (nameof (type));
@@ -1412,6 +1469,64 @@ static void AppendAdditionalInformation (StringBuilder msg, IntPtr sel, RuntimeM
if (type.IsByRef)
type = type.GetElementType ()!;
+ if (Runtime.IsTrimmableStaticRegistrar) {
+ if (typeof (T) == type && type.IsGenericType) {
+ var inst = ConstructINativeObjectViaFactoryMethod (ptr, owns);
+ if (inst is not null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) created '{inst.GetType ().FullName}' instance using static interface factory method.");
+#endif
+ return inst;
+ }
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) failed to create instance using static interface factory method.");
+#endif
+ CannotCreateManagedInstanceOfGenericType (ptr, IntPtr.Zero, type, missingCtorResolution, sel, method_handle);
+ return default (T);
+ }
+
+ if (TypeMaps.TryCreateInstanceUsingProxyTypeAttribute (type, ptr, owns, out var proxyInstanceA)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) created instance of type '{proxyInstanceA.GetType ()}' using proxy type attribute for '{type.FullName}'");
+#endif
+ return proxyInstanceA;
+ }
+
+ if (type != target_type) {
+ if (TypeMaps.TryCreateInstanceUsingProxyTypeAttribute (target_type, ptr, owns, out var proxyInstanceB)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) created instance '{proxyInstanceB.GetType ()}' using proxy type attribute for '{target_type.FullName}' [2]");
+#endif
+ return proxyInstanceB;
+ }
+ }
+
+ if (TypeMaps.TryGetProtocolProxyAttribute (target_type, out var protocolProxyAttribute)) {
+ var rv = protocolProxyAttribute.CreateObject (ptr, owns);
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) found proxy attribute of type '{protocolProxyAttribute.GetType ()}', and created object of type '{(rv?.GetType ()?.FullName ?? "null")}'");
+#endif
+ return (T?) (object?) rv;
+ }
+
+ if (TypeMaps.INativeObjectProxyTypes.TryGetValue (target_type, out var inativeObjectProxyType)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) found in INativeObject proxy map");
+#endif
+ var attrib = inativeObjectProxyType.GetCustomAttribute ();
+ if (attrib is null)
+ throw new InvalidOperationException ($"Type '{inativeObjectProxyType.FullName}' is expected to have an INativeObjectProxyAttribute."); // TODO: better exception
+ return (T?) (object?) attrib.CreateObject (ptr, owns);
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"ConstructINativeObject<{typeof (T).FullName}> (0x{@ptr:X}, {owns}, {type}, {target_type}) did not find type '{target_type.FullName}' in any map");
+#endif
+
+ MissingCtor (ptr, IntPtr.Zero, type, missingCtorResolution, sel, method_handle);
+ return default (T);
+ }
+
if (Runtime.IsManagedStaticRegistrar) {
var nativeHandle = new NativeHandle (ptr);
T? instance = default (T);
@@ -1982,7 +2097,7 @@ static Type LookupINativeObjectImplementation (IntPtr ptr, Type target_type, Typ
return ConstructNSObject (ptr, implementation!, MissingCtorResolution.ThrowConstructor1NotFound, sel, method_handle);
}
- return ConstructINativeObject (ptr, owns, implementation, MissingCtorResolution.ThrowConstructor2NotFound, sel, method_handle);
+ return ConstructINativeObject (ptr, owns, implementation, target_type, MissingCtorResolution.ThrowConstructor2NotFound, sel, method_handle);
}
// this method is identical in behavior to the non-generic one.
@@ -2043,7 +2158,7 @@ static Type LookupINativeObjectImplementation (IntPtr ptr, Type target_type, Typ
// native objects and NSObject instances.
throw ErrorHelper.CreateError (8004, $"Cannot create an instance of {implementation.FullName} for the native object 0x{ptr:x} (of type '{Class.class_getName (Class.GetClassForObject (ptr))}'), because another instance already exists for this native object (of type {o.GetType ().FullName}).");
}
- if (!Runtime.IsManagedStaticRegistrar) {
+ if (!Runtime.IsManagedStaticRegistrar && !Runtime.IsTrimmableStaticRegistrar) {
// For other registrars other than managed-static the generic parameter of ConstructNSObject is used
// only to cast the return value so we can safely pass NSObject here to satisfy the constraints of the
// generic parameter.
@@ -2054,10 +2169,10 @@ static Type LookupINativeObjectImplementation (IntPtr ptr, Type target_type, Typ
}
}
- return ConstructINativeObject (ptr, owns, implementation, MissingCtorResolution.ThrowConstructor2NotFound, sel, method_handle);
+ return ConstructINativeObject (ptr, owns, implementation, typeof (T), MissingCtorResolution.ThrowConstructor2NotFound, sel, method_handle);
}
- static void TryReleaseINativeObject (INativeObject? obj)
+ internal static void TryReleaseINativeObject (INativeObject? obj)
{
if (obj is null)
return;
@@ -2092,6 +2207,9 @@ static void TryReleaseINativeObject (INativeObject? obj)
var rv = RegistrarHelper.FindProtocolWrapperType (type);
if (rv is not null)
return rv;
+ } else if (IsTrimmableStaticRegistrar) {
+ if (TypeMaps.ProtocolWrapperTypes.TryGetValue (type, out var protocolWrapperType))
+ return protocolWrapperType;
} else {
unsafe {
var map = options->RegistrationMap;
@@ -2132,6 +2250,23 @@ public static IntPtr GetProtocol (string protocol)
internal static IntPtr GetProtocolForType (Type type)
{
+ // Check if the trimmable static registrar knows about this protocol
+ if (IsTrimmableStaticRegistrar) {
+ if (TypeMaps.TryGetProtocolProxyAttribute (type, out var attrib)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ NSLog ($"GetProtocolForType ({type.FullName}) found protocol proxy attribute");
+#endif
+ var protocolName = attrib.GetProtocolName ();
+ return Protocol.objc_getProtocol (protocolName);
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ NSLog ($"GetProtocolForType ({type.FullName}) NOT found in protocol proxy map");
+#endif
+
+ return IntPtr.Zero;
+ }
+
// Check if the static registrar knows about this protocol
unsafe {
var map = options->RegistrationMap;
@@ -2711,9 +2846,9 @@ static nint InvokeConformsToProtocol (IntPtr gchandle, IntPtr handle, IntPtr pro
return rv ? 1 : 0;
}
- static IntPtr LookupUnmanagedFunction (IntPtr assembly, IntPtr symbol, int id)
+ static IntPtr LookupUnmanagedFunction (IntPtr assembly, IntPtr symbol, int id, IntPtr objcClassName)
{
- return RegistrarHelper.LookupUnmanagedFunction (assembly, Marshal.PtrToStringAuto (symbol), id);
+ return RegistrarHelper.LookupUnmanagedFunction (assembly, Marshal.PtrToStringAuto (symbol), id, Marshal.PtrToStringAuto (objcClassName));
}
// This option is turned on by setting _ValidateObjectPointers property to true in the project file.
diff --git a/src/ObjCRuntime/TypeMaps.cs b/src/ObjCRuntime/TypeMaps.cs
new file mode 100644
index 000000000000..d1253d9c83fb
--- /dev/null
+++ b/src/ObjCRuntime/TypeMaps.cs
@@ -0,0 +1,393 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// #define LOG_TRIMMABLE_TYPEMAP
+
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+using System.Reflection;
+using System.Threading;
+
+using Xamarin.Bundler;
+
+namespace ObjCRuntime;
+
+// The trimmable static registrar makes this type public when needed.
+abstract class NSObjectProxyAttribute : Attribute {
+ protected NSObjectProxyAttribute () { }
+
+ public abstract NSObject? CreateObject (IntPtr handle);
+ public abstract IntPtr GetClassHandle (out bool is_custom_type);
+ public abstract IntPtr LookupUnmanagedFunction (string? name);
+}
+
+// The trimmable static registrar makes this type public when needed.
+abstract class ProtocolProxyAttribute : Attribute {
+ public abstract INativeObject? CreateObject (IntPtr handle, bool owns);
+ public abstract string? GetProtocolName ();
+}
+
+// The trimmable static registrar makes this type public when needed.
+abstract class INativeObjectProxyAttribute : Attribute {
+ public abstract INativeObject? CreateObject (IntPtr handle, bool owns);
+}
+
+// The trimmable static registrar makes this type public when needed.
+sealed class SkippedObjectiveCTypeUniverse {
+ SkippedObjectiveCTypeUniverse () { }
+}
+
+static class TypeMaps {
+#if LOG_TRIMMABLE_TYPEMAP
+ static void PreDump ()
+ {
+ Console.WriteLine ($"TypeMaps.Initialize ()");
+ AppDomain.CurrentDomain.AssemblyLoad += (sender, args) => {
+ Console.WriteLine ($"AssemblyLoad (): {args.LoadedAssembly} => {args.LoadedAssembly.Location}");
+ };
+ AppDomain.CurrentDomain.AssemblyResolve += (sender, args) => {
+ Console.WriteLine ($"AssemblyResolve (): {args.Name} failed to load (by {args.RequestingAssembly})");
+ return null;
+ };
+ AppDomain.CurrentDomain.FirstChanceException += (sender, args) => {
+ Console.WriteLine ($"FirstChanceException ({args.Exception}):\n{args.Exception.StackTrace})");
+ };
+ }
+
+ static void PostDump ()
+ {
+ Console.WriteLine ($"System.Runtime.InteropServices.TypeMappingEntryAssembly: {AppContext.GetData ("System.Runtime.InteropServices.TypeMappingEntryAssembly")}");
+ Dump ("NSObjectTypes", NSObjectTypes);
+ Dump ("SkippedProxyTypes", SkippedProxyTypes);
+ Dump ("NSObjectProxyTypes", NSObjectProxyTypes);
+ Dump ("INativeObjectProxyTypes", INativeObjectProxyTypes);
+ Dump ("ProtocolProxyTypes", ProtocolProxyTypes);
+ Dump ("ProtocolWrapperTypes", ProtocolWrapperTypes);
+ foreach (var asm in AppDomain.CurrentDomain.GetAssemblies ()) {
+ Console.WriteLine ($"Loaded assembly: {asm}");
+ }
+ Console.WriteLine ($"TypeMaps.Initialize () DONE");
+ }
+
+ static void Dump (string name, IReadOnlyDictionary dict)
+ {
+ var precachedModules = (System.Collections.IList?) dict.GetType ().GetField ("_preCachedModules", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (dict);
+ var lazyData = (System.Collections.IDictionary?) dict.GetType ().GetField ("_lazyData", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (dict);
+ Console.WriteLine ($"Dictionary '{name}':");
+ if (precachedModules is not null) {
+ if (precachedModules.Count > 0) {
+ Console.WriteLine ($" {precachedModules.Count} precached modules:");
+ foreach (Module mod in precachedModules)
+ Console.WriteLine ($" {mod.Name}");
+ } else {
+ Console.WriteLine ($" No precached modules.");
+ }
+ }
+ if (lazyData is not null) {
+ Console.WriteLine ($" {lazyData.Keys.Count} lazy data entries");
+ } else {
+ Console.WriteLine ($" No lazy data entries.");
+ var fields = dict.GetType ().GetFields (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
+ Console.WriteLine ($" Got dictionary of type '{dict.GetType ()}' with {fields.Length} fields: {dict}");
+ foreach (var field in fields) {
+ var value = field.GetValue (dict);
+ Console.WriteLine ($" Field '{field.Name}': {field}");
+ }
+ }
+ }
+
+ static void Dump (string name, IReadOnlyDictionary dict)
+ {
+ var precachedModules = (System.Collections.IList?) dict.GetType ().GetField ("_preCachedModules", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (dict);
+ var lazyData = (System.Collections.IDictionary?) dict.GetType ().GetField ("_lazyData", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue (dict);
+ Console.WriteLine ($"Dictionary '{name}':");
+ if (precachedModules is not null) {
+ if (precachedModules.Count > 0) {
+ Console.WriteLine ($" {precachedModules.Count} precached modules:");
+ foreach (Module mod in precachedModules)
+ Console.WriteLine ($" {mod.Name}");
+ } else {
+ Console.WriteLine ($" No precached modules.");
+ }
+ }
+ if (lazyData is not null) {
+ Console.WriteLine ($" {lazyData.Keys.Count} lazy data entries");
+ } else {
+ Console.WriteLine ($" No lazy data entries.");
+ var fields = dict.GetType ().GetFields (BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
+ Console.WriteLine ($" Got dictionary of type '{dict.GetType ()}' with {fields.Length} fields: {dict}");
+ foreach (var field in fields) {
+ var value = field.GetValue (dict);
+ Console.WriteLine ($" Field '{field.Name}': {field}");
+ }
+ }
+ }
+#endif // LOG_TRIMMABLE_TYPEMAP
+
+#if NET11_0_OR_GREATER
+#pragma warning disable 8618 // "Non-nullable field '...' must contain a non-null value when exiting constructor. Consider declaring the field as nullable.": we make sure through other means that these will never be null
+ internal static IReadOnlyDictionary NSObjectTypes;
+ internal static IReadOnlyDictionary SkippedProxyTypes;
+ internal static IReadOnlyDictionary NSObjectProxyTypes;
+ internal static IReadOnlyDictionary INativeObjectProxyTypes;
+ internal static IReadOnlyDictionary ProtocolProxyTypes;
+ internal static IReadOnlyDictionary ProtocolWrapperTypes;
+#pragma warning restore 8618
+
+ internal static void Initialize ()
+ {
+#if LOG_TRIMMABLE_TYPEMAP
+ PreDump ();
+#endif
+
+ NSObjectTypes = TypeMapping.GetOrCreateExternalTypeMapping ();
+ SkippedProxyTypes = TypeMapping.GetOrCreateProxyTypeMapping ();
+ NSObjectProxyTypes = TypeMapping.GetOrCreateProxyTypeMapping ();
+ INativeObjectProxyTypes = TypeMapping.GetOrCreateProxyTypeMapping ();
+ ProtocolProxyTypes = TypeMapping.GetOrCreateProxyTypeMapping ();
+ ProtocolWrapperTypes = TypeMapping.GetOrCreateProxyTypeMapping ();
+
+#if LOG_TRIMMABLE_TYPEMAP
+ PostDump ();
+#endif
+ }
+#else
+ static IReadOnlyDictionary? nsobject_types;
+ internal static IReadOnlyDictionary NSObjectTypes {
+ get {
+ if (nsobject_types is null)
+ Initialize ();
+ return nsobject_types;
+ }
+ }
+
+ static IReadOnlyDictionary? skipped_proxy_types;
+ internal static IReadOnlyDictionary SkippedProxyTypes {
+ get {
+ if (skipped_proxy_types is null)
+ Initialize ();
+ return skipped_proxy_types;
+ }
+ }
+
+ static IReadOnlyDictionary? nsobject_proxy_types;
+ internal static IReadOnlyDictionary NSObjectProxyTypes {
+ get {
+ if (nsobject_proxy_types is null)
+ Initialize ();
+ return nsobject_proxy_types;
+ }
+ }
+
+ static IReadOnlyDictionary? inativeobject_proxy_types;
+ internal static IReadOnlyDictionary INativeObjectProxyTypes {
+ get {
+ if (inativeobject_proxy_types is null)
+ Initialize ();
+ return inativeobject_proxy_types;
+ }
+ }
+
+ static IReadOnlyDictionary? protocol_proxy_types;
+ internal static IReadOnlyDictionary ProtocolProxyTypes {
+ get {
+ if (protocol_proxy_types is null)
+ Initialize ();
+ return protocol_proxy_types;
+ }
+ }
+
+ static IReadOnlyDictionary? protocol_wrapper_types;
+ internal static IReadOnlyDictionary ProtocolWrapperTypes {
+ get {
+ if (protocol_wrapper_types is null)
+ Initialize ();
+ return protocol_wrapper_types;
+ }
+ }
+
+ static readonly Lock lock_obj = new Lock ();
+
+ [MemberNotNull (nameof (nsobject_types))]
+ [MemberNotNull (nameof (skipped_proxy_types))]
+ [MemberNotNull (nameof (nsobject_proxy_types))]
+ [MemberNotNull (nameof (inativeobject_proxy_types))]
+ [MemberNotNull (nameof (protocol_proxy_types))]
+ [MemberNotNull (nameof (protocol_wrapper_types))]
+ internal static void Initialize ()
+ {
+ // In .NET 10 we can only create the type maps from the entry assembly, which can only be done after calling the
+ // main assembly's Main method - so we need to create the type maps on demand, instead of from Runtime.Initialize.
+ // For reference, this is what happens:
+ // System.InvalidOperationException: Entry assembly is required but was not found.
+ // at System.Runtime.InteropServices.TypeMapLazyDictionary.CreateMaps(RuntimeType groupType, newExternalTypeEntry, newProxyTypeEntry)
+ // at System.Runtime.InteropServices.TypeMapLazyDictionary.CreateExternalTypeMap(RuntimeType groupType)
+ lock (lock_obj) {
+ if (nsobject_types is null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ PreDump ();
+#endif
+ nsobject_types = TypeMapping.GetOrCreateExternalTypeMapping ();
+ }
+
+ if (skipped_proxy_types is null)
+ skipped_proxy_types = TypeMapping.GetOrCreateProxyTypeMapping ();
+
+ if (nsobject_proxy_types is null)
+ nsobject_proxy_types = TypeMapping.GetOrCreateProxyTypeMapping ();
+
+ if (inativeobject_proxy_types is null)
+ inativeobject_proxy_types = TypeMapping.GetOrCreateProxyTypeMapping ();
+
+ if (protocol_proxy_types is null)
+ protocol_proxy_types = TypeMapping.GetOrCreateProxyTypeMapping ();
+
+ if (protocol_wrapper_types is null) {
+ protocol_wrapper_types = TypeMapping.GetOrCreateProxyTypeMapping ();
+#if LOG_TRIMMABLE_TYPEMAP
+ PostDump ();
+#endif
+ }
+ }
+ }
+#endif // NET11_0_OR_GREATER
+
+ internal static bool TryGetProtocolProxyAttribute (Type protocol, [NotNullWhen (true)] out ProtocolProxyAttribute? proxyAttribute)
+ {
+ proxyAttribute = null;
+
+ if (ProtocolProxyTypes.TryGetValue (protocol, out var protocolProxyType)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetProtocolProxyAttribute ({protocol}) found proxy type {protocolProxyType} in protocol proxy map");
+#endif
+ proxyAttribute = protocolProxyType.GetCustomAttribute ();
+ if (proxyAttribute is null)
+ throw ErrorHelper.CreateError (8062, Errors.MX8062 /* Type '{0}' is expected to have a ProtocolProxyAttribute. Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new). */, protocolProxyType.FullName);
+ return proxyAttribute is not null;
+ }
+
+ // workaround for https://github.com/dotnet/runtime/issues/127004
+ proxyAttribute = protocol.GetCustomAttribute (false);
+ if (proxyAttribute is not null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetProtocolProxyAttribute ({protocol}) found proxy attribute on the protocol type itself");
+#endif
+ return true;
+ }
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetProtocolProxyAttribute ({protocol}) did not find proxy attribute anywhere");
+#endif
+ // end workaround for https://github.com/dotnet/runtime/issues/127004
+
+ return false;
+ }
+
+ internal static bool IsSkippedType (Type type, [NotNullWhen (true)] out Type? actualType)
+ {
+ var potentiallySkippedType = type;
+ if (potentiallySkippedType.IsGenericType)
+ potentiallySkippedType = potentiallySkippedType.GetGenericTypeDefinition ();
+
+ var rv = SkippedProxyTypes.TryGetValue (potentiallySkippedType, out actualType);
+
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"IsSkippedType ({type}, {actualType}) looked for '{potentiallySkippedType}' => {rv}");
+#endif
+
+ return rv;
+ }
+
+ internal static bool TryCreateInstanceUsingProxyTypeAttribute (Type type, IntPtr ptr, bool owns, [NotNullWhen (true)] out T? instance) where T : INativeObject
+ {
+ instance = default;
+
+ if (!TryGetNSObjectProxyAttribute (type, out var proxyAttribute)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryCreateInstanceUsingProxyTypeAttribute<{typeof (T).FullName}> ({type}, 0x{@ptr:X}, {owns}) did not find proxy attribute type '{type.FullName}'");
+#endif
+ return false;
+ }
+
+ var obj = proxyAttribute.CreateObject (ptr);
+ if (obj is null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryCreateInstanceUsingProxyTypeAttribute<{typeof (T).FullName}> ({type}, 0x{@ptr:X}, {owns}) found proxy attribute of type {proxyAttribute.GetType ()}, but its CreateObject method returned null.");
+#endif
+ return false;
+ }
+
+ if (owns)
+ Runtime.TryReleaseINativeObject (obj);
+
+ if (obj is not T objT) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryCreateInstanceUsingProxyTypeAttribute<{typeof (T).FullName}> ({type}, 0x{@ptr:X}, {owns}) found proxy attribute of type {proxyAttribute.GetType ()}, and an object was created of type {obj.GetType ()}, but that's not compatible with the target type {typeof (T)}.");
+#endif
+ return false;
+ }
+
+ instance = objT;
+
+ return true;
+ }
+
+ internal static bool TryGetNSObjectProxyAttribute (Type managedType, [NotNullWhen (true)] out NSObjectProxyAttribute? proxyAttribute)
+ {
+ proxyAttribute = null;
+
+ // workaround for https://github.com/dotnet/runtime/issues/127004
+ proxyAttribute = managedType.GetCustomAttribute (false);
+ if (proxyAttribute is not null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetNSObjectProxyAttribute ({managedType}): found proxy attribute on the type itself");
+#endif
+ return true;
+ }
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetNSObjectProxyAttribute ({managedType}): did not find proxy attribute on the type itself");
+#endif
+ // end workaround for https://github.com/dotnet/runtime/issues/127004
+
+ if (!NSObjectProxyTypes.TryGetValue (managedType, out var proxyType)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetNSObjectProxyAttribute ({managedType}) found in NSObjectTypes type map, but proxy type in NSObjectProxyTypes not found");
+#endif
+ return false;
+ }
+
+ proxyAttribute = proxyType.GetCustomAttribute ();
+ if (proxyAttribute is null) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"TryGetNSObjectProxyAttribute ({managedType}) found in proxy type map, but could not create proxy attribute for it");
+#endif
+ return false;
+ }
+
+ return proxyAttribute is not null;
+ }
+
+ internal static bool TryGetNSObjectProxyAttribute (string? className, [NotNullWhen (true)] out NSObjectProxyAttribute? proxyAttribute, [NotNullWhen (true)] out Type? managedType)
+ {
+ proxyAttribute = null;
+ managedType = null;
+
+ if (string.IsNullOrEmpty (className)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"GetTrimmableProxyTypeAttribute ({className}) = no class name provided");
+#endif
+ return false;
+ }
+
+ if (!TypeMaps.NSObjectTypes.TryGetValue (className, out managedType)) {
+#if LOG_TRIMMABLE_TYPEMAP
+ Runtime.NSLog ($"GetTrimmableProxyTypeAttribute ({className}) Objective-C class \"{className}\" not found in NSObjectTypes type map");
+#endif
+ return false;
+ }
+
+ return TryGetNSObjectProxyAttribute (managedType, out proxyAttribute);
+ }
+}
+
diff --git a/src/QuartzComposer/QCComposition.cs b/src/QuartzComposer/QCComposition.cs
new file mode 100644
index 000000000000..f3bbc93c425d
--- /dev/null
+++ b/src/QuartzComposer/QCComposition.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+using System;
+using System.ComponentModel;
+
+using Foundation;
+using ObjCRuntime;
+
+#nullable enable
+
+namespace QuartzComposer;
+
+partial class QCComposition {
+#if !XAMCORE_5_0
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This field is always null.")]
+ public static NSString? InputRSSArticleDurationKey {
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ get => null;
+ }
+
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This field is always null.")]
+ public static NSString? InputRSSFeedURLKey {
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ get => null;
+ }
+
+ [BindingImpl (BindingImplOptions.GeneratedCode | BindingImplOptions.Optimizable)]
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("This field is always null.")]
+ public static NSString? ProtocolRSSVisualizer {
+ [ObsoletedOSPlatform ("macos10.14", "Use 'Metal' instead.")]
+ [SupportedOSPlatform ("macos")]
+ get => null;
+ }
+#endif // !XAMCORE_5_0
+}
diff --git a/src/StoreKit/StoreProductParameters.cs b/src/StoreKit/StoreProductParameters.cs
index fb9848156928..23703195c8b1 100644
--- a/src/StoreKit/StoreProductParameters.cs
+++ b/src/StoreKit/StoreProductParameters.cs
@@ -27,6 +27,8 @@
#nullable enable
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
using CoreFoundation;
namespace StoreKit {
@@ -38,19 +40,33 @@ namespace StoreKit {
#endif
public partial class StoreProductParameters : DictionaryContainer {
#if !COREBUILD
- /// To be added.
- /// Creates a new for the specified ITunes identifier.
- /// To be added.
+#if !XAMCORE_5_0
+ /// Creates a new for the specified iTunes identifier.
+ /// The 32-bit App Store item identifier to display.
+ /// Use to support identifiers larger than .
+ [OverloadResolutionPriorityAttribute (-1)]
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("Use 'StoreProductParameters (long)' instead.")]
public StoreProductParameters (int iTunesItemIdentifier)
+ : this ((long) iTunesItemIdentifier)
+ {
+ }
+#endif
+
+ /// Creates a new for the specified 64-bit iTunes identifier.
+ /// The App Store item identifier to display.
+ public StoreProductParameters (long iTunesItemIdentifier)
: this ()
{
- ITunesItemIdentifier = iTunesItemIdentifier;
+ ITunesItemIdentifierLong = iTunesItemIdentifier;
}
- // TODO: What is real iTunes Store item identifier length
- /// Gets or sets the identifier for the ITunes item being advertised.
- /// To be added.
- /// To be added.
+#if !XAMCORE_5_0
+ /// Gets or sets the legacy 32-bit iTunes item identifier for the App Store product to display.
+ /// The 32-bit App Store item identifier, or if not set.
+ /// Use for current identifiers and values larger than .
+ [EditorBrowsable (EditorBrowsableState.Never)]
+ [Obsolete ("Use 'ITunesItemIdentifierLong' instead.")]
public int? ITunesItemIdentifier {
set {
SetNumberValue (SKStoreProductParameterKey.ITunesItemIdentifier, value);
@@ -59,6 +75,18 @@ public int? ITunesItemIdentifier {
return GetInt32Value (SKStoreProductParameterKey.ITunesItemIdentifier);
}
}
+#endif
+
+ /// Gets or sets the 64-bit iTunes item identifier for the App Store product to display.
+ /// The App Store item identifier, or if not set.
+ public long? ITunesItemIdentifierLong {
+ set {
+ SetNumberValue (SKStoreProductParameterKey.ITunesItemIdentifier, value);
+ }
+ get {
+ return GetLongValue (SKStoreProductParameterKey.ITunesItemIdentifier);
+ }
+ }
/// Gets or sets a key for the affiliate token.
/// To be added.
diff --git a/src/appkit.cs b/src/appkit.cs
index d44bfe13ffec..4ed3bacd8db8 100644
--- a/src/appkit.cs
+++ b/src/appkit.cs
@@ -26730,11 +26730,7 @@ interface NSWorkspaceApplicationEventArgs {
[NoMacCatalyst]
interface NSWorkspaceFileOperationEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSOperationNumber")]
- nint FileType { get; }
+ // The 'FileType' property has manual bindings.
}
delegate void NSWorkspaceUrlHandler (NSDictionary newUrls, NSError error);
@@ -28202,39 +28198,15 @@ void ReopenDocumentForUrl ([NullAllowed] NSUrl url, NSUrl contentsUrl,
}
partial interface NSViewColumnMoveEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSOldColumn")]
- nint OldColumn { get; }
-
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSNewColumn")]
- nint NewColumn { get; }
+ // The 'OldColumn' and 'NewColumn' properties have manual bindings.
}
partial interface NSViewColumnResizeEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSTableColumn")]
- NSTableColumn Column { get; }
-
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSOldWidth")]
- nint OldWidth { get; }
+ // The 'Column' and 'OldWidth' properties have manual bindings.
}
partial interface NSOutlineViewItemEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSObject")]
- NSObject Item { get; }
+ // The 'Item' property has manual bindings.
}
partial interface NSOutlineView : NSAccessibilityOutline {
@@ -28627,26 +28599,11 @@ void ShowCorrectionIndicatorOfType (NSCorrectionIndicatorType type, string prima
}
partial interface NSTextViewDidChangeSelectionEventArgs {
- // FIXME: verify property type "NSValue object containing an NSRange structure"
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSOldSelectedCharacterRange")]
- NSValue OldSelectedCharacterRange { get; }
+ // The 'OldSelectedCharacterRange' property has manual bindings.
}
partial interface NSTextViewWillChangeNotifyingTextViewEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSOldNotifyingTextView")]
- NSTextView OldView { get; }
-
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSNewNotifyingTextView")]
- NSTextView NewView { get; }
+ // The 'OldView' and 'NewView' properties have manual bindings.
}
partial interface NSTextView : NSTextLayoutOrientationProvider {
@@ -28708,11 +28665,7 @@ partial interface NSView {
}
partial interface NSControlTextEditingEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSFieldEditor")]
- NSTextView FieldEditor { get; }
+ // The 'FieldEditor' property has manual bindings.
}
partial interface NSControl {
@@ -29006,11 +28959,7 @@ NSSharingServicePicker WillShowSharingService (NSTextView textView,
}*/
interface NSTextAlternativesSelectedAlternativeStringEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSAlternativeString")]
- string AlternativeString { get; }
+ // The 'AlternativeString' property has manual bindings.
}
[NoMacCatalyst]
@@ -29141,19 +29090,11 @@ partial interface NSDrawer {
}
partial interface NSMenuItemIndexEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSMenuItemIndex")]
- nint MenuItemIndex { get; }
+ // The 'MenuItemIndex' property has manual bindings.
}
partial interface NSMenuItemEventArgs {
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("MenuItem")]
- NSMenu MenuItem { get; }
+ // The 'MenuItem' property has manual bindings.
}
partial interface NSMenu {
@@ -29222,14 +29163,7 @@ partial interface NSTableView : NSUserInterfaceValidations {
[NoMacCatalyst]
partial interface NSTextDidEndEditingEventArgs {
- // FIXME: I think this is essentially a flags value
- // of movements and characters. The docs are a bit
- // confusing.
- /// To be added.
- /// To be added.
- /// To be added.
- [Export ("NSTextMovement")]
- nint Movement { get; }
+ // The 'Movement' property has manual bindings.
}
partial interface NSText {
diff --git a/src/audiounit.cs b/src/audiounit.cs
index 8d7b5a03da77..0929b0ac4aa2 100644
--- a/src/audiounit.cs
+++ b/src/audiounit.cs
@@ -526,10 +526,10 @@ AUParameterTree ParameterTree {
[Export ("shouldChangeToFormat:forBus:")]
bool ShouldChangeToFormat (AVAudioFormat format, AUAudioUnitBus bus);
- [Notification, Field ("kAudioComponentRegistrationsChangedNotification")]
+ [Notification, Field ("kAudioComponentRegistrationsChangedNotification", "AudioToolbox")]
NSString AudioComponentRegistrationsChangedNotification { get; }
- [Notification, Field ("kAudioComponentInstanceInvalidationNotification")]
+ [Notification, Field ("kAudioComponentInstanceInvalidationNotification", "AudioToolbox")]
NSString AudioComponentInstanceInvalidationNotification { get; }
/// To be added.
diff --git a/src/corebluetooth.cs b/src/corebluetooth.cs
index 7de2a6a0d10a..796bdfcbb890 100644
--- a/src/corebluetooth.cs
+++ b/src/corebluetooth.cs
@@ -1282,15 +1282,6 @@ interface CBUUID : NSCopying {
[Field ("CBUUIDCharacteristicAggregateFormatString")]
NSString CharacteristicAggregateFormatString { get; }
- [Internal]
- [Field ("CBUUIDValidRangeString")]
- [Deprecated (PlatformName.MacOSX, 10, 13)]
- [Obsoleted (PlatformName.MacOSX, 10, 13)]
- [NoiOS]
- [NoTV]
- [NoMacCatalyst]
- NSString CBUUIDValidRangeString { get; }
-
/// Represents the value associated with the constant CBUUIDCharacteristicValidRangeString
/// To be added.
/// To be added.
diff --git a/src/coreml.cs b/src/coreml.cs
index 8de15a6d75da..d22ce5c74d6b 100644
--- a/src/coreml.cs
+++ b/src/coreml.cs
@@ -1571,10 +1571,6 @@ interface MLModelCollection {
[Async]
[Export ("endAccessingModelCollectionWithIdentifier:completionHandler:")]
void EndAccessingModelCollection (string identifier, Action completionHandler);
-
- [Notification]
- [Field ("MLModelCollectionDidChangeNotification")]
- NSString DidChangeNotification { get; }
}
#endif // !XAMCORE_5_0
diff --git a/src/frameworks.sources b/src/frameworks.sources
index 6573e8e10f1b..86320fd61d35 100644
--- a/src/frameworks.sources
+++ b/src/frameworks.sources
@@ -152,6 +152,17 @@ APPKIT_SOURCES = \
AppKit/NSCollectionView.cs \
AppKit/NSCollectionViewLayout.cs \
AppKit/NSColorPickerTouchBarItem.cs \
+ AppKit/NSControlTextEditingEventArgs.cs \
+ AppKit/NSMenuItemEventArgs.cs \
+ AppKit/NSMenuItemIndexEventArgs.cs \
+ AppKit/NSOutlineViewItemEventArgs.cs \
+ AppKit/NSTextAlternativesSelectedAlternativeStringEventArgs.cs \
+ AppKit/NSTextViewDidChangeSelectionEventArgs.cs \
+ AppKit/NSTextViewWillChangeNotifyingTextViewEventArgs.cs \
+ AppKit/NSTextDidEndEditingEventArgs.cs \
+ AppKit/NSViewColumnMoveEventArgs.cs \
+ AppKit/NSViewColumnResizeEventArgs.cs \
+ AppKit/NSWorkspaceFileOperationEventArgs.cs \
AppKit/NSSliderTouchBarItem.cs \
AppKit/NSView.cs \
AppKit/NSCollectionLayoutAnchor.cs \
@@ -624,6 +635,7 @@ COREMIDI_SOURCES = \
COREML_SOURCES = \
CoreML/MLDictionaryFeatureProvider.cs \
CoreML/MLModel.cs \
+ CoreML/MLModelCollection.cs \
CoreML/MLMultiArray.cs \
CoreML/MLMultiArrayConstraint.cs \
@@ -1478,6 +1490,11 @@ PRINTCORE_SOURCES = \
PUSHTOTALK_SOURCES = \
PushToTalk/Compat.cs \
+# QuartzComposer
+
+QUARTZCOMPOSER_SOURCES = \
+ QuartzComposer/QCComposition.cs \
+
# QuickLook
QUICKLOOK_SOURCES = \
@@ -1952,6 +1969,7 @@ SHARED_SOURCES = \
ObjCRuntime/TrampolineBlockBase.cs \
ObjCRuntime/TransientAttribute.cs \
ObjCRuntime/TypeConverter.cs \
+ ObjCRuntime/TypeMaps.cs \
ObjCRuntime/UserDelegateTypeAttribute.cs \
System.Net.Http/CFContentStream.cs \
System.Net.Http/CFNetworkHandler.cs \
diff --git a/src/quartzcomposer.cs b/src/quartzcomposer.cs
index ffc4192e1e00..f514f6e6bcce 100644
--- a/src/quartzcomposer.cs
+++ b/src/quartzcomposer.cs
@@ -158,19 +158,10 @@ interface QCComposition : NSCopying {
[Field ("QCCompositionInputDestinationImageKey")]
NSString InputDestinationImageKey { get; }
- /// To be added.
- /// To be added.
- /// To be added.
- [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
- [Field ("QCCompositionInputRSSFeedURLKey")]
- NSString InputRSSFeedURLKey { get; }
-
- /// To be added.
- /// To be added.
- /// To be added.
- [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
- [Field ("QCCompositionInputRSSArticleDurationKey")]
- NSString InputRSSArticleDurationKey { get; }
+#if !XAMCORE_5_0
+ // The 'InputRSSFeedURLKey' property has manual bindings.
+ // The 'InputRSSArticleDurationKey' property has manual bindings.
+#endif
/// To be added.
/// To be added.
@@ -280,12 +271,9 @@ interface QCComposition : NSCopying {
[Field ("QCCompositionProtocolScreenSaver")]
NSString ProtocolScreenSaver { get; }
- /// To be added.
- /// To be added.
- /// To be added.
- [Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'Metal' instead.")]
- [Field ("QCCompositionProtocolRSSVisualizer")]
- NSString ProtocolRSSVisualizer { get; }
+#if !XAMCORE_5_0
+ // The 'ProtocolRSSVisualizer' property has manual bindings.
+#endif
/// To be added.
/// To be added.
diff --git a/tests/bindings-test/ProtocolTest.cs b/tests/bindings-test/ProtocolTest.cs
index eb87ef8fe459..c85278667de0 100644
--- a/tests/bindings-test/ProtocolTest.cs
+++ b/tests/bindings-test/ProtocolTest.cs
@@ -23,6 +23,12 @@ bool HasProtocolAttributes {
}
}
+ bool IsTrimmableStaticRegistrar {
+ get {
+ return global::XamarinTests.ObjCRuntime.Registrar.IsTrimmableStaticRegistrar;
+ }
+ }
+
[Test]
public void Constructors ()
{
diff --git a/tests/bindings-test/Registrar.cs b/tests/bindings-test/Registrar.cs
index 7fec87bf5cd5..e9c9a17a876c 100644
--- a/tests/bindings-test/Registrar.cs
+++ b/tests/bindings-test/Registrar.cs
@@ -16,8 +16,9 @@ namespace XamarinTests.ObjCRuntime {
public enum Registrars {
Static = 1,
ManagedStatic = Static | 2,
- Dynamic = 4,
- AllStatic = Static | ManagedStatic,
+ TrimmableStatic = Static | 4,
+ Dynamic = 8,
+ AllStatic = Static | ManagedStatic | TrimmableStatic,
AllDynamic = Dynamic,
}
@@ -37,9 +38,20 @@ public static bool IsDynamicRegistrar {
}
}
+ public static bool IsTrimmableStaticRegistrar {
+ get {
+ return CurrentRegistrar.HasFlag (Registrars.TrimmableStatic);
+ }
+ }
+
+
[UnconditionalSuppressMessage ("Trimming", "IL2026", Justification = "This test accesses internals, and this code seems to work fine with the trimmer enabled.")]
public static Registrars CurrentRegistrar {
get {
+ var isTrimmableStaticRegistrar = (bool) typeof (Runtime).GetProperty ("IsTrimmableStaticRegistrar", BindingFlags.NonPublic | BindingFlags.Static)!.GetValue (null);
+ if (isTrimmableStaticRegistrar)
+ return Registrars.TrimmableStatic;
+
var __registrar__ = typeof (Class).Assembly.GetType ("ObjCRuntime.__Registrar__");
if (__registrar__ is not null)
return Registrars.ManagedStatic;
diff --git a/tests/cecil-tests/Documentation.KnownFailures.txt b/tests/cecil-tests/Documentation.KnownFailures.txt
index d72c2afc6991..17ed7d6c4b51 100644
--- a/tests/cecil-tests/Documentation.KnownFailures.txt
+++ b/tests/cecil-tests/Documentation.KnownFailures.txt
@@ -29013,6 +29013,7 @@ T:CoreML.MLModelAsset
T:CoreML.MLModelAssetGetFunctionNamesCompletionHandler
T:CoreML.MLModelAssetGetModelDescriptionCompletionHandler
T:CoreML.MLModelCollection
+T:CoreML.MLModelCollection.Notifications
T:CoreML.MLModelCollectionEntry
T:CoreML.MLModelConfiguration
T:CoreML.MLModelStructure
diff --git a/tests/common/Touch.Unit/Touch.Client/Runner/HttpTextWriter.cs b/tests/common/Touch.Unit/Touch.Client/Runner/HttpTextWriter.cs
index 2e97df0bbd96..6d4e40142955 100644
--- a/tests/common/Touch.Unit/Touch.Client/Runner/HttpTextWriter.cs
+++ b/tests/common/Touch.Unit/Touch.Client/Runner/HttpTextWriter.cs
@@ -16,7 +16,7 @@
namespace MonoTouch.NUnit {
class HttpTextWriter : TextWriter {
- public string HostName;
+ public string? HostName;
public int Port;
TaskCompletionSource finished = new TaskCompletionSource ();
@@ -52,7 +52,7 @@ Task SendData (NSUrl url, string uploadData)
var tcs = new TaskCompletionSource ();
var request = new NSMutableUrlRequest (url);
request.HttpMethod = "POST";
- var rv = NSUrlSession.SharedSession.CreateUploadTask (request, NSData.FromString (uploadData), (NSData data, NSUrlResponse response, NSError error) => {
+ var rv = NSUrlSession.SharedSession.CreateUploadTask (request, NSData.FromString (uploadData), (NSData? data, NSUrlResponse? response, NSError? error) => {
if (error is not null) {
Console.WriteLine ("Failed to send data to {0}: {1}", url.AbsoluteString, error);
tcs.SetResult (false);
@@ -67,7 +67,12 @@ Task SendData (NSUrl url, string uploadData)
async Task SendData (string action, string uploadData)
{
+ if (string.IsNullOrEmpty (HostName))
+ throw new InvalidOperationException ("No host name specified.");
+
var url = NSUrl.FromString ("http://" + HostName + ":" + Port + "/" + action);
+ if (url is null)
+ throw new InvalidOperationException ("Failed to create the reporting url.");
int attempts_left = 10;
while (!await SendData (url, uploadData)) {
@@ -105,13 +110,14 @@ public override void Write (char value)
log.Append (value);
}
- public override void Write (char [] buffer)
+ public override void Write (char []? buffer)
{
Console.Out.Write (buffer);
- log.Append (buffer);
+ if (buffer is not null)
+ log.Append (buffer);
}
- public override void WriteLine (string value)
+ public override void WriteLine (string? value)
{
Console.Out.WriteLine (value);
log.AppendLine (value);
diff --git a/tests/common/Touch.Unit/Touch.Client/Runner/MacRunner.cs b/tests/common/Touch.Unit/Touch.Client/Runner/MacRunner.cs
index 4f1eaf0e0443..2cbaf024afe4 100644
--- a/tests/common/Touch.Unit/Touch.Client/Runner/MacRunner.cs
+++ b/tests/common/Touch.Unit/Touch.Client/Runner/MacRunner.cs
@@ -67,7 +67,7 @@ static async Task RunTestsAsync (TouchOptions options, Assembly [] assembl
await runner.RunAsync ();
- return !runner.Result.IsFailure ();
+ return runner.Result is not null && !runner.Result.IsFailure ();
}
protected override void WriteDeviceInformation (TextWriter writer)
diff --git a/tests/common/Touch.Unit/Touch.Client/Runner/NUnitOutputTextWriter.cs b/tests/common/Touch.Unit/Touch.Client/Runner/NUnitOutputTextWriter.cs
index 78da78b69896..cfb459fe7fbc 100644
--- a/tests/common/Touch.Unit/Touch.Client/Runner/NUnitOutputTextWriter.cs
+++ b/tests/common/Touch.Unit/Touch.Client/Runner/NUnitOutputTextWriter.cs
@@ -37,12 +37,12 @@ public class NUnitOutputTextWriter : TextWriter {
StringBuilder extra_data = new StringBuilder ();
XmlMode mode;
- public NUnitOutputTextWriter (BaseTouchRunner runner, TextWriter baseWriter, OutputWriter xmlWriter)
+ public NUnitOutputTextWriter (BaseTouchRunner runner, TextWriter? baseWriter, OutputWriter? xmlWriter)
: this (runner, baseWriter, xmlWriter, XmlMode.Default)
{
}
- public NUnitOutputTextWriter (BaseTouchRunner runner, TextWriter baseWriter, OutputWriter xmlWriter, XmlMode xmlMode)
+ public NUnitOutputTextWriter (BaseTouchRunner runner, TextWriter? baseWriter, OutputWriter? xmlWriter, XmlMode xmlMode)
{
Runner = runner;
BaseWriter = baseWriter ?? Console.Out;
@@ -60,7 +60,7 @@ public override Encoding Encoding {
public BaseTouchRunner Runner { get; private set; }
- public OutputWriter XmlOutputWriter { get; private set; }
+ public OutputWriter? XmlOutputWriter { get; private set; }
public override void Write (char value)
{
@@ -70,7 +70,7 @@ public override void Write (char value)
extra_data.Append (value);
}
- public override void Write (string value)
+ public override void Write (string? value)
{
if (real_time_reporting)
BaseWriter.Write (value);
@@ -81,6 +81,7 @@ public override void Write (string value)
public override void Close ()
{
if (XmlOutputWriter is not null) {
+ var result = Runner.Result;
// now we want the XML report to write
real_time_reporting = true;
// write to a temporary string, because NUnit2XmlOutputWriter.WriteResultFile closes the stream,
@@ -88,7 +89,8 @@ public override void Close ()
var wrapped = mode == XmlMode.Wrapped;
if (!wrapped) {
- XmlOutputWriter.WriteResultFile (Runner.Result, BaseWriter);
+ if (result is not null)
+ XmlOutputWriter.WriteResultFile (result, BaseWriter);
if (extra_data.Length > 0) {
BaseWriter.Write ("
$(NoWarn);CA1422
+
+ enable
+ Nullable
diff --git a/tests/common/shared-dotnet.mk b/tests/common/shared-dotnet.mk
index cf10c1811ad1..717286b7a006 100644
--- a/tests/common/shared-dotnet.mk
+++ b/tests/common/shared-dotnet.mk
@@ -178,6 +178,7 @@ reload-and-run:
$(Q) $(MAKE) run
build: prepare
+ @echo "Building $(wildcard *.?.csproj)..."
$(Q) $(DOTNET) build "/bl:$(abspath $@-$(BINLOG_TIMESTAMP).binlog)" *.?sproj $(DOTNET_BUILD_VERBOSITY) $(BUILD_ARGUMENTS) $(CONFIG_ARGUMENT) $(UNIVERSAL_ARGUMENT) $(NATIVEAOT_ARGUMENTS) $(TEST_VARIATION_ARGUMENT)
run: export SIMCTL_CHILD_NUNIT_AUTOSTART=true
diff --git a/tests/common/test-variations.csproj b/tests/common/test-variations.csproj
index b3c26ed15647..633c8fc2cb79 100644
--- a/tests/common/test-variations.csproj
+++ b/tests/common/test-variations.csproj
@@ -21,6 +21,8 @@
+
+
@@ -94,6 +96,12 @@
<_TestVariationApplied>true
+
+ trimmable-static
+ false
+ <_TestVariationApplied>true
+
+
$(AppBundleExtraOptions) --optimize:all
static
@@ -130,6 +138,15 @@
<_TestVariationApplied>true
+
+ $(AppBundleExtraOptions) --optimize:all
+ trimmable-static
+ full
+ $(DefineConstants);OPTIMIZEALL
+ false
+ <_TestVariationApplied>true
+
+
<_InvalidTestVariations Include="$(TestVariation.Split('|'))" Exclude="@(TestVariations)" />
diff --git a/tests/dotnet/UnitTests/AppSizeTest.cs b/tests/dotnet/UnitTests/AppSizeTest.cs
index 59b7c324b0ee..4417700a38b3 100644
--- a/tests/dotnet/UnitTests/AppSizeTest.cs
+++ b/tests/dotnet/UnitTests/AppSizeTest.cs
@@ -63,6 +63,33 @@ public void CoreCLR_Interpreter (ApplePlatform platform, string runtimeIdentifie
Run (platform, runtimeIdentifiers, "Release", $"{platform}-CoreCLR-Interpreter", isTrimmed, dict);
}
+ [TestCase (ApplePlatform.iOS, "ios-arm64")]
+ [TestCase (ApplePlatform.TVOS, "tvos-arm64")]
+ [TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64")]
+ [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64")]
+ public void NativeAOT_TrimmableStatic (ApplePlatform platform, string runtimeIdentifiers)
+ {
+ var dict = new Dictionary () {
+ { "PublishAot", "true" },
+ { "_IsPublishing", "true" },
+ { "NoDSymUtil", "false" }, // off by default for macOS, but we want to test it, so enable it
+ { "Registrar", "trimmable-static" },
+ };
+ Run (platform, runtimeIdentifiers, "Release", $"{platform}-NativeAOT-TrimmableStatic", false, dict);
+ }
+
+ [TestCase (ApplePlatform.MacOSX, "osx-arm64;osx-x64", false)]
+ public void CoreCLR_Interpreter_TrimmableStatic (ApplePlatform platform, string runtimeIdentifiers, bool isTrimmed)
+ {
+ var dict = new Dictionary () {
+ { "UseMonoRuntime", "false" },
+ { "PublishReadyToRun", "false" },
+ { "NoDSymUtil", "false" }, // off by default for macOS, but we want to test it, so enable it
+ { "Registrar", "trimmable-static" },
+ };
+ Run (platform, runtimeIdentifiers, "Release", $"{platform}-CoreCLR-Interpreter-TrimmableStatic", isTrimmed, dict);
+ }
+
[TestCase (ApplePlatform.iOS, "ios-arm64", true)]
[TestCase (ApplePlatform.TVOS, "tvos-arm64", true)]
[TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64", true)]
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt
index f9c6e4fe0beb..52969316ab7a 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-preservedapis.txt
@@ -546,15 +546,15 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -604,7 +604,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.R
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -706,11 +706,11 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/Mon
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -794,6 +794,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Ru
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt
index a94bebfbfee5..15bd4a239ee3 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-Interpreter-size.txt
@@ -1,15 +1,15 @@
-AppBundleSize: 10,487,775 bytes (10,242.0 KB = 10.0 MB)
+AppBundleSize: 10,488,529 bytes (10,242.7 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,528 bytes (236.8 KB = 0.2 MB)
+Contents/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 242,784 bytes (237.1 KB = 0.2 MB)
Contents/MonoBundle/libcoreclr.dylib: 6,385,264 bytes (6,235.6 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,336 bytes (1,408.5 KB = 1.4 MB)
Contents/MonoBundle/libSystem.Native.dylib: 147,744 bytes (144.3 KB = 0.1 MB)
Contents/MonoBundle/libSystem.Net.Security.Native.dylib: 71,232 bytes (69.6 KB = 0.1 MB)
Contents/MonoBundle/libSystem.Security.Cryptography.Native.Apple.dylib: 229,280 bytes (223.9 KB = 0.2 MB)
-Contents/MonoBundle/Microsoft.MacCatalyst.dll: 102,400 bytes (100.0 KB = 0.1 MB)
+Contents/MonoBundle/Microsoft.MacCatalyst.dll: 102,912 bytes (100.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/System.Collections.Immutable.dll: 14,848 bytes (14.5 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 f9c6e4fe0beb..52969316ab7a 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-preservedapis.txt
@@ -546,15 +546,15 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -604,7 +604,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.R
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -706,11 +706,11 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/Mon
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -794,6 +794,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Ru
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-CoreCLR-R2R-size.txt
index ef6be667f3f4..8b2f460454a5 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,346,825 bytes (18,893.4 KB = 18.5 MB)
+AppBundleSize: 19,349,099 bytes (18,895.6 KB = 18.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: 5,105 bytes (5.0 KB = 0.0 MB)
-Contents/Info.plist: 1,127 bytes (1.1 KB = 0.0 MB)
-Contents/MacOS/SizeTestApp: 243,168 bytes (237.5 KB = 0.2 MB)
+Contents/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 243,456 bytes (237.8 KB = 0.2 MB)
Contents/MonoBundle/libcoreclr.dylib: 6,385,264 bytes (6,235.6 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,336 bytes (1,408.5 KB = 1.4 MB)
@@ -12,7 +12,7 @@ Contents/MonoBundle/libSystem.Security.Cryptography.Native.Apple.dylib: 229,280
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,859,280 bytes (8,651.6 KB = 8.4 MB)
+Contents/MonoBundle/SizeTestApp.r2r.dylib: 8,861,280 bytes (8,653.6 KB = 8.5 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)
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt
index fe3160cfff5e..f2b6acc46b9c 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-preservedapis.txt
@@ -584,7 +584,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -592,8 +592,8 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.ReleaseAttribute
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -601,7 +601,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.Int
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List`1, System.Reflection.Assembly)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -682,10 +682,10 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.is_parameter_transient(System.IntP
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsParameterOut(System.IntPtr, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.IsParameterTransient(System.IntPtr, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -746,6 +746,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Ru
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt
index 1d3c5926303c..c592796167c5 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-interpreter-size.txt
@@ -1,9 +1,9 @@
-AppBundleSize: 5,812,402 bytes (5,676.2 KB = 5.5 MB)
+AppBundleSize: 5,816,900 bytes (5,680.6 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,569,648 bytes (4,462.5 KB = 4.4 MB)
-Contents/MonoBundle/Microsoft.MacCatalyst.dll: 157,696 bytes (154.0 KB = 0.2 MB)
+Contents/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 4,573,648 bytes (4,466.5 KB = 4.4 MB)
+Contents/MonoBundle/Microsoft.MacCatalyst.dll: 158,208 bytes (154.5 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,384 bytes (40.4 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 512fbffebf72..263f6f065a0e 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-preservedapis.txt
@@ -443,22 +443,22 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.MacCatalyst.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -518,10 +518,10 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.InitializePlatform(ObjCRuntime.Run
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.invoke_conforms_to_protocol(System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.InvokeConformsToProtocol(System.IntPtr, System.IntPtr, System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -574,6 +574,7 @@ Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Ru
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.MacCatalyst.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt
index fdd18caaac26..4ff9d26289d4 100644
--- a/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-MonoVM-size.txt
@@ -1,10 +1,10 @@
-AppBundleSize: 16,623,446 bytes (16,233.8 KB = 15.9 MB)
+AppBundleSize: 16,628,160 bytes (16,238.4 KB = 15.9 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: 14,065,136 bytes (13,735.5 KB = 13.4 MB)
+Contents/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 14,069,792 bytes (13,740.0 KB = 13.4 MB)
Contents/MonoBundle/aot-instances.aotdata.arm64: 1,051,776 bytes (1,027.1 KB = 1.0 MB)
-Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 35,976 bytes (35.1 KB = 0.0 MB)
+Contents/MonoBundle/Microsoft.MacCatalyst.aotdata.arm64: 36,048 bytes (35.2 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,552 bytes (1.5 KB = 0.0 MB)
diff --git a/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-TrimmableStatic-size.txt b/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-TrimmableStatic-size.txt
new file mode 100644
index 000000000000..685e3bae1e8f
--- /dev/null
+++ b/tests/dotnet/UnitTests/expected/MacCatalyst-NativeAOT-TrimmableStatic-size.txt
@@ -0,0 +1,7 @@
+AppBundleSize: 8,742,751 bytes (8,537.8 KB = 8.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: 2,358 bytes (2.3 KB = 0.0 MB)
+Contents/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 8,737,376 bytes (8,532.6 KB = 8.3 MB)
+Contents/MonoBundle/runtimeconfig.bin: 1,896 bytes (1.9 KB = 0.0 MB)
+Contents/PkgInfo: 8 bytes (0.0 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 b63b20865bd6..98d413189b55 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,814,789 bytes (2,748.8 KB = 2.7 MB)
+AppBundleSize: 2,814,775 bytes (2,748.8 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/Info.plist: 1,113 bytes (1.1 KB = 0.0 MB)
Contents/MacOS/SizeTestApp: 2,809,488 bytes (2,743.6 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-TrimmableStatic-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt
new file mode 100644
index 000000000000..7f7f6a902a42
--- /dev/null
+++ b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-TrimmableStatic-size.txt
@@ -0,0 +1,313 @@
+AppBundleSize: 258,843,206 bytes (252,776.6 KB = 246.9 MB)
+# The following list of files and their sizes is just informational / for review, and isn't used in the test:
+Contents/_CodeSignature/CodeResources: 56,016 bytes (54.7 KB = 0.1 MB)
+Contents/Info.plist: 744 bytes (0.7 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 7,391,168 bytes (7,217.9 KB = 7.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/_Microsoft.macOS.TypeMap.dll: 4,842,496 bytes (4,729.0 KB = 4.6 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/_Microsoft.macOS.TypeMaps.dll: 2,048 bytes (2.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/_SizeTestApp.TypeMap.dll: 3,072 bytes (3.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.CSharp.dll: 882,688 bytes (862.0 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)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.DependencyInjection.Abstractions.dll: 140,800 bytes (137.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Diagnostics.Abstractions.dll: 19,456 bytes (19.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.FileProviders.Abstractions.dll: 15,360 bytes (15.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Hosting.Abstractions.dll: 38,912 bytes (38.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Logging.Abstractions.dll: 150,528 bytes (147.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Options.dll: 135,168 bytes (132.0 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: 38,110,208 bytes (37,217.0 KB = 36.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.VisualBasic.Core.dll: 1,321,472 bytes (1,290.5 KB = 1.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Win32.Registry.dll: 23,552 bytes (23.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/SizeTestApp.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Collections.Concurrent.dll: 136,704 bytes (133.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Collections.dll: 317,952 bytes (310.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Collections.Immutable.dll: 1,105,920 bytes (1,080.0 KB = 1.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Collections.NonGeneric.dll: 94,208 bytes (92.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Collections.Specialized.dll: 94,720 bytes (92.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ComponentModel.Annotations.dll: 206,336 bytes (201.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ComponentModel.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ComponentModel.EventBasedAsync.dll: 28,672 bytes (28.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ComponentModel.Primitives.dll: 69,632 bytes (68.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ComponentModel.TypeConverter.dll: 867,840 bytes (847.5 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Console.dll: 215,040 bytes (210.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Data.Common.dll: 3,212,800 bytes (3,137.5 KB = 3.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.DiagnosticSource.dll: 549,888 bytes (537.0 KB = 0.5 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.FileVersionInfo.dll: 35,840 bytes (35.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.Process.dll: 352,768 bytes (344.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.StackTrace.dll: 26,112 bytes (25.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.TextWriterTraceListener.dll: 55,296 bytes (54.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Diagnostics.TraceSource.dll: 141,312 bytes (138.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Drawing.Primitives.dll: 118,272 bytes (115.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Formats.Asn1.dll: 249,344 bytes (243.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Formats.Tar.dll: 316,416 bytes (309.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Compression.Brotli.dll: 73,728 bytes (72.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Compression.dll: 540,672 bytes (528.0 KB = 0.5 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Compression.ZipFile.dll: 91,136 bytes (89.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.FileSystem.AccessControl.dll: 22,528 bytes (22.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.FileSystem.DriveInfo.dll: 78,848 bytes (77.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.FileSystem.Watcher.dll: 111,616 bytes (109.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.IsolatedStorage.dll: 73,728 bytes (72.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.MemoryMappedFiles.dll: 84,480 bytes (82.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Pipelines.dll: 189,440 bytes (185.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Pipes.AccessControl.dll: 13,824 bytes (13.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.IO.Pipes.dll: 136,192 bytes (133.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Linq.AsyncEnumerable.dll: 1,483,776 bytes (1,449.0 KB = 1.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Linq.dll: 787,968 bytes (769.5 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Linq.Expressions.dll: 4,638,208 bytes (4,529.5 KB = 4.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Linq.Parallel.dll: 882,176 bytes (861.5 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Linq.Queryable.dll: 204,288 bytes (199.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Memory.dll: 154,624 bytes (151.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Http.dll: 1,875,456 bytes (1,831.5 KB = 1.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Http.Json.dll: 119,296 bytes (116.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.HttpListener.dll: 316,928 bytes (309.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Mail.dll: 530,432 bytes (518.0 KB = 0.5 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.NameResolution.dll: 105,472 bytes (103.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.NetworkInformation.dll: 142,336 bytes (139.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Ping.dll: 88,576 bytes (86.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Primitives.dll: 241,152 bytes (235.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Quic.dll: 372,224 bytes (363.5 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Requests.dll: 406,016 bytes (396.5 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Security.dll: 793,088 bytes (774.5 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.ServerSentEvents.dll: 67,584 bytes (66.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.Sockets.dll: 694,784 bytes (678.5 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.WebClient.dll: 166,912 bytes (163.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.WebHeaderCollection.dll: 52,224 bytes (51.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.WebProxy.dll: 26,624 bytes (26.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.WebSockets.Client.dll: 89,088 bytes (87.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Net.WebSockets.dll: 238,592 bytes (233.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.ObjectModel.dll: 67,072 bytes (65.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Private.CoreLib.dll: 17,900,032 bytes (17,480.5 KB = 17.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Private.DataContractSerialization.dll: 2,376,192 bytes (2,320.5 KB = 2.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Private.Uri.dll: 252,928 bytes (247.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Private.Xml.dll: 8,779,776 bytes (8,574.0 KB = 8.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Private.Xml.Linq.dll: 414,208 bytes (404.5 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Reflection.DispatchProxy.dll: 62,976 bytes (61.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Reflection.Emit.dll: 335,872 bytes (328.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Reflection.Metadata.dll: 1,272,832 bytes (1,243.0 KB = 1.2 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Reflection.TypeExtensions.dll: 24,064 bytes (23.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Resources.Writer.dll: 35,840 bytes (35.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.CompilerServices.VisualC.dll: 8,704 bytes (8.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.InteropServices.dll: 100,864 bytes (98.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.InteropServices.JavaScript.dll: 27,136 bytes (26.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.Numerics.dll: 441,856 bytes (431.5 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.Serialization.Formatters.dll: 118,784 bytes (116.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Runtime.Serialization.Primitives.dll: 19,968 bytes (19.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Security.AccessControl.dll: 45,056 bytes (44.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Security.Claims.dll: 91,648 bytes (89.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Security.Cryptography.dll: 2,458,112 bytes (2,400.5 KB = 2.3 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Security.Principal.Windows.dll: 27,648 bytes (27.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Text.Encoding.CodePages.dll: 856,576 bytes (836.5 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Text.Encodings.Web.dll: 113,152 bytes (110.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Text.Json.dll: 2,158,080 bytes (2,107.5 KB = 2.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Text.RegularExpressions.dll: 1,179,648 bytes (1,152.0 KB = 1.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Threading.AccessControl.dll: 23,552 bytes (23.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Threading.Channels.dll: 155,136 bytes (151.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Threading.dll: 71,168 bytes (69.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Threading.Tasks.Dataflow.dll: 522,240 bytes (510.0 KB = 0.5 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Threading.Tasks.Parallel.dll: 122,880 bytes (120.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Transactions.Local.dll: 386,048 bytes (377.0 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Web.HttpUtility.dll: 47,104 bytes (46.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/System.Xml.XPath.XDocument.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/_Microsoft.macOS.TypeMap.dll: 4,842,496 bytes (4,729.0 KB = 4.6 MB)
+Contents/MonoBundle/.xamarin/osx-x64/_Microsoft.macOS.TypeMaps.dll: 2,048 bytes (2.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/_SizeTestApp.TypeMap.dll: 3,072 bytes (3.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.CSharp.dll: 785,408 bytes (767.0 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Caching.Abstractions.dll: 52,224 bytes (51.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Configuration.Abstractions.dll: 26,624 bytes (26.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.DependencyInjection.Abstractions.dll: 123,392 bytes (120.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Diagnostics.Abstractions.dll: 18,432 bytes (18.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.FileProviders.Abstractions.dll: 14,336 bytes (14.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Hosting.Abstractions.dll: 36,352 bytes (35.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Logging.Abstractions.dll: 134,656 bytes (131.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Options.dll: 119,808 bytes (117.0 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: 38,110,208 bytes (37,217.0 KB = 36.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.VisualBasic.Core.dll: 1,152,000 bytes (1,125.0 KB = 1.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Win32.Registry.dll: 23,040 bytes (22.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/SizeTestApp.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Collections.Concurrent.dll: 122,368 bytes (119.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Collections.dll: 278,016 bytes (271.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Collections.Immutable.dll: 973,824 bytes (951.0 KB = 0.9 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Collections.NonGeneric.dll: 82,432 bytes (80.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Collections.Specialized.dll: 82,432 bytes (80.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ComponentModel.Annotations.dll: 181,248 bytes (177.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ComponentModel.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ComponentModel.EventBasedAsync.dll: 26,112 bytes (25.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ComponentModel.Primitives.dll: 60,416 bytes (59.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ComponentModel.TypeConverter.dll: 752,640 bytes (735.0 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Console.dll: 188,416 bytes (184.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Data.Common.dll: 2,784,256 bytes (2,719.0 KB = 2.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.DiagnosticSource.dll: 488,960 bytes (477.5 KB = 0.5 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.FileVersionInfo.dll: 33,280 bytes (32.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.Process.dll: 305,152 bytes (298.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.StackTrace.dll: 25,088 bytes (24.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.TextWriterTraceListener.dll: 48,640 bytes (47.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Diagnostics.TraceSource.dll: 120,832 bytes (118.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Drawing.Primitives.dll: 113,152 bytes (110.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Formats.Asn1.dll: 222,208 bytes (217.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Formats.Tar.dll: 274,944 bytes (268.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Compression.Brotli.dll: 63,488 bytes (62.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Compression.dll: 465,920 bytes (455.0 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Compression.ZipFile.dll: 81,920 bytes (80.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.FileSystem.AccessControl.dll: 22,528 bytes (22.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.FileSystem.DriveInfo.dll: 69,120 bytes (67.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.FileSystem.Watcher.dll: 96,256 bytes (94.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.IsolatedStorage.dll: 66,560 bytes (65.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.MemoryMappedFiles.dll: 72,704 bytes (71.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Pipelines.dll: 171,520 bytes (167.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Pipes.AccessControl.dll: 13,824 bytes (13.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.IO.Pipes.dll: 117,248 bytes (114.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Linq.AsyncEnumerable.dll: 1,320,960 bytes (1,290.0 KB = 1.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Linq.dll: 689,664 bytes (673.5 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Linq.Expressions.dll: 3,709,952 bytes (3,623.0 KB = 3.5 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Linq.Parallel.dll: 766,464 bytes (748.5 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Linq.Queryable.dll: 168,448 bytes (164.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Memory.dll: 142,336 bytes (139.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Http.dll: 1,654,272 bytes (1,615.5 KB = 1.6 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Http.Json.dll: 109,568 bytes (107.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.HttpListener.dll: 279,552 bytes (273.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Mail.dll: 462,336 bytes (451.5 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.NameResolution.dll: 92,160 bytes (90.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.NetworkInformation.dll: 123,904 bytes (121.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Ping.dll: 78,336 bytes (76.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Primitives.dll: 212,480 bytes (207.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Quic.dll: 330,752 bytes (323.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Requests.dll: 352,256 bytes (344.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Security.dll: 689,152 bytes (673.0 KB = 0.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.ServerSentEvents.dll: 61,952 bytes (60.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.Sockets.dll: 594,944 bytes (581.0 KB = 0.6 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.WebClient.dll: 147,456 bytes (144.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.WebHeaderCollection.dll: 44,544 bytes (43.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.WebProxy.dll: 24,064 bytes (23.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.WebSockets.Client.dll: 79,872 bytes (78.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Net.WebSockets.dll: 212,992 bytes (208.0 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.ObjectModel.dll: 58,880 bytes (57.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Private.CoreLib.dll: 16,445,440 bytes (16,060.0 KB = 15.7 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Private.DataContractSerialization.dll: 2,049,536 bytes (2,001.5 KB = 2.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Private.Uri.dll: 229,888 bytes (224.5 KB = 0.2 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Private.Xml.dll: 7,654,400 bytes (7,475.0 KB = 7.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Private.Xml.Linq.dll: 358,912 bytes (350.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Reflection.DispatchProxy.dll: 56,832 bytes (55.5 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Reflection.Emit.dll: 293,888 bytes (287.0 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Reflection.Metadata.dll: 1,142,272 bytes (1,115.5 KB = 1.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Reflection.TypeExtensions.dll: 21,504 bytes (21.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Resources.Writer.dll: 32,256 bytes (31.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.CompilerServices.VisualC.dll: 8,704 bytes (8.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.InteropServices.dll: 92,160 bytes (90.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.InteropServices.JavaScript.dll: 27,136 bytes (26.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.Numerics.dll: 412,672 bytes (403.0 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.Serialization.Formatters.dll: 105,472 bytes (103.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Runtime.Serialization.Primitives.dll: 18,432 bytes (18.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Security.AccessControl.dll: 45,056 bytes (44.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Security.Claims.dll: 81,920 bytes (80.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Security.Cryptography.dll: 2,130,944 bytes (2,081.0 KB = 2.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Security.Principal.Windows.dll: 27,648 bytes (27.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Text.Encoding.CodePages.dll: 839,680 bytes (820.0 KB = 0.8 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Text.Encodings.Web.dll: 104,448 bytes (102.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Text.Json.dll: 1,931,264 bytes (1,886.0 KB = 1.8 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Text.RegularExpressions.dll: 1,052,160 bytes (1,027.5 KB = 1.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Threading.AccessControl.dll: 23,040 bytes (22.5 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Threading.Channels.dll: 139,264 bytes (136.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Threading.dll: 64,512 bytes (63.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Threading.Tasks.Dataflow.dll: 460,800 bytes (450.0 KB = 0.4 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Threading.Tasks.Parallel.dll: 109,568 bytes (107.0 KB = 0.1 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Transactions.Local.dll: 341,504 bytes (333.5 KB = 0.3 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Web.HttpUtility.dll: 43,008 bytes (42.0 KB = 0.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/System.Xml.XPath.XDocument.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/libclrgc.dylib: 2,038,208 bytes (1,990.4 KB = 1.9 MB)
+Contents/MonoBundle/libclrgcexp.dylib: 2,198,640 bytes (2,147.1 KB = 2.1 MB)
+Contents/MonoBundle/libclrjit.dylib: 6,522,368 bytes (6,369.5 KB = 6.2 MB)
+Contents/MonoBundle/libcoreclr.dylib: 12,828,256 bytes (12,527.6 KB = 12.2 MB)
+Contents/MonoBundle/libhostfxr.dylib: 833,536 bytes (814.0 KB = 0.8 MB)
+Contents/MonoBundle/libhostpolicy.dylib: 776,624 bytes (758.4 KB = 0.7 MB)
+Contents/MonoBundle/libmscordaccore.dylib: 4,453,600 bytes (4,349.2 KB = 4.2 MB)
+Contents/MonoBundle/libmscordbi.dylib: 3,447,008 bytes (3,366.2 KB = 3.3 MB)
+Contents/MonoBundle/libSystem.Globalization.Native.dylib: 286,816 bytes (280.1 KB = 0.3 MB)
+Contents/MonoBundle/libSystem.IO.Compression.Native.dylib: 3,278,688 bytes (3,201.8 KB = 3.1 MB)
+Contents/MonoBundle/libSystem.Native.dylib: 296,416 bytes (289.5 KB = 0.3 MB)
+Contents/MonoBundle/libSystem.Net.Security.Native.dylib: 136,768 bytes (133.6 KB = 0.1 MB)
+Contents/MonoBundle/libSystem.Security.Cryptography.Native.Apple.dylib: 460,880 bytes (450.1 KB = 0.4 MB)
+Contents/MonoBundle/Microsoft.VisualBasic.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/Microsoft.Win32.Primitives.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/mscorlib.dll: 49,664 bytes (48.5 KB = 0.0 MB)
+Contents/MonoBundle/netstandard.dll: 91,136 bytes (89.0 KB = 0.1 MB)
+Contents/MonoBundle/runtimeconfig.bin: 1,445 bytes (1.4 KB = 0.0 MB)
+Contents/MonoBundle/System.AppContext.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Buffers.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.ComponentModel.DataAnnotations.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Configuration.dll: 9,216 bytes (9.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Core.dll: 13,312 bytes (13.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Data.DataSetExtensions.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Data.dll: 15,360 bytes (15.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Diagnostics.Contracts.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Diagnostics.Debug.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Diagnostics.Tools.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Diagnostics.Tracing.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.dll: 40,448 bytes (39.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Drawing.dll: 10,240 bytes (10.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Dynamic.Runtime.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Globalization.Calendars.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Globalization.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Globalization.Extensions.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.IO.Compression.FileSystem.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.IO.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.IO.FileSystem.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.IO.FileSystem.Primitives.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.IO.UnmanagedMemoryStream.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Net.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Net.ServicePoint.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Numerics.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Numerics.Vectors.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Reflection.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Reflection.Emit.ILGeneration.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Reflection.Emit.Lightweight.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Reflection.Extensions.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Reflection.Primitives.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Resources.Reader.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Resources.ResourceManager.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.CompilerServices.Unsafe.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.dll: 35,328 bytes (34.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Extensions.dll: 7,680 bytes (7.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Handles.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.InteropServices.RuntimeInformation.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Intrinsics.dll: 8,704 bytes (8.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Loader.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Serialization.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Serialization.Json.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Runtime.Serialization.Xml.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.Algorithms.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.Cng.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.Csp.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.Encoding.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.OpenSsl.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.Primitives.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Cryptography.X509Certificates.dll: 7,168 bytes (7.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.dll: 8,192 bytes (8.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.Principal.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Security.SecureString.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.ServiceModel.Web.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/System.ServiceProcess.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Text.Encoding.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Text.Encoding.Extensions.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.Overlapped.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.Tasks.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.Tasks.Extensions.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.Thread.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.ThreadPool.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Threading.Timer.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Transactions.dll: 6,656 bytes (6.5 KB = 0.0 MB)
+Contents/MonoBundle/System.ValueTuple.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Web.dll: 5,120 bytes (5.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Windows.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.dll: 13,312 bytes (13.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.Linq.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.ReaderWriter.dll: 11,776 bytes (11.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.Serialization.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.XDocument.dll: 6,144 bytes (6.0 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.XmlDocument.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.XmlSerializer.dll: 7,680 bytes (7.5 KB = 0.0 MB)
+Contents/MonoBundle/System.Xml.XPath.dll: 5,632 bytes (5.5 KB = 0.0 MB)
+Contents/MonoBundle/WindowsBase.dll: 6,144 bytes (6.0 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/MacOSX-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-CoreCLR-Interpreter-size.txt
index a585fc7bcf22..e9764b715071 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,922,534 bytes (241,135.3 KB = 235.5 MB)
+AppBundleSize: 246,979,880 bytes (241,191.3 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,432 bytes (7,777.8 KB = 7.6 MB)
+Contents/Info.plist: 744 bytes (0.7 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 8,014,624 bytes (7,826.8 KB = 7.6 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.CSharp.dll: 882,688 bytes (862.0 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: 150,528 bytes (147.0 KB = 0.1 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Options.dll: 135,168 bytes (132.0 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: 36,710,400 bytes (35,850.0 KB = 35.0 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.macOS.dll: 36,713,984 bytes (35,853.5 KB = 35.0 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.VisualBasic.Core.dll: 1,321,472 bytes (1,290.5 KB = 1.3 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Win32.Registry.dll: 23,552 bytes (23.0 KB = 0.0 MB)
Contents/MonoBundle/.xamarin/osx-arm64/SizeTestApp.dll: 6,656 bytes (6.5 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: 134,656 bytes (131.5 KB = 0.1 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Options.dll: 119,808 bytes (117.0 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: 36,710,400 bytes (35,850.0 KB = 35.0 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.macOS.dll: 36,713,984 bytes (35,853.5 KB = 35.0 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.VisualBasic.Core.dll: 1,152,000 bytes (1,125.0 KB = 1.1 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Win32.Registry.dll: 23,040 bytes (22.5 KB = 0.0 MB)
Contents/MonoBundle/.xamarin/osx-x64/SizeTestApp.dll: 6,656 bytes (6.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 75733e8b1bff..54fb4d889b26 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: 312,059,686 bytes (304,745.8 KB = 297.6 MB)
+AppBundleSize: 312,120,616 bytes (304,805.3 KB = 297.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: 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,432 bytes (7,777.8 KB = 7.6 MB)
+Contents/Info.plist: 744 bytes (0.7 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 8,014,624 bytes (7,826.8 KB = 7.6 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.CSharp.dll: 882,688 bytes (862.0 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: 150,528 bytes (147.0 KB = 0.1 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Extensions.Options.dll: 135,168 bytes (132.0 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,032,064 bytes (73,273.5 KB = 71.6 MB)
+Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.macOS.dll: 75,037,696 bytes (73,279.0 KB = 71.6 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.VisualBasic.Core.dll: 1,321,472 bytes (1,290.5 KB = 1.3 MB)
Contents/MonoBundle/.xamarin/osx-arm64/Microsoft.Win32.Registry.dll: 23,552 bytes (23.0 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: 134,656 bytes (131.5 KB = 0.1 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Extensions.Options.dll: 119,808 bytes (117.0 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: 63,519,232 bytes (62,030.5 KB = 60.6 MB)
+Contents/MonoBundle/.xamarin/osx-x64/Microsoft.macOS.dll: 63,524,352 bytes (62,035.5 KB = 60.6 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.VisualBasic.Core.dll: 1,152,000 bytes (1,125.0 KB = 1.1 MB)
Contents/MonoBundle/.xamarin/osx-x64/Microsoft.Win32.Registry.dll: 23,040 bytes (22.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-TrimmableStatic-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-TrimmableStatic-size.txt
new file mode 100644
index 000000000000..133de1b959da
--- /dev/null
+++ b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-TrimmableStatic-size.txt
@@ -0,0 +1,8 @@
+AppBundleSize: 18,618,637 bytes (18,182.3 KB = 17.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: 744 bytes (0.7 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 18,613,152 bytes (18,176.9 KB = 17.8 MB)
+Contents/MonoBundle/runtimeconfig.bin: 1,848 bytes (1.8 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/MacOSX-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt
index b17c5234d53c..3668e3589dde 100644
--- a/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt
+++ b/tests/dotnet/UnitTests/expected/MacOSX-NativeAOT-size.txt
@@ -1,8 +1,8 @@
-AppBundleSize: 6,087,337 bytes (5,944.7 KB = 5.8 MB)
+AppBundleSize: 6,087,339 bytes (5,944.7 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: 6,081,920 bytes (5,939.4 KB = 5.8 MB)
+Contents/Info.plist: 744 bytes (0.7 KB = 0.0 MB)
+Contents/MacOS/SizeTestApp: 6,081,936 bytes (5,939.4 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 6271e5455983..7e5869c452e7 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-preservedapis.txt
@@ -539,7 +539,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -547,8 +547,8 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.Runtime
Microsoft.tvOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -598,7 +598,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.Runtime/
Microsoft.tvOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -700,11 +700,11 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/MonoObject
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -788,6 +788,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/I
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-Interpreter-size.txt
index 990e9f0a800f..d0355fc9067b 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,189,266 bytes (8,973.9 KB = 8.8 MB)
+AppBundleSize: 9,189,694 bytes (8,974.3 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: 803 bytes (0.8 KB = 0.0 MB)
Frameworks/libcoreclr.framework/libcoreclr: 5,199,600 bytes (5,077.7 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: 845 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: 847 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,664 bytes (1,405.9 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: 817 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.Native.framework/libSystem.Native: 162,544 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: 873 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 215,440 bytes (210.4 KB = 0.2 MB)
-Info.plist: 1,145 bytes (1.1 KB = 0.0 MB)
-Microsoft.tvOS.dll: 99,328 bytes (97.0 KB = 0.1 MB)
+Info.plist: 1,131 bytes (1.1 KB = 0.0 MB)
+Microsoft.tvOS.dll: 99,840 bytes (97.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)
SizeTestApp: 197,024 bytes (192.4 KB = 0.2 MB)
diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt
index 6271e5455983..7e5869c452e7 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-preservedapis.txt
@@ -539,7 +539,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -547,8 +547,8 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.Runtime
Microsoft.tvOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -598,7 +598,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.Runtime/
Microsoft.tvOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -700,11 +700,11 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/MonoObject
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -788,6 +788,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/I
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt
index 0e0ecdcc43a4..62bfa9133551 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-CoreCLR-R2R-size.txt
@@ -1,27 +1,27 @@
-AppBundleSize: 12,616,667 bytes (12,321.0 KB = 12.0 MB)
+AppBundleSize: 12,617,081 bytes (12,321.4 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,737 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: 803 bytes (0.8 KB = 0.0 MB)
Frameworks/libcoreclr.framework/libcoreclr: 5,199,600 bytes (5,077.7 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: 845 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: 847 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,439,664 bytes (1,405.9 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: 817 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.Native.framework/libSystem.Native: 162,544 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: 873 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 215,440 bytes (210.4 KB = 0.2 MB)
Frameworks/SizeTestApp.r2r.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB)
-Frameworks/SizeTestApp.r2r.framework/Info.plist: 829 bytes (0.8 KB = 0.0 MB)
+Frameworks/SizeTestApp.r2r.framework/Info.plist: 815 bytes (0.8 KB = 0.0 MB)
Frameworks/SizeTestApp.r2r.framework/SizeTestApp.r2r: 3,424,784 bytes (3,344.5 KB = 3.3 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,131 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,152 bytes (192.5 KB = 0.2 MB)
diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt
index c110a2d0a924..eab1d10655d9 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-preservedapis.txt
@@ -579,7 +579,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -588,8 +588,8 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManage
Microsoft.tvOS.dll:ObjCRuntime.ReleaseAttribute
Microsoft.tvOS.dll:ObjCRuntime.Runtime
Microsoft.tvOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -597,7 +597,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, Sy
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List`1, System.Reflection.Assembly)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -678,10 +678,10 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.is_parameter_transient(System.IntPtr, Sys
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsParameterOut(System.IntPtr, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.IsParameterTransient(System.IntPtr, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -742,6 +742,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/I
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt
index 193e8238e018..73eaf73e7ddb 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-interpreter-size.txt
@@ -1,9 +1,9 @@
-AppBundleSize: 3,634,773 bytes (3,549.6 KB = 3.5 MB)
+AppBundleSize: 3,635,271 bytes (3,550.1 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)
-Microsoft.tvOS.dll: 154,624 bytes (151.0 KB = 0.1 MB)
+Info.plist: 1,131 bytes (1.1 KB = 0.0 MB)
+Microsoft.tvOS.dll: 155,136 bytes (151.5 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)
diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt
index b17e6bbbda2a..c349ba8ecd33 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-preservedapis.txt
@@ -438,7 +438,7 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -446,15 +446,15 @@ Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.tvOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.tvOS.dll:ObjCRuntime.Runtime
Microsoft.tvOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -514,10 +514,10 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime.InitializePlatform(ObjCRuntime.Runtime/In
Microsoft.tvOS.dll:ObjCRuntime.Runtime.invoke_conforms_to_protocol(System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.InvokeConformsToProtocol(System.IntPtr, System.IntPtr, System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.tvOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.tvOS.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -570,6 +570,7 @@ Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/I
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.tvOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt
index b5f16a0b4f28..040176540eaa 100644
--- a/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt
+++ b/tests/dotnet/UnitTests/expected/TVOS-MonoVM-size.txt
@@ -1,14 +1,14 @@
-AppBundleSize: 9,563,339 bytes (9,339.2 KB = 9.1 MB)
+AppBundleSize: 9,563,397 bytes (9,339.3 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: 829,256 bytes (809.8 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,584 bytes (22.1 KB = 0.0 MB)
+Info.plist: 1,131 bytes (1.1 KB = 0.0 MB)
+Microsoft.tvOS.aotdata.arm64: 22,640 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,426,880 bytes (7,252.8 KB = 7.1 MB)
+SizeTestApp: 7,426,896 bytes (7,252.8 KB = 7.1 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: 668,136 bytes (652.5 KB = 0.6 MB)
diff --git a/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-TrimmableStatic-size.txt b/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-TrimmableStatic-size.txt
new file mode 100644
index 000000000000..b773aeda645a
--- /dev/null
+++ b/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-TrimmableStatic-size.txt
@@ -0,0 +1,8 @@
+AppBundleSize: 7,921,345 bytes (7,735.7 KB = 7.6 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,131 bytes (1.1 KB = 0.0 MB)
+PkgInfo: 8 bytes (0.0 KB = 0.0 MB)
+runtimeconfig.bin: 1,889 bytes (1.8 KB = 0.0 MB)
+SizeTestApp: 7,915,344 bytes (7,729.8 KB = 7.5 MB)
diff --git a/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/TVOS-NativeAOT-size.txt
index 394bc9b4a4ce..f8c922db6551 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,832,462 bytes (2,766.1 KB = 2.7 MB)
+AppBundleSize: 2,848,960 bytes (2,782.2 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,131 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,826,528 bytes (2,760.3 KB = 2.7 MB)
+SizeTestApp: 2,843,040 bytes (2,776.4 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 08b76815a108..18fcdfab759e 100644
--- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-preservedapis.txt
@@ -539,7 +539,7 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -547,8 +547,8 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.Runtime
Microsoft.iOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -598,7 +598,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.Runtime/M
Microsoft.iOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -700,11 +700,11 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/MonoObject*
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -788,6 +788,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/In
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-Interpreter-size.txt
index 72f9c63184c0..75544461d484 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,257,533 bytes (9,040.6 KB = 8.8 MB)
+AppBundleSize: 9,257,947 bytes (9,041.0 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: 827 bytes (0.8 KB = 0.0 MB)
Frameworks/libcoreclr.framework/libcoreclr: 5,187,184 bytes (5,065.6 KB = 4.9 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: 869 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: 871 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,408 bytes (1,397.9 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: 841 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.Native.framework/libSystem.Native: 162,336 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: 867 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: 897 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 214,336 bytes (209.3 KB = 0.2 MB)
-Info.plist: 1,169 bytes (1.1 KB = 0.0 MB)
-Microsoft.iOS.dll: 99,328 bytes (97.0 KB = 0.1 MB)
+Info.plist: 1,155 bytes (1.1 KB = 0.0 MB)
+Microsoft.iOS.dll: 99,840 bytes (97.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)
SizeTestApp: 196,000 bytes (191.4 KB = 0.2 MB)
diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt
index 08b76815a108..18fcdfab759e 100644
--- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-preservedapis.txt
@@ -539,7 +539,7 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -547,8 +547,8 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.Runtime
Microsoft.iOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -598,7 +598,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.bridge_type_to_class(ObjCRuntime.Runtime/M
Microsoft.iOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ClassGetName(ObjCRuntime.Runtime/MonoObject*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ClassGetNamespace(ObjCRuntime.Runtime/MonoObject*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -700,11 +700,11 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.IsNullable(ObjCRuntime.Runtime/MonoObject*
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsNullable(System.Type)
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsValueType(ObjCRuntime.Runtime/MonoObject*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupType(ObjCRuntime.Runtime/TypeLookup)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MarshalStructure`1(T)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MonoHashTableInsert(ObjCRuntime.Runtime/MonoObject*, System.IntPtr, ObjCRuntime.Runtime/MonoObject*)
@@ -788,6 +788,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/In
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt
index 936c576a7f51..055cf2611c8b 100644
--- a/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-CoreCLR-R2R-size.txt
@@ -1,30 +1,30 @@
-AppBundleSize: 12,665,118 bytes (12,368.3 KB = 12.1 MB)
+AppBundleSize: 12,665,518 bytes (12,368.7 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,733 bytes (11.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: 841 bytes (0.8 KB = 0.0 MB)
+Frameworks/libcoreclr.framework/Info.plist: 827 bytes (0.8 KB = 0.0 MB)
Frameworks/libcoreclr.framework/libcoreclr: 5,187,184 bytes (5,065.6 KB = 4.9 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: 869 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: 871 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.IO.Compression.Native.framework/libSystem.IO.Compression.Native: 1,431,408 bytes (1,397.9 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: 841 bytes (0.8 KB = 0.0 MB)
Frameworks/libSystem.Native.framework/libSystem.Native: 162,336 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: 867 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: 897 bytes (0.9 KB = 0.0 MB)
Frameworks/libSystem.Security.Cryptography.Native.Apple.framework/libSystem.Security.Cryptography.Native.Apple: 214,336 bytes (209.3 KB = 0.2 MB)
Frameworks/SizeTestApp.r2r.framework/_CodeSignature/CodeResources: 1,798 bytes (1.8 KB = 0.0 MB)
-Frameworks/SizeTestApp.r2r.framework/Info.plist: 853 bytes (0.8 KB = 0.0 MB)
+Frameworks/SizeTestApp.r2r.framework/Info.plist: 839 bytes (0.8 KB = 0.0 MB)
Frameworks/SizeTestApp.r2r.framework/SizeTestApp.r2r: 3,404,976 bytes (3,325.2 KB = 3.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,155 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,096 bytes (191.5 KB = 0.2 MB)
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt
index f43b9c42416e..7c23a08d413d 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-preservedapis.txt
@@ -579,7 +579,7 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -588,8 +588,8 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManaged
Microsoft.iOS.dll:ObjCRuntime.ReleaseAttribute
Microsoft.iOS.dll:ObjCRuntime.Runtime
Microsoft.iOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
@@ -597,7 +597,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, Sys
Microsoft.iOS.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.CollectReferencedAssemblies(System.Collections.Generic.List`1, System.Reflection.Assembly)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -678,10 +678,10 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.is_parameter_transient(System.IntPtr, Syst
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsParameterOut(System.IntPtr, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.Runtime.IsParameterTransient(System.IntPtr, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.iOS.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -742,6 +742,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/In
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
index cefa3f9161c5..31cd010d64fa 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-interpreter-size.txt
@@ -1,9 +1,9 @@
-AppBundleSize: 3,621,211 bytes (3,536.3 KB = 3.5 MB)
+AppBundleSize: 3,621,709 bytes (3,536.8 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)
-Microsoft.iOS.dll: 154,624 bytes (151.0 KB = 0.1 MB)
+Info.plist: 1,155 bytes (1.1 KB = 0.0 MB)
+Microsoft.iOS.dll: 155,136 bytes (151.5 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)
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt
index cafb963c0177..6ac09c20f0e1 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-preservedapis.txt
@@ -438,7 +438,7 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.GetMapEntry(System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Initialize()
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredType(System.Reflection.Assembly, System.UInt32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupRegisteredTypeId(System.Type)
-Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunction(System.IntPtr, System.String, System.Int32, System.String)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.LookupUnmanagedFunctionInAssembly(System.IntPtr, System.String, System.Int32)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.Register(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper.TryGetMapEntry(System.String, out ObjCRuntime.RegistrarHelper/MapInfo&)
@@ -446,15 +446,15 @@ Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo
Microsoft.iOS.dll:ObjCRuntime.RegistrarHelper/MapInfo..ctor(ObjCRuntime.IManagedRegistrar)
Microsoft.iOS.dll:ObjCRuntime.Runtime
Microsoft.iOS.dll:ObjCRuntime.Runtime..cctor()
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|287_0`1(ObjCRuntime.NativeHandle, System.Boolean)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|286_0`1(ObjCRuntime.NativeHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructINativeObjectViaFactoryMethod|289_0`1(ObjCRuntime.NativeHandle, System.Boolean)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.g__ConstructNSObjectViaFactoryMethod|288_0`1(ObjCRuntime.NativeHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object, System.Runtime.InteropServices.GCHandleType)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AllocGCHandle(System.Object)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AppendAdditionalInformation(System.Text.StringBuilder, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.attempt_retain_nsobject(System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.AttemptRetainNSObject(System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.CannotCreateManagedInstanceOfGenericType(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructINativeObject`1(System.IntPtr, System.Boolean, System.Type, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject(System.IntPtr, System.IntPtr, ObjCRuntime.Runtime/MissingCtorResolution)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.ConstructNSObject`1(System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution)
@@ -514,10 +514,10 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime.InitializePlatform(ObjCRuntime.Runtime/Ini
Microsoft.iOS.dll:ObjCRuntime.Runtime.invoke_conforms_to_protocol(System.IntPtr, System.IntPtr, System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.InvokeConformsToProtocol(System.IntPtr, System.IntPtr, System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_managed_type_name(System.IntPtr, System.IntPtr*)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr*)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.lookup_unmanaged_function(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr, System.IntPtr*)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupINativeObjectImplementation(System.IntPtr, System.Type, System.Type, System.Boolean)
Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupManagedTypeName(System.IntPtr)
-Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32)
+Microsoft.iOS.dll:ObjCRuntime.Runtime.LookupUnmanagedFunction(System.IntPtr, System.IntPtr, System.Int32, System.IntPtr)
Microsoft.iOS.dll:ObjCRuntime.Runtime.MissingCtor(System.IntPtr, System.IntPtr, System.Type, ObjCRuntime.Runtime/MissingCtorResolution, System.IntPtr, System.RuntimeMethodHandle)
Microsoft.iOS.dll:ObjCRuntime.Runtime.NativeObjectHasDied(System.IntPtr, Foundation.NSObject)
Microsoft.iOS.dll:ObjCRuntime.Runtime.NSLog(System.String)
@@ -570,6 +570,7 @@ Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/In
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsNativeAOT
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsPartialStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsSimulator
+Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationFlags::IsTrimmableStaticRegistrar
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationFlags ObjCRuntime.Runtime/InitializationOptions::Flags
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions
Microsoft.iOS.dll:ObjCRuntime.Runtime/InitializationOptions* ObjCRuntime.Runtime::options
diff --git a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
index 1c993fa563cd..80996ab5b331 100644
--- a/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
+++ b/tests/dotnet/UnitTests/expected/iOS-MonoVM-size.txt
@@ -1,10 +1,10 @@
-AppBundleSize: 9,520,327 bytes (9,297.2 KB = 9.1 MB)
+AppBundleSize: 9,520,361 bytes (9,297.2 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,229 bytes (5.1 KB = 0.0 MB)
aot-instances.aotdata.arm64: 829,256 bytes (809.8 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,944 bytes (22.4 KB = 0.0 MB)
+Info.plist: 1,155 bytes (1.1 KB = 0.0 MB)
+Microsoft.iOS.aotdata.arm64: 22,992 bytes (22.5 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)
diff --git a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-TrimmableStatic-size.txt b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-TrimmableStatic-size.txt
new file mode 100644
index 000000000000..408b7df691f8
--- /dev/null
+++ b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-TrimmableStatic-size.txt
@@ -0,0 +1,8 @@
+AppBundleSize: 9,054,824 bytes (8,842.6 KB = 8.6 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,155 bytes (1.1 KB = 0.0 MB)
+PkgInfo: 8 bytes (0.0 KB = 0.0 MB)
+runtimeconfig.bin: 1,888 bytes (1.8 KB = 0.0 MB)
+SizeTestApp: 9,048,800 bytes (8,836.7 KB = 8.6 MB)
diff --git a/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt b/tests/dotnet/UnitTests/expected/iOS-NativeAOT-size.txt
index 9f098fb29903..e282ddec79e5 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,832,902 bytes (2,766.5 KB = 2.7 MB)
+AppBundleSize: 2,832,888 bytes (2,766.5 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,155 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,826,944 bytes (2,760.7 KB = 2.7 MB)
diff --git a/tests/introspection/ApiBaseTest.cs b/tests/introspection/ApiBaseTest.cs
index af67f58c996e..02cd37df96cd 100644
--- a/tests/introspection/ApiBaseTest.cs
+++ b/tests/introspection/ApiBaseTest.cs
@@ -101,7 +101,7 @@ protected TextWriter Writer {
#if MONOMAC
get { return Console.Out; }
#else
- get { return AppDelegate.Runner.Writer; }
+ get { return AppDelegate.Runner.Writer!; }
#endif
}
diff --git a/tests/introspection/MacApiFieldTest.cs b/tests/introspection/MacApiFieldTest.cs
index a43e7949c80f..659ed7e08671 100644
--- a/tests/introspection/MacApiFieldTest.cs
+++ b/tests/introspection/MacApiFieldTest.cs
@@ -133,10 +133,6 @@ protected override bool Skip (PropertyInfo p)
// MonoMac.CoreServices.CFHTTPMessage - document in 10.9 but returns null
case "_AuthenticationSchemeOAuth1":
return true;
- case "CBUUIDValidRangeString":
- if (Mac.CheckSystemVersion (10, 13)) // radar 32858911
- return true;
- goto default;
default:
return base.Skip (p);
}
@@ -145,10 +141,6 @@ protected override bool Skip (PropertyInfo p)
protected override bool Skip (string constantName, string? libraryName)
{
switch (constantName) {
- case "CBUUIDValidRangeString":
- if (Mac.CheckSystemVersion (10, 13)) // radar 32858911
- return true;
- goto default;
// Only there for API compat
case "kSecUseNoAuthenticationUI":
case "kSecUseOperationPrompt":
@@ -159,12 +151,6 @@ protected override bool Skip (string constantName, string? libraryName)
// kCLErrorUserInfoAlternateRegionKey also returns null on iOS
case "kCLErrorUserInfoAlternateRegionKey":
return true;
- case "QCCompositionInputRSSArticleDurationKey":
- case "QCCompositionInputRSSFeedURLKey":
- case "QCCompositionProtocolRSSVisualizer":
- if (Mac.CheckSystemVersion (10, 14))
- return true;
- goto default;
default:
return base.Skip (constantName, libraryName);
}
diff --git a/tests/monotouch-test/AVFoundation/AVAudioIONode.cs b/tests/monotouch-test/AVFoundation/AVAudioIONode.cs
index 6627f4a6f059..f7cfb84cdb6b 100644
--- a/tests/monotouch-test/AVFoundation/AVAudioIONode.cs
+++ b/tests/monotouch-test/AVFoundation/AVAudioIONode.cs
@@ -14,8 +14,6 @@ public void AVAudioIONodeTests_AudioUnitTest ()
{
TestRuntime.AssertNotVirtualMachine ();
- Asserts.EnsureYosemite ();
-
using (AVAudioEngine eng = new AVAudioEngine ()) {
using (AVAudioIONode node = eng.OutputNode) {
using (AUUnit unit = node.AudioUnit)
diff --git a/tests/monotouch-test/AppKit/NSAppearance.cs b/tests/monotouch-test/AppKit/NSAppearance.cs
index a4ad7b1717ab..08db5f6ed405 100644
--- a/tests/monotouch-test/AppKit/NSAppearance.cs
+++ b/tests/monotouch-test/AppKit/NSAppearance.cs
@@ -9,8 +9,6 @@ public class NSAppearanceTests {
[Test]
public void NSAppearanceShouldLoadAppearanceNamed ()
{
- Asserts.EnsureYosemite ();
-
var appearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
Assert.IsNotNull (appearance, "NSAppearanceShouldLoadAppearanceNamed - Failed to initialize appearance VibrantDark");
Assert.AreEqual (appearance.Name, NSAppearance.NameVibrantDark.ToString (), "NSAppearanceShouldLoadAppearanceNamed - Appearance initialized with incorrect name.");
@@ -35,8 +33,6 @@ public void NSAppearanceConstructorShouldFailWithInvalidName ()
[Test]
public void NSAppearanceShouldChangeCurrentAppearance ()
{
- Asserts.EnsureYosemite ();
-
var appearance = NSAppearance.CurrentAppearance;
NSAppearance.CurrentAppearance = NSAppearance.GetAppearance (NSAppearance.NameVibrantDark);
@@ -47,8 +43,6 @@ public void NSAppearanceShouldChangeCurrentAppearance ()
[Test]
public void NSAppearanceCustomizationNull ()
{
- Asserts.EnsureYosemite ();
-
using (NSButton b = new NSButton ()) {
b.Appearance = null;
}
diff --git a/tests/monotouch-test/AppKit/NSClipView.cs b/tests/monotouch-test/AppKit/NSClipView.cs
index f79eafde9144..3679240ef32a 100644
--- a/tests/monotouch-test/AppKit/NSClipView.cs
+++ b/tests/monotouch-test/AppKit/NSClipView.cs
@@ -10,8 +10,6 @@ public class NSClipViewTests {
[Test]
public void NSClipViewConstrainBoundsRect ()
{
- Asserts.EnsureMavericks ();
-
var clipView = new NSClipView (new CGRect (0, 0, 50, 50));
var rect = clipView.ConstrainBoundsRect (new CGRect (10, 10, 30, 30));
diff --git a/tests/monotouch-test/AppKit/NSControl.cs b/tests/monotouch-test/AppKit/NSControl.cs
index 6fd7d7e23367..1e96c6b37ed0 100644
--- a/tests/monotouch-test/AppKit/NSControl.cs
+++ b/tests/monotouch-test/AppKit/NSControl.cs
@@ -9,7 +9,6 @@ public class NSControlTests {
[Test]
public void NSControlShouldChangeControlSize ()
{
- Asserts.EnsureYosemite ();
var control = new NSButton ();
var size = control.ControlSize;
control.ControlSize = NSControlSize.Mini;
@@ -21,8 +20,6 @@ public void NSControlShouldChangeControlSize ()
[Test]
public void NSControlShouldChangeHighlighted ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSButton ();
var highlighted = control.Highlighted;
control.Highlighted = !highlighted;
@@ -33,8 +30,6 @@ public void NSControlShouldChangeHighlighted ()
[Test]
public void NSControlShouldChangeLineBreakMode ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSButton ();
var lineBreak = control.LineBreakMode;
control.LineBreakMode = NSLineBreakMode.Clipping;
diff --git a/tests/monotouch-test/AppKit/NSImage.cs b/tests/monotouch-test/AppKit/NSImage.cs
index 390d03ea6cdc..c48003c598f9 100644
--- a/tests/monotouch-test/AppKit/NSImage.cs
+++ b/tests/monotouch-test/AppKit/NSImage.cs
@@ -10,7 +10,6 @@ public class NSImageTests {
[Test]
public void ImageWithSize ()
{
- Asserts.EnsureMountainLion ();
var image = NSImage.ImageWithSize (new CGSize (50, 50), false, rect => {
return true;
});
@@ -20,8 +19,6 @@ public void ImageWithSize ()
[Test]
public void NSImageCapInsets ()
{
- Asserts.EnsureYosemite ();
-
var image = new NSImage ();
image.CapInsets = new NSEdgeInsets (5f, 6f, 7f, 8f);
@@ -35,8 +32,6 @@ public void NSImageCapInsets ()
[Test]
public void NSImageResizingModeShouldChange ()
{
- Asserts.EnsureYosemite ();
-
var image = new NSImage ();
image.ResizingMode = NSImageResizingMode.Stretch;
Assert.AreEqual (image.ResizingMode, NSImageResizingMode.Stretch, "NSImageResizingMode - Was not equal to Stretch");
diff --git a/tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs b/tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
new file mode 100644
index 000000000000..c008697348cd
--- /dev/null
+++ b/tests/monotouch-test/AppKit/NSNotificationEventArgsTest.cs
@@ -0,0 +1,268 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if __MACOS__
+
+using AppKit;
+using Foundation;
+
+namespace Xamarin.Mac.Tests {
+ [TestFixture]
+ [Preserve (AllMembers = true)]
+ public class NSNotificationEventArgsTest {
+ [Test]
+ public void NSViewColumnMoveEventArgs_Properties ()
+ {
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSOldColumn"] = NSNumber.FromNInt (3);
+ userInfo ["NSNewColumn"] = NSNumber.FromNInt (7);
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSViewColumnMoveEventArgs (notification);
+
+ Assert.That (args.OldColumn, Is.EqualTo ((nint) 3), "OldColumn");
+ Assert.That (args.NewColumn, Is.EqualTo ((nint) 7), "NewColumn");
+ }
+
+ [Test]
+ public void NSViewColumnMoveEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSViewColumnMoveEventArgs (notification);
+
+ Assert.That (args.OldColumn, Is.EqualTo ((nint) 0), "OldColumn");
+ Assert.That (args.NewColumn, Is.EqualTo ((nint) 0), "NewColumn");
+ }
+
+ [Test]
+ public void NSViewColumnResizeEventArgs_Properties ()
+ {
+ using var column = new NSTableColumn ("testCol");
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSTableColumn"] = column;
+ userInfo ["NSOldWidth"] = NSNumber.FromNInt (42);
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSViewColumnResizeEventArgs (notification);
+
+ Assert.That (args.Column, Is.Not.Null, "Column not null");
+ Assert.That (args.Column!.Handle, Is.EqualTo (column.Handle), "Column");
+ Assert.That (args.OldWidth, Is.EqualTo ((nint) 42), "OldWidth");
+ }
+
+ [Test]
+ public void NSViewColumnResizeEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSViewColumnResizeEventArgs (notification);
+
+ Assert.That (args.Column, Is.Null, "Column");
+ Assert.That (args.OldWidth, Is.EqualTo ((nint) 0), "OldWidth");
+ }
+
+ [Test]
+ public void NSOutlineViewItemEventArgs_Properties ()
+ {
+ using var item = new NSObject ();
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSObject"] = item;
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSOutlineViewItemEventArgs (notification);
+
+ Assert.That (args.Item, Is.Not.Null, "Item not null");
+ Assert.That (args.Item!.Handle, Is.EqualTo (item.Handle), "Item");
+ }
+
+ [Test]
+ public void NSOutlineViewItemEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSOutlineViewItemEventArgs (notification);
+
+ Assert.That (args.Item, Is.Null, "Item");
+ }
+
+ [Test]
+ public void NSTextViewDidChangeSelectionEventArgs_Properties ()
+ {
+ using var value = NSValue.FromRange (new NSRange (5, 10));
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSOldSelectedCharacterRange"] = value;
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSTextViewDidChangeSelectionEventArgs (notification);
+
+ Assert.That (args.OldSelectedCharacterRange, Is.Not.Null, "OldSelectedCharacterRange not null");
+ Assert.That (args.OldSelectedCharacterRange!.Handle, Is.EqualTo (value.Handle), "OldSelectedCharacterRange");
+ }
+
+ [Test]
+ public void NSTextViewDidChangeSelectionEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSTextViewDidChangeSelectionEventArgs (notification);
+
+ Assert.That (args.OldSelectedCharacterRange, Is.Null, "OldSelectedCharacterRange");
+ }
+
+ [Test]
+ public void NSTextViewWillChangeNotifyingTextViewEventArgs_Properties ()
+ {
+ using var oldView = new NSTextView ();
+ using var newView = new NSTextView ();
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSOldNotifyingTextView"] = oldView;
+ userInfo ["NSNewNotifyingTextView"] = newView;
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSTextViewWillChangeNotifyingTextViewEventArgs (notification);
+
+ Assert.That (args.OldView, Is.Not.Null, "OldView not null");
+ Assert.That (args.OldView!.Handle, Is.EqualTo (oldView.Handle), "OldView");
+ Assert.That (args.NewView, Is.Not.Null, "NewView not null");
+ Assert.That (args.NewView!.Handle, Is.EqualTo (newView.Handle), "NewView");
+ }
+
+ [Test]
+ public void NSTextViewWillChangeNotifyingTextViewEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSTextViewWillChangeNotifyingTextViewEventArgs (notification);
+
+ Assert.That (args.OldView, Is.Null, "OldView");
+ Assert.That (args.NewView, Is.Null, "NewView");
+ }
+
+ [Test]
+ public void NSControlTextEditingEventArgs_Properties ()
+ {
+ using var textView = new NSTextView ();
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSFieldEditor"] = textView;
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSControlTextEditingEventArgs (notification);
+
+ Assert.That (args.FieldEditor, Is.Not.Null, "FieldEditor not null");
+ Assert.That (args.FieldEditor!.Handle, Is.EqualTo (textView.Handle), "FieldEditor");
+ }
+
+ [Test]
+ public void NSControlTextEditingEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSControlTextEditingEventArgs (notification);
+
+ Assert.That (args.FieldEditor, Is.Null, "FieldEditor");
+ }
+
+ [Test]
+ public void NSTextAlternativesSelectedAlternativeStringEventArgs_Properties ()
+ {
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSAlternativeString"] = new NSString ("hello");
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSTextAlternativesSelectedAlternativeStringEventArgs (notification);
+
+ Assert.That (args.AlternativeString, Is.EqualTo ("hello"), "AlternativeString");
+ }
+
+ [Test]
+ public void NSTextAlternativesSelectedAlternativeStringEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSTextAlternativesSelectedAlternativeStringEventArgs (notification);
+
+ Assert.That (args.AlternativeString, Is.Null, "AlternativeString");
+ }
+
+ [Test]
+ public void NSMenuItemIndexEventArgs_Properties ()
+ {
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSMenuItemIndex"] = NSNumber.FromNInt (5);
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSMenuItemIndexEventArgs (notification);
+
+ Assert.That (args.MenuItemIndex, Is.EqualTo ((nint) 5), "MenuItemIndex");
+ }
+
+ [Test]
+ public void NSMenuItemIndexEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSMenuItemIndexEventArgs (notification);
+
+ Assert.That (args.MenuItemIndex, Is.EqualTo ((nint) 0), "MenuItemIndex");
+ }
+
+ [Test]
+ public void NSMenuItemEventArgs_Properties ()
+ {
+ using var menu = new NSMenu ("testMenu");
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["MenuItem"] = menu;
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSMenuItemEventArgs (notification);
+
+ Assert.That (args.MenuItem, Is.Not.Null, "MenuItem not null");
+ Assert.That (args.MenuItem!.Handle, Is.EqualTo (menu.Handle), "MenuItem");
+ }
+
+ [Test]
+ public void NSMenuItemEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSMenuItemEventArgs (notification);
+
+ Assert.That (args.MenuItem, Is.Null, "MenuItem");
+ }
+
+ [Test]
+ public void NSWorkspaceFileOperationEventArgs_Properties ()
+ {
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSOperationNumber"] = NSNumber.FromNInt (99);
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSWorkspaceFileOperationEventArgs (notification);
+
+ Assert.That (args.FileType, Is.EqualTo ((nint) 99), "FileType");
+ }
+
+ [Test]
+ public void NSWorkspaceFileOperationEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSWorkspaceFileOperationEventArgs (notification);
+
+ Assert.That (args.FileType, Is.EqualTo ((nint) 0), "FileType");
+ }
+
+ [Test]
+ public void NSTextDidEndEditingEventArgs_Properties ()
+ {
+ using var userInfo = new NSMutableDictionary ();
+ userInfo ["NSTextMovement"] = NSNumber.FromNInt (1);
+
+ using var notification = NSNotification.FromName ("test", null, userInfo);
+ var args = new NSTextDidEndEditingEventArgs (notification);
+
+ Assert.That (args.Movement, Is.EqualTo ((nint) 1), "Movement");
+ }
+
+ [Test]
+ public void NSTextDidEndEditingEventArgs_NullUserInfo ()
+ {
+ using var notification = NSNotification.FromName ("test", null);
+ var args = new NSTextDidEndEditingEventArgs (notification);
+
+ Assert.That (args.Movement, Is.EqualTo ((nint) 0), "Movement");
+ }
+ }
+}
+#endif // __MACOS__
diff --git a/tests/monotouch-test/AppKit/NSPathControl.cs b/tests/monotouch-test/AppKit/NSPathControl.cs
index ef10103e81f3..a9fe3bd1095a 100644
--- a/tests/monotouch-test/AppKit/NSPathControl.cs
+++ b/tests/monotouch-test/AppKit/NSPathControl.cs
@@ -9,8 +9,6 @@ public class NSPathControlTests {
[Test]
public void NSPathControlShouldSetEditable ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSPathControl ();
var editable = control.Editable;
control.Editable = !editable;
@@ -21,8 +19,6 @@ public void NSPathControlShouldSetEditable ()
[Test]
public void NSPathControlShouldSetAllowedTypes ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSPathControl ();
var allowedTypes = control.AllowedTypes;
control.AllowedTypes = new [] { (NSString) "exe", (NSString) "jpg" };
@@ -33,8 +29,6 @@ public void NSPathControlShouldSetAllowedTypes ()
[Test]
public void NSPathControlShouldSetPlaceholderString ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSPathControl ();
var placeholderString = control.PlaceholderString;
control.PlaceholderString = "Test Placeholder";
@@ -45,8 +39,6 @@ public void NSPathControlShouldSetPlaceholderString ()
[Test]
public void NSPathControlShouldSetPlaceholderAttributedString ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSPathControl ();
var placeholderAttributedString = control.PlaceholderAttributedString;
control.PlaceholderAttributedString = new NSAttributedString ("Test Placeholder");
@@ -57,8 +49,6 @@ public void NSPathControlShouldSetPlaceholderAttributedString ()
[Test]
public void NSPathControlShouldSetPathItems ()
{
- Asserts.EnsureYosemite ();
-
var control = new NSPathControl ();
var pathItems = control.PathItems;
control.PathItems = new [] { new NSPathControlItem () };
diff --git a/tests/monotouch-test/AppKit/NSPathControlItem.cs b/tests/monotouch-test/AppKit/NSPathControlItem.cs
index a306e75ffb46..7ab456635a38 100644
--- a/tests/monotouch-test/AppKit/NSPathControlItem.cs
+++ b/tests/monotouch-test/AppKit/NSPathControlItem.cs
@@ -5,12 +5,6 @@
namespace Xamarin.Mac.Tests {
[Preserve (AllMembers = true)]
public class NSPathControlItemTests {
- [SetUp]
- public void Setup ()
- {
- Asserts.EnsureYosemite ();
- }
-
[Test]
public void NSPathControlItemShouldSetTitle ()
{
diff --git a/tests/monotouch-test/AppKit/NSSplitViewController.cs b/tests/monotouch-test/AppKit/NSSplitViewController.cs
index b22c6230daa9..918679eff29e 100644
--- a/tests/monotouch-test/AppKit/NSSplitViewController.cs
+++ b/tests/monotouch-test/AppKit/NSSplitViewController.cs
@@ -11,8 +11,6 @@ public class NSSplitViewControllerTests {
[SetUp]
public void SetUp ()
{
- Asserts.EnsureYosemite ();
-
controller = new NSSplitViewController ();
}
diff --git a/tests/monotouch-test/AppKit/NSSplitViewItem.cs b/tests/monotouch-test/AppKit/NSSplitViewItem.cs
index 2f1e26eed8c9..ec14bad13aad 100644
--- a/tests/monotouch-test/AppKit/NSSplitViewItem.cs
+++ b/tests/monotouch-test/AppKit/NSSplitViewItem.cs
@@ -11,8 +11,6 @@ public class NSSplitViewItemTests {
[SetUp]
public void SetUp ()
{
- Asserts.EnsureYosemite ();
-
item = new NSSplitViewItem ();
}
diff --git a/tests/monotouch-test/AppKit/NSStackView.cs b/tests/monotouch-test/AppKit/NSStackView.cs
index f6a15913f308..607258b7b3d6 100644
--- a/tests/monotouch-test/AppKit/NSStackView.cs
+++ b/tests/monotouch-test/AppKit/NSStackView.cs
@@ -13,8 +13,6 @@ public class NSStackViewTests {
[SetUp]
public void SetUp ()
{
- Asserts.EnsureMavericks ();
-
view = new NSStackView ();
first = new NSView ();
diff --git a/tests/monotouch-test/AppKit/NSStoryboardSegue.cs b/tests/monotouch-test/AppKit/NSStoryboardSegue.cs
index cdab19a93b9a..8c072784c3d8 100644
--- a/tests/monotouch-test/AppKit/NSStoryboardSegue.cs
+++ b/tests/monotouch-test/AppKit/NSStoryboardSegue.cs
@@ -12,8 +12,6 @@ public class NSStoryboardSegueTests {
[SetUp]
public void Setup ()
{
- Asserts.EnsureYosemite ();
-
source = new NSViewController ();
destination = new NSViewController ();
segue = new NSStoryboardSegue ("Test", source, destination);
diff --git a/tests/monotouch-test/AppKit/NSTabViewController.cs b/tests/monotouch-test/AppKit/NSTabViewController.cs
index 73ef6a0656ed..a5c23ba28c0a 100644
--- a/tests/monotouch-test/AppKit/NSTabViewController.cs
+++ b/tests/monotouch-test/AppKit/NSTabViewController.cs
@@ -12,8 +12,6 @@ public class NSTabViewControllerTests {
[SetUp]
public void SetUp ()
{
- Asserts.EnsureYosemite ();
-
controller = new NSTabViewController ();
}
diff --git a/tests/monotouch-test/AppKit/NSTabViewItem.cs b/tests/monotouch-test/AppKit/NSTabViewItem.cs
index 86ff62c9f75a..6a269b60302b 100644
--- a/tests/monotouch-test/AppKit/NSTabViewItem.cs
+++ b/tests/monotouch-test/AppKit/NSTabViewItem.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSTabViewItemShouldChangeImage ()
{
- Asserts.EnsureYosemite ();
-
var image = item.Image;
item.Image = new NSImage ();
@@ -27,8 +25,6 @@ public void NSTabViewItemShouldChangeImage ()
[Test]
public void NSTabViewItemShouldChangeViewController ()
{
- Asserts.EnsureYosemite ();
-
var vc = item.ViewController;
item.ViewController = new NSViewController ();
diff --git a/tests/monotouch-test/AppKit/NSTableColumn.cs b/tests/monotouch-test/AppKit/NSTableColumn.cs
index 41ef96d27b26..801d16c625b4 100644
--- a/tests/monotouch-test/AppKit/NSTableColumn.cs
+++ b/tests/monotouch-test/AppKit/NSTableColumn.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSTableColumnShouldChangeTitle ()
{
- Asserts.EnsureYosemite ();
-
var title = column.Title;
column.Title = "Test";
diff --git a/tests/monotouch-test/AppKit/NSTableRowView.cs b/tests/monotouch-test/AppKit/NSTableRowView.cs
index 65d57746335c..4436827d068d 100644
--- a/tests/monotouch-test/AppKit/NSTableRowView.cs
+++ b/tests/monotouch-test/AppKit/NSTableRowView.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSTableRowViewShouldChangePreviousRowSelected ()
{
- Asserts.EnsureYosemite ();
-
var selected = view.PreviousRowSelected;
view.PreviousRowSelected = !selected;
@@ -27,8 +25,6 @@ public void NSTableRowViewShouldChangePreviousRowSelected ()
[Test]
public void NSTableRowViewShouldChangeNextRowSelected ()
{
- Asserts.EnsureYosemite ();
-
var selected = view.NextRowSelected;
view.NextRowSelected = !selected;
diff --git a/tests/monotouch-test/AppKit/NSTextField.cs b/tests/monotouch-test/AppKit/NSTextField.cs
index 7ecd8bb8cfd5..44244c9e8f98 100644
--- a/tests/monotouch-test/AppKit/NSTextField.cs
+++ b/tests/monotouch-test/AppKit/NSTextField.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSTextFieldShouldChangePlaceholderString ()
{
- Asserts.EnsureYosemite ();
-
var placeholder = textField.PlaceholderString;
textField.PlaceholderString = "Test";
@@ -27,8 +25,6 @@ public void NSTextFieldShouldChangePlaceholderString ()
[Test]
public void NSTextFieldShouldChangePlaceholderAttributedString ()
{
- Asserts.EnsureYosemite ();
-
var placeholder = textField.PlaceholderAttributedString;
textField.PlaceholderAttributedString = new NSAttributedString ("Test");
diff --git a/tests/monotouch-test/AppKit/NSTextView.cs b/tests/monotouch-test/AppKit/NSTextView.cs
index 44ead4188bb7..956920381808 100644
--- a/tests/monotouch-test/AppKit/NSTextView.cs
+++ b/tests/monotouch-test/AppKit/NSTextView.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSTextViewShouldChangeUsesRolloverButtonForSelection ()
{
- Asserts.EnsureYosemite ();
-
var usesRollover = view.UsesRolloverButtonForSelection;
view.UsesRolloverButtonForSelection = !usesRollover;
diff --git a/tests/monotouch-test/AppKit/NSToolbar.cs b/tests/monotouch-test/AppKit/NSToolbar.cs
index 50955368c02a..c144f4d9d7fa 100644
--- a/tests/monotouch-test/AppKit/NSToolbar.cs
+++ b/tests/monotouch-test/AppKit/NSToolbar.cs
@@ -17,8 +17,6 @@ public void SetUp ()
[Test]
public void NSToolbarShouldChangeAllowsExtensionItems ()
{
- Asserts.EnsureYosemite ();
-
var allows = toolbar.AllowsExtensionItems;
toolbar.AllowsExtensionItems = !allows;
diff --git a/tests/monotouch-test/AppKit/NSView.cs b/tests/monotouch-test/AppKit/NSView.cs
index f73101d7f269..830c77187bb5 100644
--- a/tests/monotouch-test/AppKit/NSView.cs
+++ b/tests/monotouch-test/AppKit/NSView.cs
@@ -18,8 +18,6 @@ public void SetUp ()
[Test]
public void NSViewShouldAddGestureRecognizer ()
{
- Asserts.EnsureYosemite ();
-
var length = 0;
if (view.GestureRecognizers is not null)
length = view.GestureRecognizers.Length;
@@ -31,8 +29,6 @@ public void NSViewShouldAddGestureRecognizer ()
[Test]
public void NSViewShouldRemoveGestureRecognizer ()
{
- Asserts.EnsureYosemite ();
-
var recognizer = new NSClickGestureRecognizer ();
view.AddGestureRecognizer (recognizer);
@@ -46,8 +42,6 @@ public void NSViewShouldRemoveGestureRecognizer ()
[Test]
public void NSViewShouldChangeGestureRecognizers ()
{
- Asserts.EnsureYosemite ();
-
var recognizers = view.GestureRecognizers;
view.GestureRecognizers = new NSGestureRecognizer [] { new NSClickGestureRecognizer (), new NSPanGestureRecognizer () };
diff --git a/tests/monotouch-test/AppKit/NSViewController.cs b/tests/monotouch-test/AppKit/NSViewController.cs
index 3fc32683deed..2b5c5b344352 100644
--- a/tests/monotouch-test/AppKit/NSViewController.cs
+++ b/tests/monotouch-test/AppKit/NSViewController.cs
@@ -16,8 +16,6 @@ public void SetUp ()
[Test]
public void NSViewControllerShouldAddChildViewController ()
{
- Asserts.EnsureYosemite ();
-
var child = new NSViewController ();
controller.AddChildViewController (child);
@@ -27,8 +25,6 @@ public void NSViewControllerShouldAddChildViewController ()
[Test]
public void NSViewControllerShouldRemoveChildViewController ()
{
- Asserts.EnsureYosemite ();
-
var child = new NSViewController ();
controller.AddChildViewController (child);
@@ -42,8 +38,6 @@ public void NSViewControllerShouldRemoveChildViewController ()
[Test]
public void NSViewControllerShouldInsertChildViewController ()
{
- Asserts.EnsureYosemite ();
-
controller.AddChildViewController (new NSViewController ());
controller.AddChildViewController (new NSViewController ());
diff --git a/tests/monotouch-test/AppKit/NSVisualEffectView.cs b/tests/monotouch-test/AppKit/NSVisualEffectView.cs
index 95e0a48b0f8c..19a37721af4e 100644
--- a/tests/monotouch-test/AppKit/NSVisualEffectView.cs
+++ b/tests/monotouch-test/AppKit/NSVisualEffectView.cs
@@ -10,8 +10,6 @@ public class NSVisualEffectViewTests {
[SetUp]
public void SetUp ()
{
- Asserts.EnsureYosemite ();
-
view = new NSVisualEffectView ();
}
diff --git a/tests/monotouch-test/AssertsMac.cs b/tests/monotouch-test/AssertsMac.cs
index dcdc645a4cbf..21e0c1cc8df5 100644
--- a/tests/monotouch-test/AssertsMac.cs
+++ b/tests/monotouch-test/AssertsMac.cs
@@ -6,40 +6,6 @@
namespace Xamarin.Mac.Tests {
public static class Asserts {
- public static bool IsAtLeastYosemite {
- get {
- return TestRuntime.CheckXcodeVersion (6, 1);
- }
- }
-
- public static bool IsAtLeastElCapitan {
- get {
- return TestRuntime.CheckXcodeVersion (7, 0);
- }
- }
-
- public static void EnsureYosemite ()
- {
- if (!IsAtLeastYosemite)
- Assert.Pass ("This test requires Yosemite. Skipping");
- }
-
- public static void EnsureMavericks ()
- {
- TestRuntime.AssertXcodeVersion (6, 0);
- }
-
- public static void EnsureMountainLion ()
- {
- // We're always running on at least Mountain Lion
- }
-
- public static void Ensure64Bit ()
- {
- if (IntPtr.Size == 4)
- Assert.Pass ("This test requires 64-bit. Skipping");
- }
-
public static bool SkipDueToAvailabilityAttribute (ICustomAttributeProvider member)
{
if (member is null)
diff --git a/tests/monotouch-test/CoreBluetooth/UuidTest.cs b/tests/monotouch-test/CoreBluetooth/UuidTest.cs
index a805d81baf56..aa97e792aedf 100644
--- a/tests/monotouch-test/CoreBluetooth/UuidTest.cs
+++ b/tests/monotouch-test/CoreBluetooth/UuidTest.cs
@@ -119,14 +119,12 @@ public void Equality_PartialEquals ()
Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3");
}
#if MONOMAC
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
- guid = new byte [] { 0xaa, 0xbb, 0xcc, 0xdd };
- Assert.That (CBUUID.FromBytes (guid),
- Is.EqualTo (CBUUID.FromBytes (guid)));
+ guid = new byte [] { 0xaa, 0xbb, 0xcc, 0xdd };
+ Assert.That (CBUUID.FromBytes (guid),
+ Is.EqualTo (CBUUID.FromBytes (guid)));
- Assert.That (CBUUID.FromString ("12345678"),
- Is.EqualTo (CBUUID.FromBytes (new byte [] { 0x12, 0x34, 0x56, 0x78 })));
- }
+ Assert.That (CBUUID.FromString ("12345678"),
+ Is.EqualTo (CBUUID.FromBytes (new byte [] { 0x12, 0x34, 0x56, 0x78 })));
#endif
}
@@ -157,20 +155,17 @@ public void Equality_PartialEqualsFull ()
Assert.That (u1.GetHashCode (), Is.EqualTo (u2.GetHashCode ()), "GetHashCode-3");
}
#if MONOMAC
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
- Assert.That (CBUUID.FromBytes (new byte [] { 0xab, 0xcd, 0xef, 0x12 }),
- Is.EqualTo (MakeFull (0xab, 0xcd, 0xef, 0x12)));
+ Assert.That (CBUUID.FromBytes (new byte [] { 0xab, 0xcd, 0xef, 0x12 }),
+ Is.EqualTo (MakeFull (0xab, 0xcd, 0xef, 0x12)));
- Assert.That (CBUUID.FromString ("12345678"),
- Is.EqualTo (CBUUID.FromString ("12345678-0000-1000-8000-00805f9b34fb")));
- }
+ Assert.That (CBUUID.FromString ("12345678"),
+ Is.EqualTo (CBUUID.FromString ("12345678-0000-1000-8000-00805f9b34fb")));
#endif
}
[Test]
public void Equality_PartialsOfDifferentSizeNotEqual ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
#if MONOMAC
Assert.That (CBUUID.FromPartial (0x1234), Is.Not.EqualTo (
CBUUID.FromBytes (new byte [] { 0x12, 0x34, 0x56, 0x78 })));
diff --git a/tests/monotouch-test/CoreFoundation/DispatchTests.cs b/tests/monotouch-test/CoreFoundation/DispatchTests.cs
index 1782049f7bd2..8165af96b641 100644
--- a/tests/monotouch-test/CoreFoundation/DispatchTests.cs
+++ b/tests/monotouch-test/CoreFoundation/DispatchTests.cs
@@ -154,8 +154,7 @@ public void Default ()
#elif __TVOS__
qname = "com.apple.root.default-qos";
#elif __MACOS__
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10))
- qname = "com.apple.root.default-qos";
+ qname = "com.apple.root.default-qos";
#endif
Assert.That (DispatchQueue.DefaultGlobalQueue.Label, Is.EqualTo (qname), "Default");
}
diff --git a/tests/monotouch-test/CoreFoundation/UrlTest.cs b/tests/monotouch-test/CoreFoundation/UrlTest.cs
index 248171776acf..d7d13dedbc3b 100644
--- a/tests/monotouch-test/CoreFoundation/UrlTest.cs
+++ b/tests/monotouch-test/CoreFoundation/UrlTest.cs
@@ -58,8 +58,7 @@ public void ToString_ ()
#elif __TVOS__
value = "file:///";
#elif __MACOS__
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- value = "file:///";
+ value = "file:///";
#endif
Assert.That (url.ToString (), Is.EqualTo (value), "FromFile");
diff --git a/tests/monotouch-test/CoreImage/ImageTest.cs b/tests/monotouch-test/CoreImage/ImageTest.cs
index 42812e5d5dd3..f95c8aa271eb 100644
--- a/tests/monotouch-test/CoreImage/ImageTest.cs
+++ b/tests/monotouch-test/CoreImage/ImageTest.cs
@@ -27,14 +27,12 @@ public class ImageTest {
[Test]
public void EmptyImage ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
Assert.IsNull (CIImage.EmptyImage.Properties);
}
[Test]
public void InitializationWithCustomMetadata ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png");
using (var dp = new CGDataProvider (file)) {
using (var img = CGImage.FromPNG (dp, null, false, CGColorRenderingIntent.Default)) {
@@ -75,10 +73,6 @@ public void AreaHistogram ()
// validate that a null NSDictionary is correct (i.e. uses filter defaults)
using (var h = CIImage.EmptyImage.CreateByFiltering ("CIAreaHistogram", null)) {
var success = !TestRuntime.CheckXcodeVersion (26, 0);
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11))
- success = false;
-#endif
if (success) {
Assert.That (h.Extent.Height, Is.EqualTo ((nfloat) 1), "Height");
} else {
diff --git a/tests/monotouch-test/CoreServices/FSEventStreamTest.cs b/tests/monotouch-test/CoreServices/FSEventStreamTest.cs
index f00bb0ad0232..ecca416f30e1 100644
--- a/tests/monotouch-test/CoreServices/FSEventStreamTest.cs
+++ b/tests/monotouch-test/CoreServices/FSEventStreamTest.cs
@@ -5,10 +5,12 @@
#if __MACOS__
using System.IO;
+using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using CoreServices;
+using Foundation;
namespace MonoTouchFixtures.CoreServices {
using static FSEventStreamCreateFlags;
@@ -17,16 +19,30 @@ namespace MonoTouchFixtures.CoreServices {
[TestFixture]
[Preserve (AllMembers = true)]
public sealed class FSEventStreamTest {
+ [DllImport ("/usr/lib/libSystem.dylib")]
+ static extern IntPtr realpath (string file_name, IntPtr resolved_name);
+
+ static string CreateTemporaryDirectory ()
+ {
+ var tmpDir = Path.Combine (NSFileManager.TemporaryDirectory, Path.GetRandomFileName ());
+ Directory.CreateDirectory (tmpDir);
+ // Resolve symlinks (e.g. /var -> /private/var) because FSEventStream reports resolved paths.
+ var resolvedPtr = realpath (tmpDir, IntPtr.Zero);
+ var resolved = Marshal.PtrToStringUTF8 (resolvedPtr)!;
+ Marshal.FreeHGlobal (resolvedPtr);
+ return resolved;
+ }
+
[Test]
public void TestPathsBeingWatched ()
{
FSEventStreamCreateOptions createOptions = new () {
Flags = FileEvents | UseExtendedData,
PathsToWatch = new [] {
- Xamarin.Cache.CreateTemporaryDirectory (),
- Xamarin.Cache.CreateTemporaryDirectory (),
- Xamarin.Cache.CreateTemporaryDirectory (),
- Xamarin.Cache.CreateTemporaryDirectory ()
+ CreateTemporaryDirectory (),
+ CreateTemporaryDirectory (),
+ CreateTemporaryDirectory (),
+ CreateTemporaryDirectory ()
}
};
@@ -69,7 +85,7 @@ static void RunTest (FSEventStreamCreateFlags createFlags)
{
TestRuntime.IgnoreInCI ("This test fails randomly on the bots, potentially due to (randomly) high CPU usage.");
using var monitor = new TestFSMonitor (
- Xamarin.Cache.CreateTemporaryDirectory (),
+ CreateTemporaryDirectory (),
createFlags,
maxFilesToCreate: 256);
try {
diff --git a/tests/monotouch-test/Foundation/DictionaryContainerTest.cs b/tests/monotouch-test/Foundation/DictionaryContainerTest.cs
index 1ca025969141..e07ebca50d71 100644
--- a/tests/monotouch-test/Foundation/DictionaryContainerTest.cs
+++ b/tests/monotouch-test/Foundation/DictionaryContainerTest.cs
@@ -70,6 +70,11 @@ public void SetNumberValue_ (NSString key, nint? value)
SetNumberValue (key, value);
}
+ public void SetNumberValue_ (NSString key, long? value)
+ {
+ SetNumberValue (key, value);
+ }
+
public void SetNumberValue_ (NSString key, nuint? value)
{
SetNumberValue (key, value);
@@ -225,6 +230,25 @@ public void SetNumberValue_UInt32 ()
Assert.That ((int) dc.Dictionary.Count, Is.EqualTo (0), "0");
}
+ [Test]
+ public void SetNumberValue_Int64 ()
+ {
+ const long value = 2147483648L;
+ var dc = new DictionaryContainerPoker ();
+
+ Assert.Throws (delegate
+ {
+ dc.SetNumberValue_ (null, value);
+ }, "null key");
+
+ dc.SetNumberValue_ (key, value);
+ Assert.That ((int) dc.Dictionary.Count, Is.EqualTo (1), "1");
+ Assert.That (((NSNumber) dc.Dictionary [key]).Int64Value, Is.EqualTo (value), "value");
+
+ dc.SetNumberValue_ (key, (long?) null);
+ Assert.That ((int) dc.Dictionary.Count, Is.EqualTo (0), "0");
+ }
+
[Test]
public void SetStringValue ()
{
diff --git a/tests/monotouch-test/Foundation/NSLinguisticAnalysisTest.cs b/tests/monotouch-test/Foundation/NSLinguisticAnalysisTest.cs
index 6f50773f7f23..9997f8002af9 100644
--- a/tests/monotouch-test/Foundation/NSLinguisticAnalysisTest.cs
+++ b/tests/monotouch-test/Foundation/NSLinguisticAnalysisTest.cs
@@ -32,12 +32,7 @@ public void EnumerateSubstringsInRangeTest ()
var testString = new NSString ("Hello Hola Bonjour!");
var range = new NSRange (0, testString.Length - 1);
testString.EnumerateLinguisticTags (range, NSLinguisticTagScheme.Token, NSLinguisticTaggerOptions.OmitWhitespace, null, Enumerator);
- var expectedWordCount = 3;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expectedWordCount = 4;
-#endif
- Assert.AreEqual (expectedWordCount, words.Count, "Word count: " + string.Join (", ", words));
+ Assert.AreEqual (3, words.Count, "Word count: " + string.Join (", ", words));
Assert.True (words.Contains (NSLinguisticTag.Word.GetConstant ()), "Token type.");
}
@@ -58,12 +53,7 @@ public void GetLinguisticTagsTest ()
var range = new NSRange (0, testString.Length - 1);
NSValue [] tokenRanges;
var tags = testString.GetLinguisticTags (range, NSLinguisticTagScheme.NameOrLexicalClass, NSLinguisticTaggerOptions.OmitWhitespace, null, out tokenRanges);
- var expectedWordCount = 3;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expectedWordCount = 4;
-#endif
- Assert.AreEqual (expectedWordCount, tags.Length, "Tags Length");
+ Assert.AreEqual (3, tags.Length, "Tags Length");
}
}
}
diff --git a/tests/monotouch-test/Foundation/NSMutableDictionary2Test.cs b/tests/monotouch-test/Foundation/NSMutableDictionary2Test.cs
index 0228b34d4ea7..bd1cba17986c 100644
--- a/tests/monotouch-test/Foundation/NSMutableDictionary2Test.cs
+++ b/tests/monotouch-test/Foundation/NSMutableDictionary2Test.cs
@@ -281,42 +281,25 @@ public void XForY_Autorelease ()
[Test]
public void Copy ()
{
- var isMutableCopy = false;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
- isMutableCopy = true;
-#endif
using (var k = new NSString ("key"))
using (var v = new NSString ("value"))
using (var d = new NSMutableDictionary (k, v)) {
// NSObject.Copy works because NSDictionary conforms to NSCopying
using (var copy1 = (NSDictionary) d.Copy ()) {
Assert.AreNotSame (d, copy1, "1");
- if (isMutableCopy) {
- Assert.That (copy1, Is.TypeOf (), "NSDictionary-1");
- } else {
- Assert.That (copy1, Is.Not.TypeOf (), "NSDictionary-1");
- }
+ Assert.That (copy1, Is.Not.TypeOf (), "NSDictionary-1");
Assert.That (copy1.Count, Is.EqualTo ((nuint) 1), "Count-1");
}
using (var copy2 = (NSDictionary) d.Copy (null)) {
Assert.AreNotSame (d, copy2, "2");
- if (isMutableCopy) {
- Assert.That (copy2, Is.TypeOf (), "NSDictionary-2");
- } else {
- Assert.That (copy2, Is.Not.TypeOf (), "NSDictionary-2");
- }
+ Assert.That (copy2, Is.Not.TypeOf (), "NSDictionary-2");
Assert.That (copy2.Count, Is.EqualTo ((nuint) 1), "Count-2");
}
using (var copy3 = (NSDictionary) d.Copy (NSZone.Default)) {
Assert.AreNotSame (d, copy3, "3");
- if (isMutableCopy) {
- Assert.That (copy3, Is.TypeOf (), "NSDictionary-3");
- } else {
- Assert.That (copy3, Is.Not.TypeOf (), "NSDictionary-3");
- }
+ Assert.That (copy3, Is.Not.TypeOf (), "NSDictionary-3");
Assert.That (copy3.Count, Is.EqualTo ((nuint) 1), "Count-3");
}
}
diff --git a/tests/monotouch-test/Foundation/ObjectTest.cs b/tests/monotouch-test/Foundation/ObjectTest.cs
index b493dcb32ee0..4453222bd8f4 100644
--- a/tests/monotouch-test/Foundation/ObjectTest.cs
+++ b/tests/monotouch-test/Foundation/ObjectTest.cs
@@ -78,10 +78,6 @@ public void FromObject_INativeObject ()
Assert.IsNotNull (NSObject.FromObject (c), "CGColor");
}
var hasSecAccessControl = TestRuntime.CheckXcodeVersion (6, 0);
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10))
- hasSecAccessControl = false;
-#endif
if (hasSecAccessControl) {
using (var sac = new SecAccessControl (SecAccessible.WhenPasscodeSetThisDeviceOnly)) {
Assert.IsNotNull (NSObject.FromObject (sac), "SecAccessControl");
diff --git a/tests/monotouch-test/Foundation/UrlCredentialTest.cs b/tests/monotouch-test/Foundation/UrlCredentialTest.cs
index 3b125c74df3c..b4eecb06740f 100644
--- a/tests/monotouch-test/Foundation/UrlCredentialTest.cs
+++ b/tests/monotouch-test/Foundation/UrlCredentialTest.cs
@@ -40,12 +40,7 @@ public void Ctor_Trust ()
Assert.False (creds.HasPassword, "HasPassword");
Assert.Null (creds.SecIdentity, "SecIdentity");
Assert.Null (creds.Password, "Password");
- var expectedPersistence = NSUrlCredentialPersistence.ForSession;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
- expectedPersistence = (NSUrlCredentialPersistence) uint.MaxValue;
-#endif
- Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence");
+ Assert.That (creds.Persistence, Is.EqualTo (NSUrlCredentialPersistence.ForSession), "Persistence");
Assert.Null (creds.User, "User");
}
}
@@ -59,12 +54,7 @@ public void FromTrust ()
Assert.False (creds.HasPassword, "HasPassword");
Assert.Null (creds.SecIdentity, "SecIdentity");
Assert.Null (creds.Password, "Password");
- var expectedPersistence = NSUrlCredentialPersistence.ForSession;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
- expectedPersistence = (NSUrlCredentialPersistence) uint.MaxValue;
-#endif
- Assert.That (creds.Persistence, Is.EqualTo (expectedPersistence), "Persistence");
+ Assert.That (creds.Persistence, Is.EqualTo (NSUrlCredentialPersistence.ForSession), "Persistence");
Assert.Null (creds.User, "User");
}
}
diff --git a/tests/monotouch-test/Foundation/UrlProtocolTest.cs b/tests/monotouch-test/Foundation/UrlProtocolTest.cs
index 28dc98ec63fb..e9c8d5ef9c1c 100644
--- a/tests/monotouch-test/Foundation/UrlProtocolTest.cs
+++ b/tests/monotouch-test/Foundation/UrlProtocolTest.cs
@@ -64,9 +64,7 @@ public void Task ()
[Test]
public void RegistrarTest ()
{
- // Networking seems broken on our macOS 10.9 bot, so skip this test.
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
-
+ CustomUrlProtocol.State = 0;
var success = false;
var task = Task.Run (async () => {
@@ -79,7 +77,10 @@ public void RegistrarTest ()
}
});
- Assert.IsTrue (TestRuntime.RunAsync (TimeSpan.FromSeconds (10), task), "Timed out");
+ // Use the completion check overload so RunAsync also waits for
+ // StopLoading to fire (State reaches 5) instead of returning as
+ // soon as the download task completes (State may still be 4).
+ Assert.IsTrue (TestRuntime.RunAsync (TimeSpan.FromSeconds (10), task, () => CustomUrlProtocol.State >= 5), "Timed out");
Assert.That (CustomUrlProtocol.State, Is.EqualTo (5), "State");
Assert.IsTrue (success, "Success");
}
@@ -116,14 +117,8 @@ public CustomUrlProtocol (NSUrlRequest request, NSCachedUrlResponse cachedRespon
public override void StartLoading ()
{
#if MONOMAC
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10)) {
- if (State == 3)
- State++;
- } else {
- // looks like 10.9 is not calling `initWithRequest:cachedResponse:client:`
- if (State >= 2)
- State = 4;
- }
+ if (State == 3)
+ State++;
#else
if (State == 3)
State++;
diff --git a/tests/monotouch-test/Foundation/UrlSessionConfigurationTest.cs b/tests/monotouch-test/Foundation/UrlSessionConfigurationTest.cs
index 4e4006126c30..74f16ec9e0de 100644
--- a/tests/monotouch-test/Foundation/UrlSessionConfigurationTest.cs
+++ b/tests/monotouch-test/Foundation/UrlSessionConfigurationTest.cs
@@ -25,7 +25,6 @@ public class UrlSessionConfigurationTest {
public void BackgroundSessionConfiguration ()
{
TestRuntime.AssertXcodeVersion (5, 0);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
// https://trello.com/c/F6cyUBFU/70-simple-background-transfer-bo-pang-block-by-an-system-invalidcastexception-in-nsurlsessionconfiguration-backgroundsessionconfigu
using (var session = NSUrlSessionConfiguration.BackgroundSessionConfiguration ("id")) {
@@ -37,7 +36,6 @@ public void BackgroundSessionConfiguration ()
public void Default_Properties ()
{
TestRuntime.AssertXcodeVersion (5, 0);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
var config = NSUrlSessionConfiguration.DefaultSessionConfiguration;
@@ -84,7 +82,7 @@ public void Default_Properties ()
var hasSharedContainerIdentifier = true;
#if __MACOS__
- hasSharedContainerIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
+ hasSharedContainerIdentifier = true;
#else
hasSharedContainerIdentifier = TestRuntime.CheckXcodeVersion (6, 0);
#endif
@@ -114,7 +112,7 @@ public void Default_Properties ()
var hasProtocolClasses = true;
#if __MACOS__
- hasProtocolClasses = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
+ hasProtocolClasses = true;
#else
hasProtocolClasses = TestRuntime.CheckXcodeVersion (6, 0);
#endif
diff --git a/tests/monotouch-test/GameKit/LeaderboardTest.cs b/tests/monotouch-test/GameKit/LeaderboardTest.cs
index ed0b33983a8d..3801a94062ae 100644
--- a/tests/monotouch-test/GameKit/LeaderboardTest.cs
+++ b/tests/monotouch-test/GameKit/LeaderboardTest.cs
@@ -23,15 +23,13 @@ public class LeaderboardTest {
void Check (GKLeaderboard lb)
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
#if !__TVOS__
Assert.Null (lb.Category, "Category");
#endif
#if __MACOS__
- var hasGroupIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9);
- var hasIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
- var hasRange = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10);
+ var hasGroupIdentifier = true;
+ var hasIdentifier = true;
+ var hasRange = true;
#elif __IOS__
var hasGroupIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 6, 0);
var hasIdentifier = TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 7, 0);
@@ -62,8 +60,6 @@ void Check (GKLeaderboard lb)
[Test]
public void DefaultCtor ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
using (var lb = new GKLeaderboard ()) {
Check (lb);
}
@@ -72,8 +68,6 @@ public void DefaultCtor ()
[Test]
public void PlayersCtor ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
// note: Mavericks does not like (respond to) this selector - but it did work with ML and is documented
using (var lb = new GKLeaderboard (new string [0])) {
Check (lb);
diff --git a/tests/monotouch-test/GameKit/LeaderboardViewControllerTest.cs b/tests/monotouch-test/GameKit/LeaderboardViewControllerTest.cs
index 649473666360..fe9a46d2d5cc 100644
--- a/tests/monotouch-test/GameKit/LeaderboardViewControllerTest.cs
+++ b/tests/monotouch-test/GameKit/LeaderboardViewControllerTest.cs
@@ -29,10 +29,7 @@ public class LeaderboardViewControllerTest {
public void DefaultCtor ()
{
#if MONOMAC
- // fails when executed under BigSur - this has been deprecated for a while (even if it remains working elsewhere)
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 11, 0))
- Assert.Inconclusive ("'LeaderboardViewControllerTest' the native 'init' method returned nil.");
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
+ Assert.Inconclusive ("'LeaderboardViewControllerTest' the native 'init' method returned nil.");
#endif
using (var vc = new GKLeaderboardViewController ()) {
Assert.Null (vc.Category, "Category");
diff --git a/tests/monotouch-test/MapKit/PinAnnotationViewTest.cs b/tests/monotouch-test/MapKit/PinAnnotationViewTest.cs
index 3dd6a66d47ff..a805a20e7837 100644
--- a/tests/monotouch-test/MapKit/PinAnnotationViewTest.cs
+++ b/tests/monotouch-test/MapKit/PinAnnotationViewTest.cs
@@ -71,11 +71,7 @@ public void InitWithFrame ()
Assert.That (av.PinColor, Is.EqualTo (MKPinAnnotationColor.Red), "PinColor");
#if MONOMAC
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12)) {
- Assert.That (av.PinTintColor, Is.EqualTo (NSColor.SystemRed), "PinTintColor");
- } else {
- Assert.Null (av.PinTintColor, "PinTintColor"); // differs from the other init call
- }
+ Assert.That (av.PinTintColor, Is.EqualTo (NSColor.SystemRed), "PinTintColor");
#else
bool not_null = TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 10, 0);
if (not_null)
diff --git a/tests/monotouch-test/MetalPerformanceShaders/MPSImageNormalizedHistogramTests.cs b/tests/monotouch-test/MetalPerformanceShaders/MPSImageNormalizedHistogramTests.cs
index 1c5acd7626e1..3d7b2cf80b25 100644
--- a/tests/monotouch-test/MetalPerformanceShaders/MPSImageNormalizedHistogramTests.cs
+++ b/tests/monotouch-test/MetalPerformanceShaders/MPSImageNormalizedHistogramTests.cs
@@ -43,11 +43,7 @@ public void Constructors ()
try {
obj = new MPSImageNormalizedHistogram (MTLDevice.SystemDefault, ref info);
} catch (Exception ex) {
- // This test fails on 10.13 bots but not on a local computer with 10.13. Must work on 10.14+.
- // there is no a good way to tell if MPSImageNormalizedHistogram will work or not...
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 14))
- Assert.Fail (ex.Message);
- Assert.Inconclusive ("In 10.13 this can fail in some hardware.");
+ Assert.Fail (ex.Message);
}
#endif
Assert.NotNull (obj, "MPSImageNormalizedHistogram obj");
diff --git a/tests/monotouch-test/ModelIO/MDLMesh.cs b/tests/monotouch-test/ModelIO/MDLMesh.cs
index 11d003136acc..243bdae1fc8e 100644
--- a/tests/monotouch-test/ModelIO/MDLMesh.cs
+++ b/tests/monotouch-test/ModelIO/MDLMesh.cs
@@ -106,11 +106,7 @@ public void CreateCylindroidTest ()
using (var obj = MDLMesh.CreateCylindroid (1, V2, 3, 1, MDLGeometryType.Triangles, true, null)) {
Assert.IsNotNull (obj, "obj");
#if MONOMAC
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12)) {
- Asserts.AreEqual (new MDLAxisAlignedBoundingBox { MaxBounds = new Vector3 (0.866025448f, 0.5f, 1f), MinBounds = new Vector3 (-0.866025388f, -0.5f, -0.5f) }, obj.BoundingBox, "BoundingBox");
- } else {
- Asserts.AreEqual (new MDLAxisAlignedBoundingBox { MaxBounds = new Vector3 (1f, 0.5f, 1f), MinBounds = new Vector3 (-0.866025388f, -0.5f, -0.866025388f) }, obj.BoundingBox, "BoundingBox");
- }
+ Asserts.AreEqual (new MDLAxisAlignedBoundingBox { MaxBounds = new Vector3 (0.866025448f, 0.5f, 1f), MinBounds = new Vector3 (-0.866025388f, -0.5f, -0.5f) }, obj.BoundingBox, "BoundingBox");
#else
if (TestRuntime.CheckXcodeVersion (8, 2)) {
Asserts.AreEqual (new MDLAxisAlignedBoundingBox { MaxBounds = new Vector3 (0.866025448f, 0.5f, 1f), MinBounds = new Vector3 (-0.866025388f, -0.5f, -0.5f) }, obj.BoundingBox, "BoundingBox");
diff --git a/tests/monotouch-test/MultipeerConnectivity/SessionTest.cs b/tests/monotouch-test/MultipeerConnectivity/SessionTest.cs
index fc65473a8d74..6dd76da9339c 100644
--- a/tests/monotouch-test/MultipeerConnectivity/SessionTest.cs
+++ b/tests/monotouch-test/MultipeerConnectivity/SessionTest.cs
@@ -29,14 +29,13 @@ public class SessionTest {
public void CtorPeer ()
{
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var peer = new MCPeerID ("me"))
using (var s = new MCSession (peer)) {
Assert.AreSame (s.MyPeerID, peer, "MyPeerID");
Assert.Null (s.SecurityIdentity, "SecurityIdentity");
#if MONOMAC
- var pref = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11) ? MCEncryptionPreference.Required : MCEncryptionPreference.Optional;
+ var pref = MCEncryptionPreference.Required;
#else
var pref = TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 9, 0) ? MCEncryptionPreference.Required : MCEncryptionPreference.Optional;
#endif
@@ -49,7 +48,6 @@ public void CtorPeer ()
public void Ctor_OptionalIdentity ()
{
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var peer = new MCPeerID ("me"))
using (var s = new MCSession (peer, null, MCEncryptionPreference.None)) {
@@ -64,7 +62,6 @@ public void Ctor_OptionalIdentity ()
public void Ctor_Identity ()
{
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 10, throwIfOtherPlatform: false);
using (var id = IdentityTest.GetIdentity ())
using (var peer = new MCPeerID ("me"))
diff --git a/tests/monotouch-test/NetworkExtension/VpnManagerTest.cs b/tests/monotouch-test/NetworkExtension/VpnManagerTest.cs
index 15a836649a77..55bb85801975 100644
--- a/tests/monotouch-test/NetworkExtension/VpnManagerTest.cs
+++ b/tests/monotouch-test/NetworkExtension/VpnManagerTest.cs
@@ -22,7 +22,6 @@ public class VpnManagerTest {
public void SharedManager ()
{
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
var shared = NEVpnManager.SharedManager;
// https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW59
@@ -39,7 +38,7 @@ public void SharedManager ()
#if __IOS__
var HasLocalizedDescription = TestRuntime.CheckSystemVersion (ApplePlatform.iOS, 9, 0);
#elif __MACOS__
- var HasLocalizedDescription = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11);
+ var HasLocalizedDescription = true;
#endif
if (HasLocalizedDescription) {
Assert.AreEqual ("MonoTouchTest", shared.LocalizedDescription, "LocalizedDescription");
@@ -55,7 +54,6 @@ public void SharedManager ()
public void Fields ()
{
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 8, 0, throwIfOtherPlatform: false);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 11, throwIfOtherPlatform: false);
Assert.That (NEVpnError.ConnectionFailed.GetDomain ().ToString (), Is.EqualTo ("NEVPNErrorDomain"), "ErrorDomain");
}
diff --git a/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs b/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs
index c0c08f4355cd..41cd2bf6f978 100644
--- a/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs
+++ b/tests/monotouch-test/ObjCRuntime/DelegateAndDataSourceTest.cs
@@ -113,7 +113,7 @@ bool Skip (Type t)
return true;
case "SCNLayer":
case "SCNProgram":
- if (Asserts.IsAtLeastElCapitan && IntPtr.Size == 4)
+ if (IntPtr.Size == 4)
return true;
break;
case "AVCaptureView":
diff --git a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs
index b3ce5aadb8f3..758c6dd9f3ee 100644
--- a/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs
+++ b/tests/monotouch-test/ObjCRuntime/RegistrarTest.cs
@@ -1298,7 +1298,9 @@ public void TestRegisteredName ()
void ThrowsICEIfDebug (TestDelegate code, string message, bool execute_release_mode = true)
{
- if (TestRuntime.IsCoreCLR || global::XamarinTests.ObjCRuntime.Registrar.CurrentRegistrar == Registrars.ManagedStatic) {
+ if (TestRuntime.IsCoreCLR ||
+ global::XamarinTests.ObjCRuntime.Registrar.CurrentRegistrar == Registrars.ManagedStatic ||
+ global::XamarinTests.ObjCRuntime.Registrar.CurrentRegistrar == Registrars.TrimmableStatic) {
if (execute_release_mode) {
// In CoreCLR will either throw an ArgumentException:
// ()) {
- if (!isValidEnumForPlatform (s))
- continue;
d = SCNGeometrySource.FromData (new NSData (), s, 1, false, 1, 1, 1, 1);
}
#pragma warning restore 0219
@@ -59,8 +27,6 @@ public void SCNGeometrySource_FromDataTest ()
[Test]
public void SCNGeometrySource_BoneStringTests () // These were radar://17782603
{
- Asserts.EnsureYosemite ();
-
#pragma warning disable 0219
SCNGeometrySource d = SCNGeometrySource.FromData (new NSData (), SCNGeometrySourceSemantic.BoneWeights, 1, false, 1, 1, 1, 1);
d = SCNGeometrySource.FromData (new NSData (), SCNGeometrySourceSemantic.BoneIndices, 1, false, 1, 1, 1, 1);
diff --git a/tests/monotouch-test/SceneKit/SCNMaterial.cs b/tests/monotouch-test/SceneKit/SCNMaterial.cs
index be52e7b90495..e7e2c4ec0d27 100644
--- a/tests/monotouch-test/SceneKit/SCNMaterial.cs
+++ b/tests/monotouch-test/SceneKit/SCNMaterial.cs
@@ -8,14 +8,6 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SCNMaterialTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureMavericks ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNMaterial_ShaderModifierTest_Weak ()
{
diff --git a/tests/monotouch-test/SceneKit/SCNNode.cs b/tests/monotouch-test/SceneKit/SCNNode.cs
index cc650dae5f12..6380d67d71df 100644
--- a/tests/monotouch-test/SceneKit/SCNNode.cs
+++ b/tests/monotouch-test/SceneKit/SCNNode.cs
@@ -9,14 +9,6 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SCNNodeTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureMavericks ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNNode_AddAnimation ()
{
@@ -35,8 +27,6 @@ public void SCNNode_AddAnimation ()
[Test]
public void SCNNode_SetPhysicsBodyTest ()
{
- Asserts.EnsureYosemite ();
-
if (IntPtr.Size == 8) {
// Create a new empty scene
var Scene = new SCNScene ();
diff --git a/tests/monotouch-test/SceneKit/SCNScene.cs b/tests/monotouch-test/SceneKit/SCNScene.cs
index 05c6c8269bce..4b62bba59439 100644
--- a/tests/monotouch-test/SceneKit/SCNScene.cs
+++ b/tests/monotouch-test/SceneKit/SCNScene.cs
@@ -7,14 +7,6 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SCNSceneTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureYosemite ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNSceneLoadingOptions_AnimationImportPolicyTest ()
{
diff --git a/tests/monotouch-test/SceneKit/SCNView.cs b/tests/monotouch-test/SceneKit/SCNView.cs
index 92bc4433e98f..eb832586f85d 100644
--- a/tests/monotouch-test/SceneKit/SCNView.cs
+++ b/tests/monotouch-test/SceneKit/SCNView.cs
@@ -10,14 +10,6 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SCNViewTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureYosemite ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNView_TechniqueSetterTest ()
{
diff --git a/tests/monotouch-test/SceneKit/SCNWorld.cs b/tests/monotouch-test/SceneKit/SCNWorld.cs
index 69536131158f..2363589c73af 100644
--- a/tests/monotouch-test/SceneKit/SCNWorld.cs
+++ b/tests/monotouch-test/SceneKit/SCNWorld.cs
@@ -9,19 +9,9 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SCNWorldTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureMavericks ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNNode_BackfaceCulling ()
{
- Asserts.EnsureYosemite ();
-
if (IntPtr.Size == 8) {
Assert.IsNotNull (SCNPhysicsTestKeys.BackfaceCullingKey);
}
diff --git a/tests/monotouch-test/SceneKit/SceneKit.cs b/tests/monotouch-test/SceneKit/SceneKit.cs
index f4a084772d09..6854897034d5 100644
--- a/tests/monotouch-test/SceneKit/SceneKit.cs
+++ b/tests/monotouch-test/SceneKit/SceneKit.cs
@@ -11,14 +11,6 @@ namespace Xamarin.Mac.Tests {
[Preserve (AllMembers = true)]
public class SceneKitTests // Generic one off tests
{
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureYosemite ();
- if (Asserts.IsAtLeastElCapitan)
- Asserts.Ensure64Bit ();
- }
-
[Test]
public void SCNGeometrySourceSemantic_ColorKeyTest ()
{
diff --git a/tests/monotouch-test/Security/KeyChainTest.cs b/tests/monotouch-test/Security/KeyChainTest.cs
index deaaeaa16540..bd99664e3130 100644
--- a/tests/monotouch-test/Security/KeyChainTest.cs
+++ b/tests/monotouch-test/Security/KeyChainTest.cs
@@ -102,10 +102,6 @@ public void SecItemAdd_Identity ()
data.LowlevelSetObject (id.Handle, valueref.Handle);
SecStatusCode code = SecItemAdd (data.Handle, IntPtr.Zero);
var expected = Is.EqualTo (SecStatusCode.DuplicateItem).Or.EqualTo (SecStatusCode.Success);
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expected = Is.EqualTo (SecStatusCode.Param);
-#endif
Assert.That (code, expected);
}
}
diff --git a/tests/monotouch-test/Security/KeyTest.cs b/tests/monotouch-test/Security/KeyTest.cs
index 8e97a168ea85..6d426d629789 100644
--- a/tests/monotouch-test/Security/KeyTest.cs
+++ b/tests/monotouch-test/Security/KeyTest.cs
@@ -36,7 +36,6 @@ public class KeyTest {
static X509Certificate2 _c;
static X509Certificate2 c {
get {
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false); // System.Security.Cryptography.CryptographicException : Input data cannot be coded as a valid certificate.
if (_c is null)
_c = X509CertificateLoader.LoadPkcs12 (ImportExportTest.farscape_pfx, "farscape");
return _c;
@@ -125,7 +124,7 @@ public void RoundtripRSAMinPKCS1 ()
Assert.True (public_key.IsAlgorithmSupported (SecKeyOperationType.Encrypt, SecKeyAlgorithm.RsaEncryptionPkcs1), "public/IsAlgorithmSupported/Encrypt");
#if MONOMAC
- Assert.That (public_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionPkcs1), Is.EqualTo (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 13)), "public/IsAlgorithmSupported/Decrypt");
+ Assert.True (public_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionPkcs1), "public/IsAlgorithmSupported/Decrypt");
using (var pub = public_key.GetPublicKey ()) {
// macOS behaviour is not consistent - but the test main goal is to check we get a key
@@ -182,14 +181,8 @@ public void RoundtripRSAMinPKCS1 ()
}
}
public_key.Dispose ();
- var expectedResult = SecStatusCode.Success;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
- expectedResult = SecStatusCode.InvalidData;
-#endif
- Assert.That (private_key.Decrypt (SecPadding.PKCS1, cipher, out result), Is.EqualTo (expectedResult), "Decrypt");
- if (expectedResult != SecStatusCode.InvalidData)
- Assert.That (plain, Is.EqualTo (result), "match");
+ Assert.That (private_key.Decrypt (SecPadding.PKCS1, cipher, out result), Is.EqualTo (SecStatusCode.Success), "Decrypt");
+ Assert.That (plain, Is.EqualTo (result), "match");
private_key.Dispose ();
}
} finally {
@@ -216,15 +209,7 @@ public void EncryptTooLarge ()
byte [] plain = new byte [MinRsaKeySize / 8];
byte [] cipher;
var rv = public_key.Encrypt (SecPadding.PKCS1, plain, out cipher);
- var expectedStatus = SecStatusCode.Param;
-
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8))
- expectedStatus = SecStatusCode.Success;
- else if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12))
- expectedStatus = SecStatusCode.OutputLengthError;
-#endif
- Assert.That (rv, Is.EqualTo (expectedStatus), "Encrypt");
+ Assert.That (rv, Is.EqualTo (SecStatusCode.Param), "Encrypt");
public_key.Dispose ();
private_key.Dispose ();
@@ -256,7 +241,7 @@ public void RoundtripRSA1024OAEP ()
Assert.True (public_key.IsAlgorithmSupported (SecKeyOperationType.Encrypt, SecKeyAlgorithm.RsaEncryptionOaepSha1), "public/IsAlgorithmSupported/Encrypt");
// I would have expect false
#if MONOMAC
- Assert.That (public_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionOaepSha1), Is.EqualTo (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 13)), "public/IsAlgorithmSupported/Decrypt");
+ Assert.True (public_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionOaepSha1), "public/IsAlgorithmSupported/Decrypt");
#else
Assert.True (public_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionOaepSha1), "public/IsAlgorithmSupported/Decrypt");
#endif
@@ -270,16 +255,7 @@ public void RoundtripRSA1024OAEP ()
Assert.True (private_key.IsAlgorithmSupported (SecKeyOperationType.Decrypt, SecKeyAlgorithm.RsaEncryptionOaepSha1), "private/IsAlgorithmSupported/Decrypt");
}
Assert.That (private_key.Decrypt (SecPadding.OAEP, cipher, out result), Is.EqualTo (SecStatusCode.Success), "Decrypt");
- var expectEmpty = false;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12))
- expectEmpty = true;
-#endif
- if (expectEmpty) {
- Assert.That (plain, Is.EqualTo (new byte [0]), "match (empty)");
- } else {
- Assert.That (plain, Is.EqualTo (result), "match");
- }
+ Assert.That (plain, Is.EqualTo (result), "match");
private_key.Dispose ();
}
} finally {
@@ -328,8 +304,6 @@ public void SignVerifyRSAMinPKCS1SHA1 ()
[Test]
public void SignVerifyECSHA1 ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
-
SecKey private_key;
SecKey public_key;
var label = $"KeyTest.SignVerifyECSHA1-{CFBundle.GetMain ().Identifier}-{GetType ().FullName}-{Process.GetCurrentProcess ().Id}";
diff --git a/tests/monotouch-test/Security/PolicyTest.cs b/tests/monotouch-test/Security/PolicyTest.cs
index 982fe2f1d90d..907152db2bd0 100644
--- a/tests/monotouch-test/Security/PolicyTest.cs
+++ b/tests/monotouch-test/Security/PolicyTest.cs
@@ -105,7 +105,6 @@ public void BasicX509Policy ()
public void RevocationPolicy ()
{
TestRuntime.AssertXcodeVersion (5, 0);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var policy = SecPolicy.CreateRevocationPolicy (SecRevocation.UseAnyAvailableMethod | SecRevocation.RequirePositiveResponse)) {
Assert.That (policy.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle");
@@ -114,12 +113,7 @@ public void RevocationPolicy ()
using (var properties = policy.GetProperties ()) {
Assert.That (properties.Handle, Is.Not.EqualTo (IntPtr.Zero), "Properties.Handle");
Assert.That (CFGetRetainCount (properties.Handle), Is.EqualTo ((nint) 1), "Properties.RetainCount");
- var expectedCount = (nuint) 1;
-#if __MACOS__
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11) && !TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12))
- expectedCount = 2;
-#endif
- Assert.That (properties.Count, Is.EqualTo (expectedCount), "Count");
+ Assert.That (properties.Count, Is.EqualTo ((nuint) 1), "Count");
Assert.That (properties [SecPolicyPropertyKey.Oid].ToString (), Is.EqualTo ("1.2.840.113635.100.1.21"), "SecPolicyOid");
}
}
@@ -138,7 +132,6 @@ void CreatePolicy (NSString oid, NSString propertyOid = null)
public void CreateWellKnownPolicies ()
{
TestRuntime.AssertXcodeVersion (5, 0);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
CreatePolicy (SecPolicyIdentifier.AppleX509Basic);
CreatePolicy (SecPolicyIdentifier.AppleSSL);
@@ -152,10 +145,6 @@ public void CreateWellKnownPolicies ()
// invalid handle ? not yet supported ?!?
// CreatePolicy (SecPolicyIdentifier.AppleTimeStamping);
oid = null;
-#if __MACOS__
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11) && !TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12))
- oid = "3";
-#endif
CreatePolicy (SecPolicyIdentifier.AppleRevocation, (NSString) oid);
}
@@ -163,7 +152,6 @@ public void CreateWellKnownPolicies ()
public void CreateUnknownPolicy ()
{
TestRuntime.AssertXcodeVersion (5, 0);
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
using (var oid = new NSString ("1.2.3.4")) {
Assert.Throws (delegate
diff --git a/tests/monotouch-test/Security/RecordTest.cs b/tests/monotouch-test/Security/RecordTest.cs
index 73eb44135dc5..314cb4fe31fb 100644
--- a/tests/monotouch-test/Security/RecordTest.cs
+++ b/tests/monotouch-test/Security/RecordTest.cs
@@ -308,115 +308,119 @@ public void AuthenticationType_17579 ()
#endif
public void DeskCase_83099_InmutableDictionary ()
{
+#if __MACOS__
+ // macOS 11.* hangs on keychain operations in CI
+ if (TestRuntime.CheckXcodeVersion (12, 2) && !TestRuntime.CheckXcodeVersion (13, 0))
+ TestRuntime.IgnoreInCI ("Skip on macOS 11.* because it hangs");
+#endif
+ // Use a unique server name per process to avoid cross-process keychain
+ // conflicts on shared CI agents (the account + server pair is the identity).
+ var testServer = $"Test1-{Environment.ProcessId}";
var testUsername = "testusername";
- // Clean up any stale keychain entries from previous test runs to avoid
- // the keychain returning ItemNotFound on query but DuplicateItem on add.
- ForceRemoveUserPassword (testUsername);
+ // Clean up any stale keychain entries from previous test runs.
+ var cleanupCode = ForceRemoveKeychainEntry (testServer, testUsername);
+ TestContext.Out.WriteLine ($"Initial cleanup: {cleanupCode}");
+ // Also clean up entries from the old hardcoded "Test1" server name.
+ ForceRemoveKeychainEntry ("Test1", testUsername);
try {
//TEST 1: Save a keychain value
- var test1 = SaveUserPassword (testUsername, "testValue1", out var queryCode, out var addCode, out var updateCode);
+ var test1 = SaveKeychainEntry (testServer, testUsername, "testValue1", out var queryCode, out var addCode, out var updateCode);
Assert.IsTrue (test1, $"Password could not be saved to keychain. queryCode: {queryCode} addCode: {addCode} updateCode: {updateCode}");
//TEST 2: Get the saved keychain value
- var test2 = GetUserPassword (testUsername);
+ var test2 = GetKeychainEntry (testServer, testUsername);
Assert.IsTrue (StringUtil.StringsEqual (test2, "testValue1", false));
//TEST 3: Update the keychain value
- var test3 = SaveUserPassword (testUsername, "testValue2", out queryCode, out addCode, out updateCode);
+ var test3 = SaveKeychainEntry (testServer, testUsername, "testValue2", out queryCode, out addCode, out updateCode);
Assert.IsTrue (test3, $"Password could not be saved to keychain. queryCode: {queryCode} addCode: {addCode} updateCode: {updateCode}");
//TEST 4: Get the updated keychain value
- var test4 = GetUserPassword (testUsername);
+ var test4 = GetKeychainEntry (testServer, testUsername);
Assert.IsTrue (StringUtil.StringsEqual (test4, "testValue2", false));
//TEST 5: Clear the keychain values
- var test5 = ClearUserPassword (testUsername, out queryCode, out var removeCode);
+ var test5 = ClearKeychainEntry (testServer, 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);
+ var test6 = GetKeychainEntry (testServer, testUsername);
Assert.IsNull (test6, "No password should exist here");
} finally {
// Always clean up to avoid leaving stale entries for subsequent runs
- ForceRemoveUserPassword (testUsername);
+ ForceRemoveKeychainEntry (testServer, testUsername);
}
}
- public static string GetUserPassword (string username)
+ // Create a minimal SecRecord for keychain queries and deletes (no LAContext).
+ // Using LAContext with InteractionNotAllowed on search records can cause
+ // intermittent InvalidRecord errors on some macOS keychain states.
+ static SecRecord CreateKeychainSearchRecord (string server, string username)
+ {
+ return new SecRecord (SecKind.InternetPassword) {
+ Server = server,
+ Account = username.ToLower (),
+ };
+ }
+
+ public static string GetKeychainEntry (string server, string username)
{
string password = null;
- var searchRecord = CreateSecRecord (SecKind.InternetPassword,
- server: "Test1",
- account: username.ToLower ()
- );
- SecStatusCode code;
- var record = SecKeyChain.QueryAsRecord (searchRecord, out code);
+ var searchRecord = CreateKeychainSearchRecord (server, username);
+ var record = SecKeyChain.QueryAsRecord (searchRecord, out var code);
if (code == SecStatusCode.Success && record is not null)
password = NSString.FromData (record.ValueData, NSStringEncoding.UTF8);
return password;
}
- public static bool SaveUserPassword (string username, string password, out SecStatusCode queryCode, out SecStatusCode addCode, out SecStatusCode updateCode)
+ public static bool SaveKeychainEntry (string server, string username, string password, out SecStatusCode queryCode, out SecStatusCode addCode, out SecStatusCode updateCode)
{
- addCode = (SecStatusCode) (-1); // pick a value that doesn't already exist in SecStatusCode
- updateCode = (SecStatusCode) (-1); // pick a value that doesn't already exist in SecStatusCode
- var success = false;
- var searchRecord = CreateSecRecord (SecKind.InternetPassword,
- server: "Test1",
- account: username.ToLower ()
- );
+ addCode = (SecStatusCode) (-1);
+ updateCode = (SecStatusCode) (-1);
+ var searchRecord = CreateKeychainSearchRecord (server, username);
var record = SecKeyChain.QueryAsRecord (searchRecord, out queryCode);
- if (queryCode == SecStatusCode.ItemNotFound) {
- record = CreateSecRecord (SecKind.InternetPassword,
- server: "Test1",
- account: username.ToLower (),
- valueData: NSData.FromString (password)
- );
- addCode = SecKeyChain.Add (record);
- success = (addCode == SecStatusCode.Success);
- // Handle inconsistent keychain state: query returned ItemNotFound
- // but add returned DuplicateItem. Force-remove and retry.
- if (addCode == SecStatusCode.DuplicateItem) {
- SecKeyChain.Remove (searchRecord);
- addCode = SecKeyChain.Add (record);
- success = (addCode == SecStatusCode.Success);
- }
- }
if (queryCode == SecStatusCode.Success && record is not null) {
+ // Record exists, update it.
record.ValueData = NSData.FromString (password);
updateCode = SecKeyChain.Update (searchRecord, record);
- success = (updateCode == SecStatusCode.Success);
+ return updateCode == SecStatusCode.Success;
+ }
+ // Record doesn't exist, or query returned an unexpected error
+ // (e.g. InvalidRecord). Force-remove to handle inconsistent keychain
+ // state, then add.
+ SecKeyChain.Remove (searchRecord);
+ record = new SecRecord (SecKind.InternetPassword) {
+ Server = server,
+ Account = username.ToLower (),
+ ValueData = NSData.FromString (password),
+ };
+ addCode = SecKeyChain.Add (record);
+ if (addCode == SecStatusCode.DuplicateItem) {
+ SecKeyChain.Remove (searchRecord);
+ addCode = SecKeyChain.Add (record);
}
- return success;
+ return addCode == SecStatusCode.Success;
}
- public static void ForceRemoveUserPassword (string username)
+ public static SecStatusCode ForceRemoveKeychainEntry (string server, string username)
{
- var searchRecord = CreateSecRecord (SecKind.InternetPassword,
- server: "Test1",
- account: username.ToLower ()
- );
- SecKeyChain.Remove (searchRecord);
+ var searchRecord = CreateKeychainSearchRecord (server, username);
+ return SecKeyChain.Remove (searchRecord);
}
- public static bool ClearUserPassword (string username, out SecStatusCode queryCode, out SecStatusCode? removeCode)
+ public static bool ClearKeychainEntry (string server, string username, out SecStatusCode queryCode, out SecStatusCode? removeCode)
{
- var success = false;
- var searchRecord = CreateSecRecord (SecKind.InternetPassword,
- server: "Test1",
- account: username.ToLower ()
- );
+ var searchRecord = CreateKeychainSearchRecord (server, username);
var record = SecKeyChain.QueryAsRecord (searchRecord, out queryCode);
if (queryCode == SecStatusCode.Success && record is not null) {
removeCode = SecKeyChain.Remove (searchRecord);
- success = (removeCode == SecStatusCode.Success);
- } else {
- removeCode = null;
+ return removeCode == SecStatusCode.Success;
}
- return success;
+ removeCode = null;
+ return false;
}
[Test]
diff --git a/tests/monotouch-test/Security/SecureTransportTest.cs b/tests/monotouch-test/Security/SecureTransportTest.cs
index 8de3994e762a..79b9f89467f4 100644
--- a/tests/monotouch-test/Security/SecureTransportTest.cs
+++ b/tests/monotouch-test/Security/SecureTransportTest.cs
@@ -31,8 +31,6 @@ public class SecureTransportTest {
[Test]
public void StreamDefaults ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
using (var ssl = new SslContext (SslProtocolSide.Client, SslConnectionType.Stream)) {
Assert.That (ssl.BufferedReadSize, Is.EqualTo ((nint) 0), "BufferedReadSize");
Assert.That (ssl.ClientCertificateState, Is.EqualTo (SslClientCertificateState.None), "ClientCertificateState");
@@ -99,10 +97,8 @@ public void StreamDefaults ()
[Test]
public void DatagramDefaults ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
#if __MACOS__
- nint dsize = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10) ? 1327 : 1387;
+ nint dsize = 1327;
#else
nint dsize = TestRuntime.CheckXcodeVersion (6, 0) ? 1327 : 1387;
#endif
@@ -134,8 +130,6 @@ public void DatagramDefaults ()
[Test]
public void Tls12 ()
{
- TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 8, throwIfOtherPlatform: false);
-
var client = new TcpClient ("google.ca", 443);
using (NetworkStream ns = client.GetStream ())
using (var ssl = new SslContext (SslProtocolSide.Client, SslConnectionType.Stream)) {
diff --git a/tests/monotouch-test/Security/TrustTest.cs b/tests/monotouch-test/Security/TrustTest.cs
index 31fb449e4e83..61ab56615a13 100644
--- a/tests/monotouch-test/Security/TrustTest.cs
+++ b/tests/monotouch-test/Security/TrustTest.cs
@@ -77,10 +77,6 @@ void Trust_Leaf_Only (SecTrust trust, SecPolicy policy)
trust.SetVerifyDate (new DateTime (635108745218945450, DateTimeKind.Utc));
// the system was able to construct the chain based on the single certificate
var expectedTrust = SecTrustResult.RecoverableTrustFailure;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expectedTrust = SecTrustResult.Unspecified;
-#endif
Assert.That (Evaluate (trust, true), Is.EqualTo (expectedTrust), "Evaluate");
using (var queue = new DispatchQueue ("TrustAsync")) {
@@ -110,7 +106,7 @@ void Trust_Leaf_Only (SecTrust trust, SecPolicy policy)
}
#if __MACOS__
- var hasNetworkFetchAllowed = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9);
+ var hasNetworkFetchAllowed = true;
#else
var hasNetworkFetchAllowed = TestRuntime.CheckXcodeVersion (5, 0);
#endif
@@ -150,13 +146,7 @@ public void HostName_Leaf_Only ()
var trust_result = SecTrustResult.Invalid;
#if __MACOS__
- if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 13)) {
- trust_result = SecTrustResult.RecoverableTrustFailure;
- } else if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 12)) {
- trust_result = SecTrustResult.Invalid;
- } else if (TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 8)) {
- trust_result = SecTrustResult.RecoverableTrustFailure;
- }
+ trust_result = SecTrustResult.RecoverableTrustFailure;
#else
if (TestRuntime.CheckXcodeVersion (9, 0))
trust_result = SecTrustResult.RecoverableTrustFailure; // Result not invalidated starting with Xcode 9 beta 3.
@@ -178,14 +168,10 @@ public void NoHostName ()
// that certificate stopped being valid on September 30th, 2013 so we validate it with a date earlier than that
trust.SetVerifyDate (new DateTime (635108745218945450, DateTimeKind.Utc));
var expectedTrust = SecTrustResult.RecoverableTrustFailure;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expectedTrust = SecTrustResult.Unspecified;
-#endif
Assert.That (Evaluate (trust, true), Is.EqualTo (expectedTrust), "Evaluate");
#if __MACOS__
- var hasCreateRevocationPolicy = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9);
+ var hasCreateRevocationPolicy = true;
#else
var hasCreateRevocationPolicy = TestRuntime.CheckXcodeVersion (5, 0);
#endif
@@ -211,14 +197,10 @@ public void Client_Leaf_Only ()
trust.SetVerifyDate (new DateTime (635108745218945450, DateTimeKind.Utc));
// a host name is not meaningful for client certificates
var expectedTrust = SecTrustResult.RecoverableTrustFailure;
-#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- expectedTrust = SecTrustResult.Unspecified;
-#endif
Assert.That (Evaluate (trust, true), Is.EqualTo (expectedTrust), "Evaluate");
#if __MACOS__
- var hasGetResult = TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9);
+ var hasGetResult = true;
#else
var hasGetResult = TestRuntime.CheckXcodeVersion (5, 0);
#endif
@@ -250,8 +232,6 @@ public void Basic_Leaf_Only ()
var hasOCSPResponse = true;
#if __MACOS__
- if (!TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 9))
- hasOCSPResponse = false;
#else
if (!TestRuntime.CheckXcodeVersion (5, 0))
hasOCSPResponse = false;
diff --git a/tests/monotouch-test/SpriteKit/SKScene.cs b/tests/monotouch-test/SpriteKit/SKScene.cs
index d8c0f3a57ce3..1da17da539fa 100644
--- a/tests/monotouch-test/SpriteKit/SKScene.cs
+++ b/tests/monotouch-test/SpriteKit/SKScene.cs
@@ -10,12 +10,6 @@ namespace Xamarin.Mac.Tests {
[TestFixture]
[Preserve (AllMembers = true)]
public class SKSceneTests {
- [SetUp]
- public void SetUp ()
- {
- Asserts.EnsureMavericks ();
- }
-
[Test]
public void SKScene_InitWithSize ()
{
diff --git a/tests/monotouch-test/StoreKit/StoreProductParametersTest.cs b/tests/monotouch-test/StoreKit/StoreProductParametersTest.cs
new file mode 100644
index 000000000000..07c7f9e0816e
--- /dev/null
+++ b/tests/monotouch-test/StoreKit/StoreProductParametersTest.cs
@@ -0,0 +1,49 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#if !MONOMAC
+
+using Foundation;
+using StoreKit;
+
+namespace MonoTouchFixtures.StoreKit {
+
+ [TestFixture]
+ [Preserve (AllMembers = true)]
+ public class StoreProductParametersTest {
+
+ [Test]
+ public void ITunesItemIdentifier_64BitRoundtrip ()
+ {
+ const long identifier = 2147483648L;
+
+ var withCtor = new StoreProductParameters (identifier);
+ var withSetter = new StoreProductParameters {
+ ITunesItemIdentifierLong = identifier,
+ };
+
+ Assert.That (withCtor.ITunesItemIdentifierLong, Is.EqualTo (identifier), "Ctor");
+ Assert.That (withSetter.ITunesItemIdentifierLong, Is.EqualTo (identifier), "Setter");
+ Assert.That (((NSNumber) withSetter.Dictionary [SKStoreProductParameterKey.ITunesItemIdentifier]).Int64Value, Is.EqualTo (identifier), "Dictionary");
+ }
+
+#if !XAMCORE_5_0
+#pragma warning disable 618
+ [Test]
+ public void ITunesItemIdentifier_LegacyRoundtrip ()
+ {
+ const int identifier = 123456789;
+
+ var parameters = new StoreProductParameters {
+ ITunesItemIdentifier = identifier,
+ };
+
+ Assert.That (parameters.ITunesItemIdentifier, Is.EqualTo (identifier), "Legacy");
+ Assert.That (parameters.ITunesItemIdentifierLong, Is.EqualTo (identifier), "Long");
+ }
+#pragma warning restore 618
+#endif
+ }
+}
+
+#endif
diff --git a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs
index 0aae018e0d7d..03f759bdf6c6 100644
--- a/tests/monotouch-test/System.Net.Http/MessageHandlers.cs
+++ b/tests/monotouch-test/System.Net.Http/MessageHandlers.cs
@@ -469,11 +469,6 @@ public void RejectSslCertificatesServicePointManager (Type handlerType)
TestRuntime.AssertSystemVersion (ApplePlatform.MacOSX, 10, 9, throwIfOtherPlatform: false);
TestRuntime.AssertSystemVersion (ApplePlatform.iOS, 7, 0, throwIfOtherPlatform: false);
-#if __MACOS__
- if (handlerType == typeof (NSUrlSessionHandler) && TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 10, 0) && !TestRuntime.CheckSystemVersion (ApplePlatform.MacOSX, 10, 11, 0))
- Assert.Ignore ("Fails on macOS 10.10: https://github.com/xamarin/maccore/issues/1645");
-#endif
-
bool validationCbWasExecuted = false;
bool invalidServicePointManagerCbWasExcuted = false;
Type expectedExceptionType = null;
@@ -708,6 +703,7 @@ public void TestNSUrlSessionHandlerSendClientCertificate ()
if (!done) { // timeouts happen in the bots due to dns issues, connection issues etc.. we do not want to fail
Assert.Inconclusive ("Request timedout.");
} else {
+ TestRuntime.IgnoreInCIIfBadNetwork (ex);
Assert.IsNull (ex, "Exception wasn't expected.");
X509Certificate2 certificate2 = X509CertificateLoader.LoadCertificate (global::System.Convert.FromBase64String (content));
Assert.AreEqual (certificate.Thumbprint, certificate2.Thumbprint);
diff --git a/tests/monotouch-test/System.Net.Http/NetworkResources.cs b/tests/monotouch-test/System.Net.Http/NetworkResources.cs
index 085a36039118..99fe7fc5c24f 100644
--- a/tests/monotouch-test/System.Net.Http/NetworkResources.cs
+++ b/tests/monotouch-test/System.Net.Http/NetworkResources.cs
@@ -13,7 +13,7 @@ public static class NetworkResources {
public static string XamarinHttpUrl => AssertNetworkConnection ("http://dotnet.microsoft.com/apps/xamarin");
public static Uri XamarinUri => new Uri (XamarinUrl);
public static string StatsUrl => AssertNetworkConnection ("https://api.imgur.com/2/stats");
- public static string EchoClientCertificateUrl = "https://corefx-net-tls.azurewebsites.net/EchoClientCertificate.ashx";
+ public static string EchoClientCertificateUrl => AssertNetworkConnection ("https://corefx-net-tls.azurewebsites.net/EchoClientCertificate.ashx");
public static string [] HttpsUrls => new [] {
MicrosoftUrl,
diff --git a/tests/xharness/Jenkins/TestVariationsFactory.cs b/tests/xharness/Jenkins/TestVariationsFactory.cs
index a6779cdad28e..53f58932a818 100644
--- a/tests/xharness/Jenkins/TestVariationsFactory.cs
+++ b/tests/xharness/Jenkins/TestVariationsFactory.cs
@@ -93,8 +93,13 @@ IEnumerable GetTestData (RunTestTask test)
}
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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Debug (trimmable static registrar)", TestVariation = "trimmable-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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Release (trimmable static registrar, all optimizations)", TestVariation = "trimmable-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 (trimmable static registrar, NativeAOT)", TestVariation = "trimmable-static-registrar|release|nativeaot", Ignored = ignore };
break;
}
break;
@@ -110,10 +115,16 @@ IEnumerable GetTestData (RunTestTask test)
if (mac_supports_arm64) {
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 = "Release (trimmable static registrar, NativeAOT, ARM64)", TestVariation = "trimmable-static-registrar|release|nativeaot", Ignored = ignore, RuntimeIdentifier = arm64_sim_runtime_identifier };
}
yield return new TestData { Variation = "Debug (managed static registrar)", TestVariation = "managed-static-registrar", Ignored = ignore };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Debug (trimmable static registrar)", TestVariation = "trimmable-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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Release (trimmable static registrar, all optimizations)", TestVariation = "trimmable-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 };
+ yield return new TestData { Variation = "Release (trimmable static registrar, NativeAOT, x64)", TestVariation = "trimmable-static-registrar|release|nativeaot", Ignored = ignore, RuntimeIdentifier = x64_sim_runtime_identifier };
if (supports_interpreter) {
yield return new TestData { Variation = "Debug (interpreter)", TestVariation = "interpreter", Ignored = ignore };
yield return new TestData { Variation = "Release (interpreter)", TestVariation = "release|interpreter", Ignored = ignore };
@@ -140,13 +151,22 @@ IEnumerable GetTestData (RunTestTask test)
case "monotouch-test":
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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Debug (trimmable static registrar)", TestVariation = "trimmable-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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Release (trimmable static registrar)", TestVariation = "trimmable-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 };
+ if (supports_coreclr)
+ yield return new TestData { Variation = "Release (trimmable static registrar, all optimizations)", TestVariation = "trimmable-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 (trimmable static registrar, NativeAOT)", TestVariation = "trimmable-static-registrar|nativeaot|release", Ignored = ignore };
+ yield return new TestData { Variation = "Release (trimmable static registrar, NativeAOT, ARM64)", TestVariation = "trimmable-static-registrar|nativeaot|release", Ignored = !mac_supports_arm64 ? true : ignore, RuntimeIdentifier = arm64_runtime_identifier };
+ yield return new TestData { Variation = "Release (trimmable static registrar, NativeAOT, x64)", TestVariation = "trimmable-static-registrar|nativeaot|release", 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) {
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore
index 4f14e504809e..0d896ca7254b 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/MacCatalyst-CoreML.ignore
@@ -1,5 +1,4 @@
# These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available.
# We're removing them in XAMCORE_5_0.
-!unknown-field! MLModelCollectionDidChangeNotification bound
!unknown-type! MLModelCollection bound
!unknown-type! MLModelCollectionEntry bound
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore
index 4f14e504809e..0d896ca7254b 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/iOS-CoreML.ignore
@@ -1,5 +1,4 @@
# These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available.
# We're removing them in XAMCORE_5_0.
-!unknown-field! MLModelCollectionDidChangeNotification bound
!unknown-type! MLModelCollection bound
!unknown-type! MLModelCollectionEntry bound
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
index 9a3f3b3cbe9e..268a5aeb27fa 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-AppKit.ignore
@@ -151,20 +151,6 @@
!missing-selector! NSTextStorage::setWords: not bound
!missing-selector! NSTextStorage::words not bound
!missing-selector! NSWindow::anchorAttributeForOrientation: not bound
-!unknown-field! MenuItem bound
-!unknown-field! NSAlternativeString bound
-!unknown-field! NSFieldEditor bound
-!unknown-field! NSMenuItemIndex bound
-!unknown-field! NSNewColumn bound
-!unknown-field! NSNewNotifyingTextView bound
-!unknown-field! NSObject bound
-!unknown-field! NSOldColumn bound
-!unknown-field! NSOldNotifyingTextView bound
-!unknown-field! NSOldSelectedCharacterRange bound
-!unknown-field! NSOldWidth bound
-!unknown-field! NSOperationNumber bound
-!unknown-field! NSTableColumn bound
-!unknown-field! NSTextMovement bound
!unknown-native-enum! NSAlertButtonReturn bound
!unknown-native-enum! NSBackingStore bound
!unknown-native-enum! NSCellHit bound
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreBluetooth.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreBluetooth.ignore
index 07a5e97d9eba..8840ebbfcdaf 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreBluetooth.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreBluetooth.ignore
@@ -1,6 +1,3 @@
-## old and different name for CBUUIDCharacteristicValidRangeString, removed in Xcode9 headers (27160443)
-!unknown-field! CBUUIDValidRangeString bound
-
# not to be added since it is not needed in any API on macOS as of xcode13 beta 3.
!missing-enum! CBCentralManagerFeature not bound
diff --git a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore
index 4f14e504809e..0d896ca7254b 100644
--- a/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore
+++ b/tests/xtro-sharpie/api-annotations-dotnet/macOS-CoreML.ignore
@@ -1,5 +1,4 @@
# These types are marked as unavailable in the headers if the min OS version is >= Xcode 16's OS versions, so xtro doesn't detect them as available.
# We're removing them in XAMCORE_5_0.
-!unknown-field! MLModelCollectionDidChangeNotification bound
!unknown-type! MLModelCollection bound
!unknown-type! MLModelCollectionEntry bound
diff --git a/tests/xtro-sharpie/xtro-report/xtro-report.csproj b/tests/xtro-sharpie/xtro-report/xtro-report.csproj
index 8e905ed0a453..9bcdb596b75e 100644
--- a/tests/xtro-sharpie/xtro-report/xtro-report.csproj
+++ b/tests/xtro-sharpie/xtro-report/xtro-report.csproj
@@ -5,6 +5,9 @@
enable
enable
false
+
+ Nullable
+ true
diff --git a/tests/xtro-sharpie/xtro-sanity/Sanitizer.cs b/tests/xtro-sharpie/xtro-sanity/Sanitizer.cs
index d55625cf3ef9..2afdc4d6d6d4 100644
--- a/tests/xtro-sharpie/xtro-sanity/Sanitizer.cs
+++ b/tests/xtro-sharpie/xtro-sanity/Sanitizer.cs
@@ -374,7 +374,7 @@ static List GetAllFrameworks ()
static Frameworks GetFrameworks (string platform)
{
- return Frameworks.GetFrameworks (ApplePlatformExtensions.Parse (platform), false);
+ return Frameworks.GetFrameworks (ApplePlatformExtensions.Parse (platform), false)!;
}
static List GetFrameworks (IEnumerable platforms)
diff --git a/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj b/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj
index 8440e1f6e294..2a9d8b0f507e 100644
--- a/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj
+++ b/tests/xtro-sharpie/xtro-sanity/xtro-sanity.csproj
@@ -5,6 +5,9 @@
enable
enable
false
+
+ Nullable
+ true
diff --git a/tests/xtro-sharpie/xtro-sharpie/AttributeHelpers.cs b/tests/xtro-sharpie/xtro-sharpie/AttributeHelpers.cs
index 03a25f5adfb1..1fe2e1d2773a 100644
--- a/tests/xtro-sharpie/xtro-sharpie/AttributeHelpers.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/AttributeHelpers.cs
@@ -1,3 +1,4 @@
+using System.Diagnostics.CodeAnalysis;
using Sharpie.Bind;
namespace Extrospection {
@@ -10,7 +11,7 @@ static bool Skip (ICustomAttributeProvider item)
}
// These both return out Version and bool as you can have an an attribute with no version (null) which is different no matching attribute at all
- public static bool FindDeprecated (ICustomAttributeProvider item, out Version version)
+ public static bool FindDeprecated (ICustomAttributeProvider item, [NotNullWhen (true)] out Version? version)
{
version = null;
@@ -23,7 +24,7 @@ public static bool FindDeprecated (ICustomAttributeProvider item, out Version ve
return false;
}
- public static bool FindObsolete (ICustomAttributeProvider item, out Version version)
+ public static bool FindObsolete (ICustomAttributeProvider item, [NotNullWhen (true)] out Version? version)
{
version = null;
@@ -70,7 +71,7 @@ public static bool HasObsolete (CustomAttribute attribute, Platforms platform)
return attribute.Constructor.DeclaringType.Name == "ObsoleteAttribute";
}
- static bool GetPlatformVersion (CustomAttribute attribute, out Version version)
+ static bool GetPlatformVersion (CustomAttribute attribute, out Version? version)
{
// Three different Attribute flavors
// (PlatformName platform, PlatformArchitecture architecture = PlatformArchitecture.None, string message = null)
@@ -95,7 +96,7 @@ public static bool FindObjcDeprecated (IEnumerable attrs, out VersionTuple
{
var attr = attrs.GetAvailabilityAttributes ().FirstOrDefault (x => x.AvailabilityAttributeDeprecated.HasValue && !x.AvailabilityAttributeDeprecated.Value.IsEmptyVersionTuple && x.AvailabilityAttributePlatformIdentifierName == Helpers.ClangPlatformName);
if (attr is not null) {
- version = attr.AvailabilityAttributeDeprecated.Value;
+ version = attr.AvailabilityAttributeDeprecated!.Value;
return true;
} else {
version = VersionTuple.Empty;
@@ -111,7 +112,7 @@ public static bool HasAnyDeprecationForCurrentPlatform (ICustomAttributeProvider
// Properties are a special case as it is generated on the property itself and not the individual get_ \ set_ methods
// Cecil does not have a link between the MethodDefinition we have and the hosting PropertyDefinition, so we have to dig to find the match
if (item is MethodDefinition method) {
- PropertyDefinition property = method.DeclaringType.Properties.FirstOrDefault (p => p.GetMethod == method || p.SetMethod == method);
+ var property = method.DeclaringType.Properties.FirstOrDefault (p => p.GetMethod == method || p.SetMethod == method);
if (property is not null && HasAnyDeprecationForCurrentPlatform (property)) {
return true;
}
@@ -159,7 +160,7 @@ public static bool HasAnyAdvice (ICustomAttributeProvider item)
// Properties are a special case for [Advice], as it is generated on the property itself and not the individual get_ \ set_ methods
// Cecil does not have a link between the MethodDefinition we have and the hosting PropertyDefinition, so we have to dig to find the match
if (item is MethodDefinition method) {
- PropertyDefinition property = method.DeclaringType.Properties.FirstOrDefault (p => p.GetMethod == method || p.SetMethod == method);
+ var property = method.DeclaringType.Properties.FirstOrDefault (p => p.GetMethod == method || p.SetMethod == method);
if (property is not null && HasAdviced (property.CustomAttributes))
return true;
}
diff --git a/tests/xtro-sharpie/xtro-sharpie/DeprecatedCheck.cs b/tests/xtro-sharpie/xtro-sharpie/DeprecatedCheck.cs
index 21b8b19e2131..9c3e326442a6 100644
--- a/tests/xtro-sharpie/xtro-sharpie/DeprecatedCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/DeprecatedCheck.cs
@@ -45,7 +45,7 @@ public override void EndVisit ()
void ProcessObjcEntry (string objcClassName, VersionTuple objcVersion)
{
- TypeDefinition managedType = ManagedTypes.FirstOrDefault (x => Helpers.GetName (x) == objcClassName && x.IsPublic);
+ var managedType = ManagedTypes.FirstOrDefault (x => Helpers.GetName (x) == objcClassName && x.IsPublic);
if (managedType is not null) {
var framework = Helpers.GetFramework (managedType);
if (framework is not null)
@@ -60,7 +60,7 @@ void ProcessObjcSelector (string fullname, VersionTuple objcVersion)
string objcClassName = fullname.Substring (class_method ? 1 : 0, n);
string selector = fullname.Substring (n + 2);
- TypeDefinition managedType = ManagedTypes.FirstOrDefault (x => Helpers.GetName (x) == objcClassName);
+ var managedType = ManagedTypes.FirstOrDefault (x => Helpers.GetName (x) == objcClassName);
if (managedType is not null) {
var framework = Helpers.GetFramework (managedType);
if (framework is null)
@@ -92,7 +92,7 @@ void ProcessCFunction (string fullname, VersionTuple objcVersion)
}
}
- public void ProcessItem (ICustomAttributeProvider item, string itemName, VersionTuple objcVersion, string framework)
+ public void ProcessItem (ICustomAttributeProvider item, string? itemName, VersionTuple objcVersion, string framework)
{
// Our bindings do not need have [Deprecated] for ancient versions we don't support anymore
if (VersionHelpers.VersionTooOldToCare (objcVersion))
@@ -114,8 +114,7 @@ public void ProcessItem (ICustomAttributeProvider item, string itemName, Version
}
// Some APIs have both a [Deprecated] and [Obsoleted]. Bias towards [Obsoleted].
- Version managedVersion;
- bool foundObsoleted = AttributeHelpers.FindObsolete (item, out managedVersion);
+ bool foundObsoleted = AttributeHelpers.FindObsolete (item, out var managedVersion);
if (foundObsoleted) {
if (managedVersion is not null && !ManagedBeforeOrEqualToObjcVersion (objcVersion, managedVersion))
Log.On (framework).Add ($"!deprecated-attribute-wrong! {itemName} has {managedVersion} not {objcVersion} on [Obsoleted] attribute");
diff --git a/tests/xtro-sharpie/xtro-sharpie/DesignatedInitializerCheck.cs b/tests/xtro-sharpie/xtro-sharpie/DesignatedInitializerCheck.cs
index 5869a2844138..b58d73526e27 100644
--- a/tests/xtro-sharpie/xtro-sharpie/DesignatedInitializerCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/DesignatedInitializerCheck.cs
@@ -24,13 +24,13 @@ public DesignatedInitializerCheck (BindingResult bindingResult)
static Dictionary types = new Dictionary ();
static Dictionary methods = new Dictionary ();
- static TypeDefinition GetType (ObjCInterfaceDecl decl)
+ static TypeDefinition? GetType (ObjCInterfaceDecl decl)
{
types.TryGetValue (decl.Name, out var td);
return td;
}
- static MethodDefinition GetMethod (ObjCMethodDecl decl)
+ static MethodDefinition? GetMethod (ObjCMethodDecl decl)
{
methods.TryGetValue (decl.GetName (), out var md);
return md;
@@ -51,7 +51,7 @@ public override void VisitManagedMethod (MethodDefinition method)
public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !(((Decl) decl.DeclContext!).IsAvailable ()))
return;
var method = GetMethod (decl);
diff --git a/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs b/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs
index 40c02a9d8841..d85e49bd7e46 100644
--- a/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/EnumCheck.cs
@@ -2,8 +2,8 @@ namespace Extrospection {
class EnumCheck : BaseVisitor {
class ManagedValue {
- public FieldDefinition Field;
- public EnumConstantDecl Decl;
+ public required FieldDefinition Field;
+ public EnumConstantDecl? Decl;
}
Dictionary enums = new Dictionary (StringComparer.InvariantCultureIgnoreCase);
diff --git a/tests/xtro-sharpie/xtro-sharpie/FieldCheck.cs b/tests/xtro-sharpie/xtro-sharpie/FieldCheck.cs
index 65e32c45d8e6..b12415a92c94 100644
--- a/tests/xtro-sharpie/xtro-sharpie/FieldCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/FieldCheck.cs
@@ -57,10 +57,10 @@ void CheckAttributes (string memberName, ICustomAttributeProvider p)
&& ca.Constructor.DeclaringType.Name != "FieldAttribute`1")
continue;
- var name = ca.ConstructorArguments [0].Value as string;
+ var name = (string) ca.ConstructorArguments [0].Value!;
if (!fields.TryGetValue (name, out var mr))
- fields.Add (name, p as MemberReference);
+ fields.Add (name, (MemberReference) p);
else {
// not critical and quite noisy with current API profile
// Console.WriteLine ("!duplicate-field-name! {0} [Field] exists as both {1} and {2}", name, memberName, mr.FullName);
diff --git a/tests/xtro-sharpie/xtro-sharpie/Helpers.cs b/tests/xtro-sharpie/xtro-sharpie/Helpers.cs
index 59ec697da80f..11f62b971db8 100644
--- a/tests/xtro-sharpie/xtro-sharpie/Helpers.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/Helpers.cs
@@ -1,3 +1,5 @@
+using System.Diagnostics.CodeAnalysis;
+
namespace Extrospection {
public enum Platforms {
@@ -252,7 +254,9 @@ static bool IsStatic (this TypeDefinition self)
return (self.IsSealed && self.IsAbstract);
}
- public static string GetName (this ObjCMethodDecl self)
+
+ [return: NotNullIfNotNull (nameof (self))]
+ public static string? GetName (this ObjCMethodDecl? self)
{
if (self is null)
return null;
@@ -263,7 +267,7 @@ public static string GetName (this ObjCMethodDecl self)
if (self.DeclContext is ObjCCategoryDecl category) {
sb.Append (category.ClassInterface.Name);
} else {
- sb.Append ((self.DeclContext as NamedDecl).Name);
+ sb.Append (((NamedDecl) self.DeclContext!).Name);
}
sb.Append ("::");
var sel = self.Selector.ToString ();
@@ -271,7 +275,7 @@ public static string GetName (this ObjCMethodDecl self)
return sb.ToString ();
}
- public static string GetName (this TypeDefinition self)
+ public static string? GetName (this TypeDefinition? self)
{
if ((self is null) || !self.HasCustomAttributes)
return null;
@@ -309,13 +313,13 @@ public static string GetName (this TypeDefinition self)
return null;
}
- public static string GetName (this MethodDefinition self)
+ public static string? GetName (this MethodDefinition? self)
{
if (self is null)
return null;
var type = self.DeclaringType;
- string tname = self.DeclaringType.GetName ();
+ string? tname = self.DeclaringType.GetName ();
// a static type is not used for static selectors
bool is_static = !type.IsStatic () && self.IsStatic;
@@ -340,7 +344,7 @@ public static string GetName (this MethodDefinition self)
return sb.ToString ();
}
- public static string GetSelector (this MethodDefinition self)
+ public static string? GetSelector (this MethodDefinition self)
{
if ((self is null) || !self.HasCustomAttributes)
return null;
@@ -375,9 +379,12 @@ public static bool IsObsolete (this ICustomAttributeProvider provider)
return false;
}
- public static PropertyDefinition FindProperty (this MethodReference method)
+ public static PropertyDefinition? FindProperty (this MethodReference? method)
{
- var def = method?.Resolve ();
+ if (method is null)
+ return null;
+
+ var def = method.Resolve ();
if (def is null)
return null;
@@ -409,7 +416,7 @@ public static string GetFramework (TypeReference type)
public static string GetFramework (MethodDefinition method)
{
- string framework = null;
+ string? framework = null;
if (method.HasPInvokeInfo)
framework = Path.GetFileNameWithoutExtension (method.PInvokeInfo.Module.Name);
else
@@ -423,7 +430,7 @@ public static string GetFramework (MemberReference member)
return MapFramework (framework);
}
- public static string GetFramework (Decl decl)
+ public static string? GetFramework (Decl decl)
{
var header_file = decl.PresumedLoc?.FileName;
if (header_file is null)
@@ -469,7 +476,7 @@ public static string MapFramework (string candidate)
}
}
- public static (T, T) Sort (T o1, T o2)
+ public static (T, T) Sort (T o1, T o2) where T : notnull
{
if (StringComparer.Ordinal.Compare (o1.ToString (), o2.ToString ()) < 0)
return (o2, o1);
diff --git a/tests/xtro-sharpie/xtro-sharpie/Log.cs b/tests/xtro-sharpie/xtro-sharpie/Log.cs
index a899ea9b7809..1c591f81910e 100644
--- a/tests/xtro-sharpie/xtro-sharpie/Log.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/Log.cs
@@ -1,12 +1,11 @@
namespace Extrospection {
static class Log {
- static Dictionary> lists = new Dictionary> (StringComparer.OrdinalIgnoreCase);
+ static Dictionary> lists = new (StringComparer.OrdinalIgnoreCase);
public static IList On (string fx)
{
- List list;
- if (!lists.TryGetValue (fx, out list)) {
+ if (!lists.TryGetValue (fx, out var list)) {
list = new List ();
lists.Add (fx, list);
}
diff --git a/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs b/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs
index fcbec45a3096..bd3276488531 100644
--- a/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/NullabilityCheck.cs
@@ -27,13 +27,13 @@ public NullabilityCheck (BindingResult bindingResult)
{
}
- static TypeDefinition GetType (ObjCInterfaceDecl decl)
+ static TypeDefinition? GetType (ObjCInterfaceDecl decl)
{
types.TryGetValue (decl.Name, out var td);
return td;
}
- static MethodDefinition GetMethod (ObjCMethodDecl decl)
+ static MethodDefinition? GetMethod (ObjCMethodDecl decl)
{
methods.TryGetValue (decl.GetName (), out var md);
return md;
@@ -91,7 +91,7 @@ static Null [] GetNullable (ICustomAttributeProvider cap)
// Type is `System.Byte[]` and value is a `CustomAttributeArgument[]`
// each with a `Type` of `System.Byte` and where value is a `byte`
case "System.Byte[]":
- var caa = first.Value as CustomAttributeArgument [];
+ var caa = (CustomAttributeArgument []) first.Value;
var length = caa.Length;
var values = new Null [length];
for (int i = 0; i < length; i++)
@@ -106,11 +106,11 @@ static Null [] GetNullable (ICustomAttributeProvider cap)
public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !(((Decl) decl.DeclContext!).IsAvailable ()))
return;
// don't process deprecated methods (or types)
- if (decl.IsDeprecated () || (decl.DeclContext as Decl).IsDeprecated ())
+ if (decl.IsDeprecated () || (((Decl) decl.DeclContext!).IsDeprecated ()))
return;
var method = GetMethod (decl);
@@ -203,7 +203,7 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
ICustomAttributeProvider cap;
// the managed attributes are on the property, not the special methods
if (method.IsGetter) {
- var property = method.FindProperty ();
+ var property = method.FindProperty ()!;
// also `null_resettable` will only show something (natively) on the setter (since it does not return null, but accept it)
// in this case we'll trust xtro checking the setter only (if it exists, if not then it can't be `null_resettable`)
if (property.SetMethod is not null)
diff --git a/tests/xtro-sharpie/xtro-sharpie/ObjCInterfaceCheck.cs b/tests/xtro-sharpie/xtro-sharpie/ObjCInterfaceCheck.cs
index e0e0921085c7..5d0fbaa6645f 100644
--- a/tests/xtro-sharpie/xtro-sharpie/ObjCInterfaceCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/ObjCInterfaceCheck.cs
@@ -15,7 +15,7 @@ public override void VisitManagedType (TypeDefinition type)
if (!type.HasCustomAttributes)
return;
- string rname = null;
+ string? rname = null;
bool wrapper = true;
bool skip = false;
@@ -24,7 +24,7 @@ public override void VisitManagedType (TypeDefinition type)
case "RegisterAttribute":
rname = type.Name;
if (ca.HasConstructorArguments) {
- rname = (ca.ConstructorArguments [0].Value as string);
+ rname = (string?) ca.ConstructorArguments [0].Value;
if (ca.ConstructorArguments.Count > 1)
wrapper = (bool) ca.ConstructorArguments [1].Value;
}
@@ -47,8 +47,7 @@ public override void VisitManagedType (TypeDefinition type)
}
}
if (!skip && wrapper && !String.IsNullOrEmpty (rname)) {
- TypeDefinition td;
- if (!type_map.TryGetValue (rname, out td)) {
+ if (!type_map.TryGetValue (rname, out var td)) {
type_map.Add (rname, type);
type_map_copy.Add (rname, type);
} else {
@@ -149,22 +148,22 @@ public override void EndVisit ()
}
// - version check
- bool ImplementProtocol (string protocol, TypeDefinition td)
+ bool ImplementProtocol (string protocol, TypeDefinition? td)
{
if (td is null)
return false;
if (td.HasInterfaces) {
foreach (var intf in td.Interfaces) {
TypeReference ifaceType;
- ifaceType = intf?.InterfaceType;
- if (protocol == GetProtocolName (ifaceType?.Resolve ()))
+ ifaceType = intf.InterfaceType;
+ if (protocol == GetProtocolName (ifaceType.Resolve ()))
return true;
}
}
return ImplementProtocol (protocol, td.BaseType?.Resolve ());
}
- public static string GetProtocolName (TypeDefinition td)
+ public static string? GetProtocolName (TypeDefinition td)
{
if (!td.HasCustomAttributes)
return null;
diff --git a/tests/xtro-sharpie/xtro-sharpie/ObjCProtocolCheck.cs b/tests/xtro-sharpie/xtro-sharpie/ObjCProtocolCheck.cs
index aaff81f0f2a7..4ad4fbb17d50 100644
--- a/tests/xtro-sharpie/xtro-sharpie/ObjCProtocolCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/ObjCProtocolCheck.cs
@@ -43,7 +43,7 @@ public override void VisitManagedType (TypeDefinition type)
return;
}
- string pname = null;
+ string? pname = null;
bool informal = false;
foreach (var ca in type.CustomAttributes) {
@@ -82,8 +82,7 @@ public override void VisitObjCProtocolDecl (ObjCProtocolDecl decl)
return;
var name = decl.Name;
- TypeDefinition td;
- if (!protocol_map.TryGetValue (name, out td)) {
+ if (!protocol_map.TryGetValue (name, out var td)) {
if (!decl.IsDeprecated ())
Log.On (framework).Add ($"!missing-protocol! {name} not bound");
// other checks can't be done without an actual protocol to inspect
@@ -93,9 +92,9 @@ public override void VisitObjCProtocolDecl (ObjCProtocolDecl decl)
// build type selector-required map
var map = new Dictionary ();
foreach (var ca in td.CustomAttributes) {
- string export = null;
- string g_export = null;
- string s_export = null;
+ string? export = null;
+ string? g_export = null;
+ string? s_export = null;
bool is_required = false;
bool is_property = false;
bool is_static = false;
@@ -143,7 +142,7 @@ public override void VisitObjCProtocolDecl (ObjCProtocolDecl decl)
}
}
- var deprecatedProtocol = (decl.DeclContext as Decl).IsDeprecated ();
+ var deprecatedProtocol = ((Decl) decl.DeclContext!).IsDeprecated ();
// don't report anything for deprecated protocols
// (we still report some errors for deprecated members of non-deprecated protocols - because abstract/non-abstract can
@@ -196,7 +195,7 @@ public override void VisitObjCProtocolDecl (ObjCProtocolDecl decl)
protocol_map.Remove (name);
}
- static string GetSelector (ObjCMethodDecl method)
+ static string? GetSelector (ObjCMethodDecl method)
{
var result = method.Selector.ToString ();
if (result is not null)
diff --git a/tests/xtro-sharpie/xtro-sharpie/ReleaseAttributeCheck.cs b/tests/xtro-sharpie/xtro-sharpie/ReleaseAttributeCheck.cs
index 4870d88cc7a9..9a0cc9f77651 100644
--- a/tests/xtro-sharpie/xtro-sharpie/ReleaseAttributeCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/ReleaseAttributeCheck.cs
@@ -28,8 +28,8 @@ public override void VisitManagedMethod (MethodDefinition method)
if (method.ReturnType.IsValueType)
return;
- string family = null;
- string selector = null;
+ string? family = null;
+ string? selector = null;
bool hasReleaseAttribute = false;
if (method.MethodReturnType.HasCustomAttributes) {
diff --git a/tests/xtro-sharpie/xtro-sharpie/RequiresSuperCheck.cs b/tests/xtro-sharpie/xtro-sharpie/RequiresSuperCheck.cs
index 3a162e51fc0d..1944d0a692c2 100644
--- a/tests/xtro-sharpie/xtro-sharpie/RequiresSuperCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/RequiresSuperCheck.cs
@@ -19,7 +19,7 @@ public RequiresSuperCheck (BindingResult bindingResult)
{
}
- static MethodDefinition GetMethod (ObjCMethodDecl decl)
+ static MethodDefinition? GetMethod (ObjCMethodDecl decl)
{
methods.TryGetValue (decl.GetName (), out var md);
return md;
@@ -50,7 +50,7 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
void Visit (ObjCMethodDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !((Decl) decl.DeclContext!).IsAvailable ())
return;
var method = GetMethod (decl);
diff --git a/tests/xtro-sharpie/xtro-sharpie/Runner.cs b/tests/xtro-sharpie/xtro-sharpie/Runner.cs
index a8fc41f13624..ac6f316dbdc3 100644
--- a/tests/xtro-sharpie/xtro-sharpie/Runner.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/Runner.cs
@@ -132,7 +132,7 @@ public SharpieVisitor (BindingResult bindingResult)
public void Load (string filename, IEnumerable searchDirectories)
{
resolver.AddSearchDirectory (searchDirectories.ToArray ());
- resolver.AddSearchDirectory (Path.GetDirectoryName (filename));
+ resolver.AddSearchDirectory (Path.GetDirectoryName (filename)!);
assemblies.Add (resolver.Load (filename));
}
diff --git a/tests/xtro-sharpie/xtro-sharpie/SelectorCheck.cs b/tests/xtro-sharpie/xtro-sharpie/SelectorCheck.cs
index e31701909bb6..af12bcd6bdf7 100644
--- a/tests/xtro-sharpie/xtro-sharpie/SelectorCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/SelectorCheck.cs
@@ -92,11 +92,11 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
return;
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !((Decl) decl.DeclContext!).IsAvailable ())
return;
// don't process deprecated methods (or types)
- if (decl.IsDeprecated () || (decl.DeclContext as Decl).IsDeprecated ())
+ if (decl.IsDeprecated () || ((Decl) decl.DeclContext!).IsDeprecated ())
return;
var framework = Helpers.GetFramework (decl);
diff --git a/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs b/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs
index b3dd890463d0..c2fea1c947dd 100644
--- a/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/SimdCheck.cs
@@ -6,8 +6,8 @@ class SimdCheck : BaseVisitor {
// A dictionary of native type -> managed type mapping.
class NativeSimdInfo {
- public string Managed;
- public string InvalidManaged;
+ public required string Managed;
+ public string? InvalidManaged;
}
static Dictionary type_mapping = new Dictionary () {
@@ -85,7 +85,7 @@ static SimdCheck ()
}
class ManagedSimdInfo {
- public MethodDefinition Method;
+ public required MethodDefinition Method;
public bool ContainsInvalidMappingForSimd;
}
Dictionary managed_methods = new Dictionary ();
@@ -131,8 +131,7 @@ public override void VisitManagedMethod (MethodDefinition method)
return;
}
- ManagedSimdInfo existing;
- if (managed_methods.TryGetValue (key, out existing)) {
+ if (managed_methods.TryGetValue (key, out var existing)) {
if (very_strict) {
var sorted = Helpers.Sort (existing.Method, method);
var framework = sorted.Item1.DeclaringType.Namespace;
@@ -218,7 +217,7 @@ bool IsExtVector (Decl decl, ClangSharp.Type type, ref string simd_type)
var typeName = type.ToString ();
if (!rv && typeName.Contains ("simd")) {
- var framework = Helpers.GetFramework (decl);
+ var framework = Helpers.GetFramework (decl)!;
Log.On (framework).Add ($"!unknown-simd-type! Could not detect that {typeName} is a Simd type, but its name contains 'simd'. Something needs fixing in SimdCheck.cs");
}
@@ -239,7 +238,7 @@ bool IsSimdType (Decl decl, ClangSharp.Type type, ref string simd_type, ref bool
}
if (IsExtVector (decl, type, ref simd_type)) {
- var framework = Helpers.GetFramework (decl);
+ var framework = Helpers.GetFramework (decl)!;
Log.On (framework).Add ($"!unknown-simd-type-mapping! The Simd type {simd_type} does not have a mapping to a managed type. Please add one in SimdCheck.cs");
}
@@ -339,7 +338,7 @@ void CheckMarshalDirective (MethodDefinition method, string simd_type, bool only
public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !((Decl) decl.DeclContext!).IsAvailable ())
return;
var framework = Helpers.GetFramework (decl);
@@ -351,8 +350,7 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
var only_return_type_is_simd = true;
var native_simd = ContainsSimdTypes (decl, ref simd_type, ref requires_marshal_directive, ref only_return_type_is_simd);
- ManagedSimdInfo info;
- managed_methods.TryGetValue (decl.GetName (), out info);
+ managed_methods.TryGetValue (decl.GetName (), out var info);
var method = info?.Method;
if (!native_simd) {
@@ -392,7 +390,7 @@ public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
return;
}
- if (!info.ContainsInvalidMappingForSimd) {
+ if (!info!.ContainsInvalidMappingForSimd) {
// The managed method does not have any types that are incorrect for Simd.
if (requires_marshal_directive)
CheckMarshalDirective (method, simd_type, only_return_type_is_simd);
diff --git a/tests/xtro-sharpie/xtro-sharpie/UIAppearanceCheck.cs b/tests/xtro-sharpie/xtro-sharpie/UIAppearanceCheck.cs
index 47d3895f77e4..ef23f37aea9f 100644
--- a/tests/xtro-sharpie/xtro-sharpie/UIAppearanceCheck.cs
+++ b/tests/xtro-sharpie/xtro-sharpie/UIAppearanceCheck.cs
@@ -21,7 +21,7 @@ public UIAppearanceCheck (BindingResult bindingResult)
{
}
- static MethodDefinition GetMethod (ObjCMethodDecl decl)
+ static MethodDefinition? GetMethod (ObjCMethodDecl decl)
{
methods.TryGetValue (decl.GetName (), out var md);
return md;
@@ -49,7 +49,7 @@ public override void VisitManagedMethod (MethodDefinition method)
public override void VisitObjCPropertyDecl (ObjCPropertyDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !(((Decl) decl.DeclContext!).IsAvailable ()))
return;
// does not look exposed, but part of the dump
@@ -67,7 +67,7 @@ public override void VisitObjCPropertyDecl (ObjCPropertyDecl decl)
public override void VisitObjCMethodDecl (ObjCMethodDecl decl)
{
// don't process methods (or types) that are unavailable for the current platform
- if (!decl.IsAvailable () || !(decl.DeclContext as Decl).IsAvailable ())
+ if (!decl.IsAvailable () || !(((Decl) decl.DeclContext!).IsAvailable ()))
return;
// does not look exposed, but part of the dump
diff --git a/tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj b/tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj
index 6f6eba16dbe4..46a03e54fe0f 100644
--- a/tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj
+++ b/tests/xtro-sharpie/xtro-sharpie/xtro-sharpie.csproj
@@ -10,6 +10,10 @@
osx-arm64
false
+
+ enable
+ Nullable
+ true
diff --git a/tools/common/Application.cs b/tools/common/Application.cs
index f57b363e170d..49f54b05814d 100644
--- a/tools/common/Application.cs
+++ b/tools/common/Application.cs
@@ -65,6 +65,7 @@ public enum RegistrarMode {
PartialStatic,
Static,
ManagedStatic,
+ TrimmableStatic,
}
public partial class Application {
@@ -109,6 +110,9 @@ public partial class Application {
public List MonoLibraries = new List ();
public List InterpretedAssemblies = new List ();
+ public string TypeMapAssemblyName = "";
+ public string TypeMapOutputDirectory = "";
+
// Linker config
#if LEGACY_TOOLS
public LinkMode LinkMode = LinkMode.Full;
@@ -131,6 +135,10 @@ public bool AreAnyAssembliesTrimmed {
}
public bool EnableSGenConc;
+ public bool IsAnyStaticRegistrar {
+ get => Registrar == RegistrarMode.Static || Registrar == RegistrarMode.ManagedStatic || Registrar == RegistrarMode.TrimmableStatic;
+ }
+
public Dictionary EnvironmentVariables = new Dictionary ();
public MarshalObjectiveCExceptionMode MarshalObjectiveCExceptions;
@@ -196,7 +204,7 @@ bool RequiresXcodeHeaders {
case ApplePlatform.MacCatalyst:
return !AreAnyAssembliesTrimmed;
case ApplePlatform.MacOSX:
- return (Registrar == RegistrarMode.Static || Registrar == RegistrarMode.ManagedStatic) && !AreAnyAssembliesTrimmed;
+ return (Registrar == RegistrarMode.Static || Registrar == RegistrarMode.ManagedStatic || Registrar == RegistrarMode.TrimmableStatic) && !AreAnyAssembliesTrimmed;
default:
throw ErrorHelper.CreateError (71, Errors.MX0071, Platform, ProductName);
}
@@ -701,8 +709,11 @@ public void ParseRegistrar (string v)
case "managed-static":
Registrar = RegistrarMode.ManagedStatic;
break;
+ case "trimmable-static":
+ Registrar = RegistrarMode.TrimmableStatic;
+ break;
default:
- throw ErrorHelper.CreateError (20, Errors.MX0020, "--registrar", "managed-static, static, dynamic or default");
+ throw ErrorHelper.CreateError (20, Errors.MX0020, "--registrar", "managed-static, trimmable-static, static, dynamic or default");
}
switch (value) {
diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs
index e2d777aaaf4f..28f4d9a98f7b 100644
--- a/tools/common/Assembly.cs
+++ b/tools/common/Assembly.cs
@@ -279,7 +279,7 @@ void ProcessNativeReferenceOptions (NativeReferenceMetadata metadata)
}
// Don't add -force_load if the binding's SmartLink value is set and the static registrar is being used.
- if (metadata.ForceLoad && !(metadata.SmartLink && (App.Registrar == RegistrarMode.Static || App.Registrar == RegistrarMode.ManagedStatic)))
+ if (metadata.ForceLoad && !(metadata.SmartLink && (App.Registrar == RegistrarMode.Static || App.Registrar == RegistrarMode.ManagedStatic || App.Registrar == RegistrarMode.TrimmableStatic)))
ForceLoad = true;
if (!string.IsNullOrEmpty (metadata.LinkerFlags)) {
diff --git a/tools/common/Optimizations.cs b/tools/common/Optimizations.cs
index 9f4f52d51804..992d36ee118a 100644
--- a/tools/common/Optimizations.cs
+++ b/tools/common/Optimizations.cs
@@ -196,7 +196,7 @@ public void Initialize (Application app, out List messages)
switch ((Opt) i) {
case Opt.StaticBlockToDelegateLookup:
- if (app.Registrar != RegistrarMode.Static && app.Registrar != RegistrarMode.ManagedStatic) {
+ if (!app.IsAnyStaticRegistrar) {
messages.Add (ErrorHelper.CreateWarning (2003, Errors.MT2003, (value.Value ? "" : "-"), opt_names [i]));
values [i] = false;
continue;
@@ -207,7 +207,7 @@ public void Initialize (Application app, out List messages)
case Opt.RegisterProtocols:
case Opt.RemoveDynamicRegistrar:
case Opt.RedirectClassHandles:
- if (app.Registrar != RegistrarMode.Static && app.Registrar != RegistrarMode.ManagedStatic) {
+ if (!app.IsAnyStaticRegistrar) {
messages.Add (ErrorHelper.CreateWarning (2003, Errors.MT2003, (value.Value ? "" : "-"), opt_names [i]));
values [i] = false;
continue;
@@ -254,17 +254,17 @@ public void Initialize (Application app, out List messages)
// We try to optimize calls to BlockLiteral.SetupBlock and certain BlockLiteral constructors if the static registrar is enabled
if (!OptimizeBlockLiteralSetupBlock.HasValue) {
- OptimizeBlockLiteralSetupBlock = app.Registrar == RegistrarMode.Static || app.Registrar == RegistrarMode.ManagedStatic;
+ OptimizeBlockLiteralSetupBlock = app.IsAnyStaticRegistrar;
}
// We will register protocols if the static registrar is enabled
if (!RegisterProtocols.HasValue) {
if (app.Platform != ApplePlatform.MacOSX || app.XamarinRuntime == XamarinRuntime.NativeAOT) {
- RegisterProtocols = (app.Registrar == RegistrarMode.Static || app.Registrar == RegistrarMode.ManagedStatic);
+ RegisterProtocols = app.IsAnyStaticRegistrar;
} else {
RegisterProtocols = false;
}
- } else if (app.Registrar != RegistrarMode.Static && app.Registrar != RegistrarMode.ManagedStatic && RegisterProtocols == true) {
+ } else if (!app.IsAnyStaticRegistrar && RegisterProtocols == true) {
RegisterProtocols = false; // we've already shown a warning for this.
}
@@ -285,7 +285,7 @@ public void Initialize (Application app, out List messages)
} else if (StaticBlockToDelegateLookup != true) {
// Can't remove the dynamic registrar unless also generating static lookup of block-to-delegates in the static registrar.
RemoveDynamicRegistrar = false;
- } else if ((app.Registrar != RegistrarMode.Static && app.Registrar != RegistrarMode.ManagedStatic) || !app.AreAnyAssembliesTrimmed) {
+ } else if (!app.IsAnyStaticRegistrar || !app.AreAnyAssembliesTrimmed) {
// Both the linker and the static registrar are also required
RemoveDynamicRegistrar = false;
} else {
diff --git a/tools/common/StaticRegistrar.cs b/tools/common/StaticRegistrar.cs
index 74b6c5640a26..72cdae2327e1 100644
--- a/tools/common/StaticRegistrar.cs
+++ b/tools/common/StaticRegistrar.cs
@@ -833,7 +833,7 @@ protected override bool ContainsPlatformReference (AssemblyDefinition assembly)
protected override IEnumerable CollectTypes (AssemblyDefinition assembly)
=> GetAllTypes (assembly);
- internal static IEnumerable GetAllTypes (AssemblyDefinition assembly)
+ internal static IEnumerable GetAllTypes (AssemblyDefinition assembly)
{
var queue = new Queue ();
@@ -2022,6 +2022,17 @@ public MethodDefinition GetBaseMethodInTypeHierarchy (MethodDefinition method)
uint full_token_reference_count;
List<(AssemblyDefinition Assembly, string Name)> registered_assemblies = new List<(AssemblyDefinition Assembly, string Name)> ();
+ public bool IsCustomType (ObjCType type)
+ {
+ if (IsPlatformType (type.Type))
+ return false;
+
+ if (!type.IsProtocol && !type.IsCategory)
+ return true;
+
+ return false;
+ }
+
bool IsPlatformType (TypeReference type)
{
if (type.IsNested)
@@ -2824,13 +2835,13 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
var isPlatformType = IsPlatformType (@class.Type);
var flags = MTTypeFlags.None;
+ if (IsCustomType (@class))
+ flags |= MTTypeFlags.CustomType;
+
skip.Clear ();
uint token_ref = uint.MaxValue;
- if (!@class.IsProtocol && !@class.IsCategory) {
- if (!isPlatformType)
- flags |= MTTypeFlags.CustomType;
-
+ if (App.Registrar != RegistrarMode.TrimmableStatic && !@class.IsProtocol && !@class.IsCategory) {
if (!@class.IsWrapper && !@class.IsModel)
flags |= MTTypeFlags.UserType;
@@ -2844,7 +2855,7 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
(int) flags, flags);
bool? use_dynamic = null;
- if (@class.RegisterAttribute?.IsStubClass == true)
+ if (@class.IsStubClass)
use_dynamic = false;
if (!use_dynamic.HasValue) {
@@ -2880,10 +2891,11 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
if (App.Optimizations.RedirectClassHandles == true)
map_init.AppendLine ("__xamarin_class_handles [{0}] = __xamarin_class_map [{0}].handle;", @class.ClassMapIndex);
i++;
+ } else if (App.Registrar == RegistrarMode.TrimmableStatic && @class.IsStubClass) {
+ map_init.AppendLine ("[{0} class];", EncodeNonAsciiCharacters (@class.ExportedName));
}
-
- if (@class.IsProtocol && @class.ProtocolWrapperType is not null) {
+ if (App.Registrar != RegistrarMode.TrimmableStatic && @class.IsProtocol && @class.ProtocolWrapperType is not null) {
if (token_ref == INVALID_TOKEN_REF && !TryCreateTokenReference (@class.Type, TokenType.TypeDef, out token_ref, exceptions))
continue;
if (!TryCreateTokenReference (@class.ProtocolWrapperType, TokenType.TypeDef, out var protocol_wrapper_type_ref, exceptions))
@@ -2925,8 +2937,7 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
iface.Write ("@protocol ").Write (exportedName);
declarations.AppendFormat ("@protocol {0};\n", exportedName);
} else {
- var is_stub_class = @class.RegisterAttribute?.IsStubClass;
- if (is_stub_class == true)
+ if (@class.IsStubClass)
iface.WriteLine ("__attribute__((objc_class_stub)) __attribute__((objc_subclassing_restricted))");
iface.Write ("@interface {0} : {1}", class_name, EncodeNonAsciiCharacters (@class.SuperType!.ExportedName));
declarations.AppendFormat ("@class {0};\n", class_name);
@@ -3114,7 +3125,9 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
if (App.Optimizations.RedirectClassHandles == true)
map.AppendLine ("static void *__xamarin_class_handles [{0}];", i);
- if (skipped_types.Count > 0) {
+
+ var has_skipped_map = App.Registrar != RegistrarMode.TrimmableStatic && skipped_types.Count > 0;
+ if (has_skipped_map) {
map.AppendLine ("static const MTManagedClassMap __xamarin_skipped_map [] = {");
foreach (var skipped in skipped_types) {
if (!TryCreateTokenReference (skipped.Skipped, TokenType.TypeDef, out var skipped_ref, exceptions))
@@ -3197,7 +3210,7 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
map.AppendLine ("__xamarin_registration_assemblies,");
map.AppendLine ("__xamarin_class_map,");
map.AppendLine (full_token_reference_count == 0 ? "NULL," : "__xamarin_token_references,");
- map.AppendLine (skipped_types.Count == 0 ? "NULL," : "__xamarin_skipped_map,");
+ map.AppendLine (!has_skipped_map ? "NULL," : "__xamarin_skipped_map,");
map.AppendLine (protocol_wrapper_map.Count == 0 ? "NULL," : "__xamarin_protocol_wrapper_map,");
if (needs_protocol_map && protocols.Count > 0) {
map.AppendLine ("{ __xamarin_protocol_tokens, __xamarin_protocols },");
@@ -3207,7 +3220,7 @@ void Specialize (AutoIndentStringBuilder sb, out string initialization_method)
map.AppendLine ("{0},", count);
map.AppendLine ("{0},", i);
map.AppendLine ("{0},", full_token_reference_count);
- map.AppendLine ("{0},", skipped_types.Count);
+ map.AppendLine ("{0},", has_skipped_map ? skipped_types.Count : 0);
map.AppendLine ("{0},", protocol_wrapper_map.Count);
map.AppendLine ("{0},", needs_protocol_map ? protocols.Count : 0);
if (App.Optimizations.RedirectClassHandles == true)
@@ -3339,7 +3352,7 @@ bool SpecializeTrampoline (AutoIndentStringBuilder sb, ObjCMethod method, List
#if !LEGACY_TOOLS
// Generate the native trampoline to call the generated UnmanagedCallersOnly method if we're using the managed static registrar.
- if (LinkContext.App.Registrar == RegistrarMode.ManagedStatic) {
+ if (LinkContext.App.Registrar == RegistrarMode.ManagedStatic || LinkContext.App.Registrar == RegistrarMode.TrimmableStatic) {
GenerateCallToUnmanagedCallersOnlyMethod (sb, method, isCtor, isVoid, num_arg, descriptiveMethodName, exceptions);
return;
}
@@ -4295,7 +4308,7 @@ void GenerateCallToUnmanagedCallersOnlyMethod (AutoIndentStringBuilder sb, ObjCM
if (!staticCall) {
sb.WriteLine ($"static {ucoEntryPoint}_function {ucoEntryPoint};");
- sb.WriteLine ($"xamarin_registrar_dlsym ((void **) &{ucoEntryPoint}, \"{method.Method!.Module.Assembly.Name.Name}\", \"{ucoEntryPoint}\", {pinvokeMethodInfo.Id});");
+ sb.WriteLine ($"xamarin_registrar_dlsym ((void **) &{ucoEntryPoint}, \"{method.Method!.Module.Assembly.Name.Name}\", \"{ucoEntryPoint}\", {pinvokeMethodInfo.Id}, \"{method.DeclaringType.ExportedName}\");");
}
if (hasReturnType)
sb.Write ("rv = ");
@@ -5192,6 +5205,9 @@ bool TryCreateTokenReferenceUncached (MemberReference member, TokenType implied_
var token = member.MetadataToken;
#if !LEGACY_TOOLS
+ if (App.Registrar == RegistrarMode.TrimmableStatic)
+ throw ErrorHelper.CreateError (99, $"Can't create a token reference when using the trimmable static registrar (for: {member.FullName})");
+
if (App.Registrar == RegistrarMode.ManagedStatic) {
if (implied_type == TokenType.TypeDef && member is TypeDefinition td) {
if (App.Configuration.AssemblyTrampolineInfos.TryGetValue (td.Module.Assembly, out var infos) && infos.TryGetRegisteredTypeIndex (td, out var id)) {
diff --git a/tools/common/Target.cs b/tools/common/Target.cs
index 7970c889b403..72b13c096e04 100644
--- a/tools/common/Target.cs
+++ b/tools/common/Target.cs
@@ -433,6 +433,8 @@ void GenerateMainImpl (StringWriter sw, Abi abi)
if (app.XamarinRuntime != XamarinRuntime.NativeAOT)
sw.WriteLine ("\txamarin_supports_dynamic_registration = {0};", app.DynamicRegistrationSupported ? "TRUE" : "FALSE");
sw.WriteLine ("\txamarin_runtime_configuration_name = {0};", string.IsNullOrEmpty (app.RuntimeConfigurationFile) ? "NULL" : $"\"{app.RuntimeConfigurationFile}\"");
+ if (app.Registrar == RegistrarMode.TrimmableStatic)
+ sw.WriteLine ("\txamarin_set_is_trimmable_static_registrar (true);");
if (app.Registrar == RegistrarMode.ManagedStatic)
sw.WriteLine ("\txamarin_set_is_managed_static_registrar (true);");
sw.WriteLine ("}");
diff --git a/tools/devops/automation/run-pr-api-diff.yml b/tools/devops/automation/run-pr-api-diff.yml
index 42924ca932a9..07401bdf077c 100644
--- a/tools/devops/automation/run-pr-api-diff.yml
+++ b/tools/devops/automation/run-pr-api-diff.yml
@@ -1,15 +1,25 @@
# Pipeline that will calculate the api diff on a pr commit.
trigger: none
-pr: none
-resources:
- pipelines:
- - pipeline: macios
- source: \Xamarin\Mac-iOS\pr pipelines\xamarin-macios-pr
- trigger:
- stages:
- - configure_build
+pr:
+ autoCancel: true
+ branches:
+ include:
+ - '*' # yes, you do need the quote, * has meaning in yamls
+ paths:
+ exclude:
+ - .github
+ - docs
+ - CODEOWNERS
+ - ISSUE_TEMPLATE.md
+ - LICENSE
+ - NOTICE.txt
+ - SECURITY.MD
+ - README.md
+ - src/README.md
+ - tools/mtouch/README.md
+ - msbuild/Xamarin.Localization.MSBuild/README.md
extends:
template: templates/pipelines/api-diff-pipeline.yml
diff --git a/tools/devops/automation/templates/common/archive-html-report.yml b/tools/devops/automation/templates/common/archive-html-report.yml
new file mode 100644
index 000000000000..cb4c4fed8f0c
--- /dev/null
+++ b/tools/devops/automation/templates/common/archive-html-report.yml
@@ -0,0 +1,47 @@
+# Remove empty directories, archive the Html Report, and publish it as a pipeline artifact.
+parameters:
+
+- name: rootFolder
+ type: string
+
+- name: artifactName
+ type: string
+
+steps:
+
+# Remove empty directories before archiving.
+- pwsh: |
+ $root = "${{ parameters.rootFolder }}"
+ if (Test-Path $root) {
+ Get-ChildItem $root -Recurse -Force -Directory |
+ Sort-Object -Property FullName -Descending |
+ Where-Object { ($_ | Get-ChildItem -Force | Select-Object -First 1).Count -eq 0 } |
+ ForEach-Object {
+ Write-Host "Removing empty directory: $($_.FullName)"
+ Remove-Item -Force $_
+ }
+ }
+ displayName: 'Remove empty directories from HtmlReport'
+ continueOnError: true
+ condition: succeededOrFailed()
+
+# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
+- task: ArchiveFiles@1
+ displayName: 'Archive HtmlReport'
+ inputs:
+ rootFolder: '${{ parameters.rootFolder }}'
+ includeRootFolder: false
+ archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
+ continueOnError: true
+ condition: succeededOrFailed()
+
+# Create HtmlReport artifact. This serves two purposes:
+# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
+# 2. Users can download this if they want.
+- task: PublishPipelineArtifact@1
+ displayName: 'Publish Artifact: HtmlReport'
+ inputs:
+ targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
+ artifactName: '${{ parameters.artifactName }}'
+ continueOnError: true
+ condition: succeededOrFailed()
diff --git a/tools/devops/automation/templates/mac/build.yml b/tools/devops/automation/templates/mac/build.yml
index a6c20308996f..b564d24af9ac 100644
--- a/tools/devops/automation/templates/mac/build.yml
+++ b/tools/devops/automation/templates/mac/build.yml
@@ -223,22 +223,9 @@ steps:
continueOnError: true
condition: succeededOrFailed()
-# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
-- task: ArchiveFiles@1
- displayName: 'Archive HtmlReport'
- inputs:
+- template: ../common/archive-html-report.yml
+ parameters:
rootFolder: '$(BUILD_REPOSITORY_TITLE)/jenkins-results'
- includeRootFolder: false
- archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
- continueOnError: true
- condition: succeededOrFailed()
-
-- task: PublishPipelineArtifact@1
- displayName: 'Publish Artifact: HtmlReport'
- inputs:
- targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-${{ parameters.stageName }}${{ parameters.label }}-$(System.JobAttempt)'
- 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 55f5d8d5a7be..0ff0d43d39cb 100644
--- a/tools/devops/automation/templates/tests/run-tests.yml
+++ b/tools/devops/automation/templates/tests/run-tests.yml
@@ -217,26 +217,10 @@ steps:
continueOnError: true
condition: and(ne(variables['VSTS_XML_FILES'], 0), succeededOrFailed())
-# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
-- task: ArchiveFiles@1
- displayName: 'Archive HtmlReport'
- inputs:
+- template: ../common/archive-html-report.yml
+ parameters:
rootFolder: '$(BUILD_REPOSITORY_TITLE)/jenkins-results'
- includeRootFolder: false
- archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
- continueOnError: true
- condition: succeededOrFailed()
-
-# Create HtmlReport artifact. This serves two purposes:
-# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
-# 2. Users can download this if they want.
-- task: PublishPipelineArtifact@1
- displayName: 'Publish Artifact: HtmlReport'
- inputs:
- targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-${{ parameters.testPrefix }}-$(System.JobAttempt)'
- continueOnError: true
- condition: succeededOrFailed()
# Upload all the binlogs
# Copy all the binlogs to a separate directory, keeping directory structure.
diff --git a/tools/devops/automation/templates/windows/build.yml b/tools/devops/automation/templates/windows/build.yml
index 7145baec4ee5..f54bf8a97134 100644
--- a/tools/devops/automation/templates/windows/build.yml
+++ b/tools/devops/automation/templates/windows/build.yml
@@ -357,26 +357,10 @@ steps:
continueOnError: true
condition: succeededOrFailed()
-# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
-- task: ArchiveFiles@1
- displayName: 'Archive HtmlReport'
- inputs:
+- template: ../common/archive-html-report.yml
+ parameters:
rootFolder: '$(Build.SourcesDirectory)/$(BUILD_REPOSITORY_TITLE)/jenkins-results'
- includeRootFolder: false
- archiveFile: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
- continueOnError: true
- condition: succeededOrFailed()
-
-# Create HtmlReport artifact. This serves two purposes:
-# 1. It is the way we are going to share the HtmlReport with the publish_html job that is executed on a Windows machine.
-# 2. Users can download this if they want.
-- task: PublishPipelineArtifact@1
- displayName: 'Publish Artifact: HtmlReport'
- inputs:
- targetPath: '$(Build.ArtifactStagingDirectory)/HtmlReport.zip'
artifactName: '${{ parameters.uploadPrefix }}HtmlReport-windows_integrationwindows-$(System.JobAttempt)'
- continueOnError: true
- condition: succeededOrFailed()
- pwsh: |
Write-Host "Run windows tests."
diff --git a/tools/dotnet-linker/AppBundleRewriter.cs b/tools/dotnet-linker/AppBundleRewriter.cs
index b2d8538ee74a..f49c71d518bd 100644
--- a/tools/dotnet-linker/AppBundleRewriter.cs
+++ b/tools/dotnet-linker/AppBundleRewriter.cs
@@ -52,6 +52,21 @@ public AssemblyDefinition PlatformAssembly {
}
}
+ AssemblyDefinition? system_console_assembly;
+ public AssemblyDefinition SystemConsoleAssembly {
+ get {
+ if (system_console_assembly is null) {
+ system_console_assembly = configuration.Assemblies.SingleOrDefault (v => v.Name.Name == "System.Console")!;
+ if (system_console_assembly is null) {
+ system_console_assembly = CorlibAssembly.MainModule.AssemblyResolver.Resolve (new AssemblyNameReference ("System.Console", CorlibAssembly.MainModule.Assembly.Name.Version));
+ if (system_console_assembly is null)
+ throw ErrorHelper.CreateError (99, "Unable to find System.Console assembly");
+ }
+ }
+ return system_console_assembly;
+ }
+ }
+
Dictionary> type_map = new ();
Dictionary method_map = new ();
Dictionary field_map = new ();
@@ -125,7 +140,7 @@ public MethodReference GetMethodReference (AssemblyDefinition assembly, TypeRefe
method_map.Add (key, tuple);
// Make the method public so that we can call it.
- if (!md.IsPublic) {
+ if (!md.IsPublic && md.DeclaringType.Module.Assembly.FullName != CorlibAssembly.FullName) {
md.IsPublic = true;
SaveAssembly (md.Module.Assembly);
}
@@ -199,6 +214,12 @@ public FieldReference GetFieldReference (AssemblyDefinition assembly, TypeRefere
/* Types */
+ public TypeReference System_Attribute {
+ get {
+ return GetTypeReference (CorlibAssembly, "System.Attribute", out var _);
+ }
+ }
+
public TypeReference System_Boolean {
get {
return CurrentAssembly.MainModule.ImportReference (CorlibAssembly.MainModule.TypeSystem.Boolean);
@@ -211,6 +232,11 @@ public TypeReference System_Byte {
}
}
+ public TypeReference System_Console {
+ get {
+ return GetTypeReference (SystemConsoleAssembly, "System.Console", out var _);
+ }
+ }
public TypeReference System_Delegate {
get {
return GetTypeReference (CorlibAssembly, "System.Delegate", out var _);
@@ -372,6 +398,12 @@ public MethodReference Foundation_NSObject_FlagsSetterMethod {
}
}
+ public TypeReference Foundation_ProtocolAttribute {
+ get {
+ return GetTypeReference (PlatformAssembly, "Foundation.ProtocolAttribute", out var _);
+ }
+ }
+
public TypeReference ObjCRuntime_BindAs {
get {
return GetTypeReference (PlatformAssembly, "ObjCRuntime.BindAs", out var _);
@@ -384,6 +416,12 @@ public TypeReference ObjCRuntime_BlockLiteral {
}
}
+ public TypeReference ObjCRuntime_Class {
+ get {
+ return GetTypeReference (PlatformAssembly, "ObjCRuntime.Class", out var _);
+ }
+ }
+
public TypeReference ObjCRuntime_IManagedRegistrar {
get {
return GetTypeReference (PlatformAssembly, "ObjCRuntime.IManagedRegistrar", out var _);
@@ -402,6 +440,12 @@ public TypeReference ObjCRuntime_INativeObject {
}
}
+ public TypeReference ObjCRuntime_INativeObjectProxyAttribute {
+ get {
+ return GetTypeReference (PlatformAssembly, "ObjCRuntime.INativeObjectProxyAttribute", out var _);
+ }
+ }
+
public TypeReference ObjCRuntime_NativeHandle {
get {
return GetTypeReference (PlatformAssembly, "ObjCRuntime.NativeHandle", out var _);
@@ -414,6 +458,18 @@ public TypeReference ObjCRuntime_NativeObjectExtensions {
}
}
+ public TypeReference ObjCRuntime_NSObjectProxyAttribute {
+ get {
+ return GetTypeReference (PlatformAssembly, "ObjCRuntime.NSObjectProxyAttribute", out var _);
+ }
+ }
+
+ public TypeReference ObjCRuntime_ProtocolProxyAttribute {
+ get {
+ return GetTypeReference (PlatformAssembly, "ObjCRuntime.ProtocolProxyAttribute", out var _);
+ }
+ }
+
public TypeReference ObjCRuntime_RegistrarHelper {
get {
return GetTypeReference (PlatformAssembly, "ObjCRuntime.RegistrarHelper", out var _);
@@ -432,14 +488,51 @@ public TypeReference ObjCRuntime_RuntimeException {
}
}
+ public TypeReference ObjCRuntime_SkippedObjectiveCTypeUniverse {
+ get {
+ return GetTypeReference (PlatformAssembly, "ObjCRuntime.SkippedObjectiveCTypeUniverse", out var _);
+ }
+ }
+
/* Methods */
+ public MethodReference System_Attribute__ctor {
+ get {
+ return GetMethodReference (CorlibAssembly, System_Attribute, ".ctor", (v) => v.IsDefaultConstructor ());
+ }
+ }
+
+ public MethodReference System_Console__WriteLine_String_Object {
+ get {
+ return GetMethodReference (SystemConsoleAssembly, System_Console, "WriteLine", (v) =>
+ v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 2
+ && v.Parameters [0].ParameterType.Is ("System", "String")
+ && v.Parameters [1].ParameterType.Is ("System", "Object")
+ && !v.HasGenericParameters);
+ }
+ }
+
public MethodReference System_Object__ctor {
get {
return GetMethodReference (CorlibAssembly, System_Object, ".ctor", (v) => v.IsDefaultConstructor ());
}
}
+ public MethodReference System_String__op_Equality_String_String {
+ get {
+ return GetMethodReference (CorlibAssembly, System_String, "op_Equality", (v) =>
+ v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 2
+ && v.Parameters [0].ParameterType.Is ("System", "String")
+ && v.Parameters [1].ParameterType.Is ("System", "String")
+ && v.ReturnType.Is ("System", "Boolean")
+ && !v.HasGenericParameters);
+ }
+ }
+
public MethodReference Nullable_HasValue {
get {
return GetMethodReference (CorlibAssembly, System_Nullable_1, "get_HasValue", isStatic: false);
@@ -622,6 +715,35 @@ public MethodReference BindAs_CreateNullable2 {
}
}
+ public MethodReference Class_GetHandle__System_String {
+ get {
+ return GetMethodReference (PlatformAssembly, ObjCRuntime_Class, "GetHandle", (v) =>
+ v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 1
+ && v.Parameters [0].ParameterType.Is ("System", "String")
+ && !v.HasGenericParameters);
+ }
+ }
+
+ public MethodReference ObjCRuntime_INativeObjectProxyAttribute__ctor {
+ get {
+ return GetMethodReference (PlatformAssembly, ObjCRuntime_INativeObjectProxyAttribute, ".ctor", (v) => v.IsDefaultConstructor ());
+ }
+ }
+
+ public MethodReference ObjCRuntime_NSObjectProxy__ctor {
+ get {
+ return GetMethodReference (PlatformAssembly, ObjCRuntime_NSObjectProxyAttribute, ".ctor", (v) => v.IsDefaultConstructor ());
+ }
+ }
+
+ public MethodReference ObjCRuntime_ProtocolProxy__ctor {
+ get {
+ return GetMethodReference (PlatformAssembly, ObjCRuntime_ProtocolProxyAttribute, ".ctor", (v) => v.IsDefaultConstructor ());
+ }
+ }
+
public MethodReference RegistrarHelper_NSArray_string_native_to_managed {
get {
return GetMethodReference (PlatformAssembly, ObjCRuntime_RegistrarHelper, "NSArray_string_native_to_managed", (v) =>
@@ -1196,6 +1318,55 @@ public MethodReference UnmanagedCallersOnlyAttribute_Constructor {
}
}
+ public MethodReference TypeMapAttribute_1_Constructor_String_Type {
+ get {
+ GetTypeReference (CorlibAssembly, "System.Runtime.InteropServices.TypeMapAttribute`1", out var td);
+ return GetMethodReference (CorlibAssembly, td, ".ctor",
+ "System.Runtime.InteropServices.TypeMapAttribute`1::.ctor(string,Type)",
+ (v) =>
+ !v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 2
+ && v.Parameters [0].ParameterType.Is ("System", "String")
+ && v.Parameters [1].ParameterType.Is ("System", "Type"));
+ }
+ }
+
+ public MethodReference TypeMapAttribute_1_Constructor_String_Type_Type {
+ get {
+ GetTypeReference (CorlibAssembly, "System.Runtime.InteropServices.TypeMapAttribute`1", out var td);
+ return GetMethodReference (CorlibAssembly, td, ".ctor",
+ "System.Runtime.InteropServices.TypeMapAttribute`1::.ctor(string,Type,Type)",
+ (v) =>
+ !v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 3
+ && v.Parameters [0].ParameterType.Is ("System", "String")
+ && v.Parameters [1].ParameterType.Is ("System", "Type")
+ && v.Parameters [2].ParameterType.Is ("System", "Type"));
+ }
+ }
+
+ public MethodReference TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type {
+ get {
+ return GetMethodReference (CorlibAssembly, "System.Runtime.InteropServices.TypeMapAssemblyTargetAttribute`1", ".ctor", (v) =>
+ !v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 1
+ && v.Parameters [0].ParameterType.Is ("System", "String"));
+ }
+ }
+ public MethodReference TypeMapAssociationAttribute_1_Constructor_Type_Type {
+ get {
+ return GetMethodReference (CorlibAssembly, "System.Runtime.InteropServices.TypeMapAssociationAttribute`1", ".ctor", (v) =>
+ !v.IsStatic
+ && v.HasParameters
+ && v.Parameters.Count == 2
+ && v.Parameters [0].ParameterType.Is ("System", "Type")
+ && v.Parameters [1].ParameterType.Is ("System", "Type"));
+ }
+ }
+
public MethodReference Unsafe_AsRef {
get {
return GetMethodReference (CorlibAssembly, "System.Runtime.CompilerServices.Unsafe", "AsRef", (v) =>
@@ -1258,7 +1429,7 @@ public void ClearCurrentAssembly ()
field_map.Clear ();
}
- CustomAttribute CreateAttribute (MethodReference constructor)
+ public 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.
diff --git a/tools/dotnet-linker/CecilExtensions.cs b/tools/dotnet-linker/CecilExtensions.cs
index 705b5bcda241..2831ac7ace71 100644
--- a/tools/dotnet-linker/CecilExtensions.cs
+++ b/tools/dotnet-linker/CecilExtensions.cs
@@ -42,6 +42,21 @@ public static FieldDefinition AddField (this TypeDefinition self, string name, F
return rv;
}
+ public static bool TryFindSingle (this Mono.Collections.Generic.Collection self, Func predicate, out T? result) where T : class
+ {
+ result = null;
+ foreach (var item in self) {
+ if (predicate (item)) {
+ if (result is not null) {
+ result = null;
+ return false;
+ }
+ result = item;
+ }
+ }
+ return result is not null;
+ }
+
public static MethodBody CreateBody (this MethodDefinition self, out ILProcessor il)
{
var body = new MethodBody (self);
diff --git a/tools/dotnet-linker/LinkerConfiguration.cs b/tools/dotnet-linker/LinkerConfiguration.cs
index 853ccfe10d5f..bb7a257231c7 100644
--- a/tools/dotnet-linker/LinkerConfiguration.cs
+++ b/tools/dotnet-linker/LinkerConfiguration.cs
@@ -69,6 +69,17 @@ internal AppBundleRewriter AppBundleRewriter {
}
}
+ public AssemblyDefinition EntryAssembly {
+ get {
+ var entryAssemblyName = Path.GetFileNameWithoutExtension (Application.AssemblyName);
+ var entryAssembly = Assemblies.FirstOrDefault (a => a.Name.Name == entryAssemblyName);
+ if (entryAssembly is null)
+ throw new InvalidOperationException ($"The entry assembly '{entryAssemblyName}' was not found among the loaded assemblies.");
+
+ return entryAssembly;
+ }
+ }
+
// This dictionary contains information about the trampolines created for each assembly.
public AssemblyTrampolineInfos AssemblyTrampolineInfos = new ();
@@ -355,6 +366,12 @@ public static LinkerConfiguration GetInstance (LinkContext context)
throw new InvalidOperationException ($"Invalid TargetFramework '{value}' in {linker_file}");
Driver.TargetFramework = TargetFramework.Parse (value);
break;
+ case "TypeMapAssemblyName":
+ Application.TypeMapAssemblyName = value;
+ break;
+ case "TypeMapOutputDirectory":
+ Application.TypeMapOutputDirectory = value;
+ break;
case "UseLlvm":
use_llvm = string.Equals ("true", value, StringComparison.OrdinalIgnoreCase);
break;
@@ -542,6 +559,8 @@ public void Write ()
Console.WriteLine ($" SdkDevPath: {Driver.SdkRoot}");
Console.WriteLine ($" SdkRootDirectory: {SdkRootDirectory}");
Console.WriteLine ($" SdkVersion: {SdkVersion}");
+ Console.WriteLine ($" TypeMapAssemblyName: {Application.TypeMapAssemblyName}");
+ Console.WriteLine ($" TypeMapOutputDirectory: {Application.TypeMapOutputDirectory}");
Console.WriteLine ($" UseInterpreter: {Application.UseInterpreter}");
Console.WriteLine ($" UseLlvm: {Application.IsLLVM}");
Console.WriteLine ($" Verbosity: {Verbosity}");
diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs
index b78eb89ee62e..a0d764222e29 100644
--- a/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs
+++ b/tools/dotnet-linker/Steps/ManagedRegistrarLookupTablesStep.cs
@@ -357,7 +357,7 @@ void GenerateConstructNSObject (TypeDefinition registrarType)
}
// In addition to the big lookup method, implement the static factory method on the type:
- ImplementConstructNSObjectFactoryMethod (type, ctor);
+ ImplementConstructNSObjectFactoryMethod (abr, DerivedLinkContext, type, ctor);
}
// return default (NSObject);
@@ -415,7 +415,7 @@ void GenerateConstructINativeObject (TypeDefinition registrarType)
}
// In addition to the big lookup method, implement the static factory method on the type:
- ImplementConstructINativeObjectFactoryMethod (type, ctorRef);
+ ImplementConstructINativeObjectFactoryMethod (abr, DerivedLinkContext, type, ctorRef);
}
// return default (NSObject)
@@ -444,26 +444,33 @@ void MarkConstructorIfTrimmed (MethodReference ctor)
}
}
- void AddTypeInterfaceImplementation (TypeDefinition type, TypeReference iface)
+ static void AddTypeInterfaceImplementation (AppBundleRewriter abr, Tuner.DerivedLinkContext context, TypeDefinition type, TypeReference iface)
{
if (type.HasInterfaces && type.Interfaces.Any (v => v.InterfaceType == iface))
return;
var ifaceImplementation = new InterfaceImplementation (iface);
type.Interfaces.Add (ifaceImplementation);
- Annotations.Mark (ifaceImplementation);
- Annotations.Mark (ifaceImplementation.InterfaceType);
- Annotations.Mark (ifaceImplementation.InterfaceType.Resolve ());
+
+ // make sure the trimmer doesn't trim it away if the type is kept
+ if (context.App.Registrar == RegistrarMode.TrimmableStatic) {
+ // TODO: need to investigate why this is needed (https://github.com/dotnet/macios/issues/25232)
+ abr.AddAttributeToStaticConstructor (type, abr.CreateDynamicDependencyAttribute (DynamicallyAccessedMemberTypes.Interfaces, type));
+ } else {
+ context.Annotations.Mark (ifaceImplementation);
+ context.Annotations.Mark (ifaceImplementation.InterfaceType);
+ context.Annotations.Mark (ifaceImplementation.InterfaceType.Resolve ());
+ }
}
- void ImplementConstructNSObjectFactoryMethod (TypeDefinition type, MethodReference ctor)
+ internal static void ImplementConstructNSObjectFactoryMethod (AppBundleRewriter abr, Tuner.DerivedLinkContext context, TypeDefinition type, MethodReference ctor)
{
// skip creating the factory for NSObject itself
if (type.Is ("Foundation", "NSObject"))
return;
// Make sure the type implements INSObjectFactory, otherwise we can't override the _Xamarin_ConstructNSObject method from it.
- AddTypeInterfaceImplementation (type, abr.Foundation_INSObjectFactory);
+ AddTypeInterfaceImplementation (abr, context, type, abr.Foundation_INSObjectFactory);
var createInstanceMethod = type.AddMethod ("_Xamarin_ConstructNSObject", MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.NewSlot | MethodAttributes.HideBySig, abr.Foundation_NSObject);
var nativeHandleParameter = createInstanceMethod.AddParameter ("nativeHandle", abr.ObjCRuntime_NativeHandle);
@@ -485,22 +492,28 @@ void ImplementConstructNSObjectFactoryMethod (TypeDefinition type, MethodReferen
body.GenerateILOffsets ();
- Annotations.Mark (createInstanceMethod);
+ // make sure the trimmer doesn't trim it away if the type is kept
+ if (context.App.Registrar == RegistrarMode.TrimmableStatic) {
+ // TODO: need to investigate why this is needed (https://github.com/dotnet/macios/issues/25232)
+ abr.AddDynamicDependencyAttributeToStaticConstructor (type, createInstanceMethod);
+ } else {
+ context.Annotations.Mark (createInstanceMethod);
+ }
}
- void ImplementConstructINativeObjectFactoryMethod (TypeDefinition type, MethodReference? ctor)
+ internal static void ImplementConstructINativeObjectFactoryMethod (AppBundleRewriter abr, Tuner.DerivedLinkContext context, TypeDefinition type, MethodReference? ctor)
{
// skip creating the factory for NSObject itself
if (type.Is ("Foundation", "NSObject"))
return;
// If the type is a subclass of NSObject, we prefer the NSObject "IntPtr" constructor
- var nsobjectConstructor = type.IsNSObject (DerivedLinkContext) ? FindNSObjectConstructor (type) : null;
+ MethodReference? nsobjectConstructor = type.IsNSObject (context) ? FindNSObjectConstructor (type) : null;
if (nsobjectConstructor is null && ctor is null)
return;
// Make sure the type implements INativeObject, otherwise we can't override the _Xamarin_ConstructINativeObject method from it.
- AddTypeInterfaceImplementation (type, abr.ObjCRuntime_INativeObject);
+ AddTypeInterfaceImplementation (abr, context, type, abr.ObjCRuntime_INativeObject);
var createInstanceMethod = type.AddMethod ("_Xamarin_ConstructINativeObject", MethodAttributes.Public | MethodAttributes.Static | MethodAttributes.NewSlot | MethodAttributes.HideBySig, abr.ObjCRuntime_INativeObject);
var nativeHandleParameter = createInstanceMethod.AddParameter ("nativeHandle", abr.ObjCRuntime_NativeHandle);
@@ -559,15 +572,21 @@ void ImplementConstructINativeObjectFactoryMethod (TypeDefinition type, MethodRe
body.GenerateILOffsets ();
- Annotations.Mark (createInstanceMethod);
+ // make sure the trimmer doesn't trim it away if the type is kept
+ if (context.App.Registrar == RegistrarMode.TrimmableStatic) {
+ // TODO: need to investigate why this is needed (https://github.com/dotnet/macios/issues/25232)
+ abr.AddDynamicDependencyAttributeToStaticConstructor (type, createInstanceMethod);
+ } else {
+ context.Annotations.Mark (createInstanceMethod);
+ }
}
- static MethodReference? FindNSObjectConstructor (TypeDefinition type)
+ internal static MethodDefinition? FindNSObjectConstructor (TypeDefinition type)
{
return FindConstructorWithOneParameter ("ObjCRuntime", "NativeHandle")
?? FindConstructorWithOneParameter ("System", "IntPtr");
- MethodReference? FindConstructorWithOneParameter (string ns, string cls)
+ MethodDefinition? FindConstructorWithOneParameter (string ns, string cls)
=> type.Methods.SingleOrDefault (method =>
method.IsConstructor
&& !method.IsStatic
@@ -576,13 +595,12 @@ void ImplementConstructINativeObjectFactoryMethod (TypeDefinition type, MethodRe
&& method.Parameters [0].ParameterType.Is (ns, cls));
}
-
- static MethodReference? FindINativeObjectConstructor (TypeDefinition type)
+ internal static MethodDefinition? FindINativeObjectConstructor (TypeDefinition type)
{
return FindConstructorWithTwoParameters ("ObjCRuntime", "NativeHandle", "System", "Boolean")
?? FindConstructorWithTwoParameters ("System", "IntPtr", "System", "Boolean");
- MethodReference? FindConstructorWithTwoParameters (string ns1, string cls1, string ns2, string cls2)
+ MethodDefinition? FindConstructorWithTwoParameters (string ns1, string cls1, string ns2, string cls2)
=> type.Methods.SingleOrDefault (method =>
method.IsConstructor
&& !method.IsStatic
diff --git a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs
index f72d3ae9e26a..cfc23620e1d7 100644
--- a/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs
+++ b/tools/dotnet-linker/Steps/ManagedRegistrarStep.cs
@@ -95,7 +95,7 @@ protected override void TryProcess ()
{
base.TryProcess ();
- if (App.Registrar != RegistrarMode.ManagedStatic)
+ if (App.Registrar != RegistrarMode.ManagedStatic && App.Registrar != RegistrarMode.TrimmableStatic)
return;
Configuration.Application.StaticRegistrar.Register (Configuration.GetNonDeletedAssemblies (this));
@@ -105,7 +105,7 @@ protected override void TryEndProcess (out List? exceptions)
{
base.TryEndProcess ();
- if (App.Registrar != RegistrarMode.ManagedStatic) {
+ if (App.Registrar != RegistrarMode.ManagedStatic && App.Registrar != RegistrarMode.TrimmableStatic) {
exceptions = null;
return;
}
@@ -123,7 +123,7 @@ protected override void TryProcessAssembly (AssemblyDefinition assembly)
{
base.TryProcessAssembly (assembly);
- if (App.Registrar != RegistrarMode.ManagedStatic)
+ if (App.Registrar != RegistrarMode.ManagedStatic && App.Registrar != RegistrarMode.TrimmableStatic)
return;
if (Annotations.GetAction (assembly) == AssemblyAction.Delete)
@@ -179,8 +179,31 @@ bool ProcessType (TypeDefinition type, AssemblyTrampolineInfo infos, List addedAssemblies = new List ();
+ List exceptions = new List ();
+
+ void AddException (Exception exception)
+ {
+ if (exceptions is null)
+ exceptions = new List ();
+ exceptions.Add (exception);
+ }
+
+ protected override void TryProcess ()
+ {
+ base.TryProcess ();
+
+ if (App.Registrar != RegistrarMode.TrimmableStatic)
+ return;
+
+ Configuration.Application.StaticRegistrar.Register (Configuration.GetNonDeletedAssemblies (this));
+ }
+
+ AssemblyDefinition CreateTypeMapRootAssembly (ModuleParameters moduleParameters, IEnumerable assemblies)
+ {
+ AssemblyDefinition rootTypeMapAssembly;
+
+ // .NET 10 doesn't support a separate root type map assembly, so we have to add these attributes to the entry assembly instead.
+ var useEntryAssemblyAsRootTypeMapAssembly = Driver.TargetFramework.Version.Major <= 10;
+
+ if (useEntryAssemblyAsRootTypeMapAssembly) {
+ rootTypeMapAssembly = Configuration.EntryAssembly;
+ } else {
+ var rootTypeMapAssemblyName = new AssemblyNameDefinition (App.TypeMapAssemblyName, new Version (1, 0, 0, 0));
+ rootTypeMapAssembly = AssemblyDefinition.CreateAssembly (rootTypeMapAssemblyName, rootTypeMapAssemblyName.Name, moduleParameters);
+ Annotations.SetAction (rootTypeMapAssembly, AssemblyAction.Link);
+ addedAssemblies.Add (rootTypeMapAssembly);
+
+ // We're running from inside the linker, but the TypeMapEntryAssembly property can only be set using a command-line
+ // argument, so we need to cheat a bit here and use reflection to set it. This will go away once we're not running
+ // as a custom linker step anymore.
+ var typeMapEntryAssemblyProperty = this.Context.GetType ().GetProperty ("TypeMapEntryAssembly");
+ if (typeMapEntryAssemblyProperty is null)
+ throw ErrorHelper.CreateError (99, "Could not find the 'TypeMapEntryAssembly' property on the linker context.");
+ typeMapEntryAssemblyProperty.SetValue (this.Context, App.TypeMapAssemblyName);
+ }
+
+ abr.SetCurrentAssembly (rootTypeMapAssembly);
+
+ foreach (var assembly in assemblies.OrderBy (v => v.FullName)) {
+ /*
+ * [assembly: TypeMapAssemblyTarget ("...")]
+ */
+ var attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type, abr.Foundation_NSObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, "_" + assembly.Name.Name + ".TypeMap"));
+ rootTypeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * [assembly: TypeMapAssemblyTarget ("...")]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type, abr.ObjCRuntime_SkippedObjectiveCTypeUniverse));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, "_" + assembly.Name.Name + ".TypeMap"));
+ rootTypeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * [assembly: TypeMapAssemblyTarget ("...")]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type, abr.ObjCRuntime_INativeObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, "_" + assembly.Name.Name + ".TypeMap"));
+ rootTypeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * [assembly: TypeMapAssemblyTarget ("...")]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type, abr.ObjCRuntime_ProtocolProxyAttribute));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, "_" + assembly.Name.Name + ".TypeMap"));
+ rootTypeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * [assembly: TypeMapAssemblyTarget ("...")]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssemblyTargetAttribute_1_Constructor_String_Type_Type, abr.Foundation_ProtocolAttribute));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, "_" + assembly.Name.Name + ".TypeMap"));
+ rootTypeMapAssembly.CustomAttributes.Add (attribute);
+ }
+ abr.SaveCurrentAssembly ();
+ abr.ClearCurrentAssembly ();
+
+ // We write the assembly here even if it hasn't changed, because otherwise we'll just end up re-creating
+ // it again during the next incremental build.
+ if (!useEntryAssemblyAsRootTypeMapAssembly) {
+ rootTypeMapAssembly.Write (Path.Combine (App.TypeMapOutputDirectory, rootTypeMapAssembly.Name.Name + ".dll"));
+ }
+ return rootTypeMapAssembly;
+ }
+
+ MethodReference CreateMethodReference (MethodReference methodReference, params TypeReference [] declaringTypeGenericArguments)
+ {
+ var methodDeclaringType = methodReference.DeclaringType;
+ if (methodDeclaringType.HasGenericParameters) {
+ if (declaringTypeGenericArguments.Length != methodDeclaringType.GenericParameters.Count)
+ throw new ArgumentException ($"The number of generic arguments provided ({declaringTypeGenericArguments.Length}) does not match the number of generic parameters of the method's declaring type ({methodDeclaringType.GenericParameters.Count}).", nameof (declaringTypeGenericArguments));
+
+ methodDeclaringType = methodDeclaringType.MakeGenericInstanceType (declaringTypeGenericArguments);
+ }
+
+ var method = new MethodReference (methodReference.Name, methodReference.ReturnType, methodDeclaringType) {
+ HasThis = methodReference.HasThis,
+ ExplicitThis = methodReference.ExplicitThis,
+ CallingConvention = methodReference.CallingConvention,
+ };
+
+ foreach (var parameter in methodReference.Parameters)
+ method.Parameters.Add (new ParameterDefinition (parameter.ParameterType));
+
+ return abr.CurrentAssembly.MainModule.ImportReference (method);
+ }
+
+ static string GetNamespace (TypeReference tr)
+ {
+ return tr.FullName.Length == tr.Name.Length ? "" : tr.FullName.Substring (0, tr.FullName.Length - tr.Name.Length - 1).Replace (".", "__").Replace ("/", "__");
+ }
+
+ protected override void TryEndProcess (out List? exceptions)
+ {
+ CustomAttribute attribute;
+ ILProcessor il;
+
+ base.TryEndProcess ();
+
+ if (App.Registrar != RegistrarMode.TrimmableStatic) {
+ exceptions = null;
+ return;
+ }
+
+ abr.SetCurrentAssembly (abr.PlatformAssembly);
+ abr.ObjCRuntime_NSObjectProxyAttribute.Resolve ().IsPublic = true;
+ abr.ObjCRuntime_ProtocolProxyAttribute.Resolve ().IsPublic = true;
+ abr.ObjCRuntime_INativeObjectProxyAttribute.Resolve ().IsPublic = true;
+ abr.ObjCRuntime_SkippedObjectiveCTypeUniverse.Resolve ().IsPublic = true;
+ abr.SaveCurrentAssembly ();
+ abr.ClearCurrentAssembly ();
+
+ Directory.CreateDirectory (App.TypeMapOutputDirectory);
+
+ var typesByAssembly = App.StaticRegistrar.Types.GroupBy (v => v.Key.Module.Assembly);
+ var skippedTypesByAssembly = App.StaticRegistrar.SkippedTypes.GroupBy (v => v.Skipped.Module.Assembly).ToDictionary (v => v.Key, v => v.ToList ());
+ // Workaround for https://github.com/dotnet/runtime/issues/127504
+ // Tracking issue: https://github.com/dotnet/macios/issues/25275
+ //
+ // Build a set of types that are the "actual" (non-generic) target of skipped type associations.
+ // These are types like NSOrderedSet, NSArray, NSDictionary etc. that have generic variants
+ // (NSOrderedSet, NSArray, NSDictionary) mapping to the same ObjC class.
+ //
+ // These types need unconditional (2-arg) TypeMap entries instead of conditional (3-arg) ones
+ // because of a bug in the linker's TypeMapHandler: when it processes the
+ // TypeMapAssociationAttribute for these types, it calls
+ // MarkInstantiated directly (bypassing MarkRequirementsForInstantiatedTypes), which poisons
+ // the IsInstantiated flag and prevents ProcessType from ever being called. This means their
+ // conditional TypeMapAttribute entries (which require ProcessType to be promoted from
+ // _unmarkedExternalTypeMapEntries) are silently trimmed by the linker.
+ //
+ // The workaround consists of two parts:
+ // 1. This HashSet identifying the affected types.
+ // 2. The conditional block below (lines starting with 'if (skippedActualTypes.Contains (td))')
+ // that uses the 2-arg TypeMapAttribute constructor for these types instead of the 3-arg one.
+ //
+ // To remove this workaround once the issue is fixed:
+ // 1. Delete this HashSet and its comment.
+ // 2. Remove the 'if (skippedActualTypes.Contains (td))' branch below, keeping only the 'else' branch.
+ // 3. Verify by running: make build run-bare TEST_VARIATION='release|trimmable-static-registrar-all-optimizations-linkall' \
+ // RUN_ARGUMENTS="--test MonoTouchFixtures.Foundation.NSOrderedSetTest"
+ // in tests/monotouch-test/dotnet/MacCatalyst (the MakeNSOrderedSet_WithNull test is a good canary).
+ var skippedActualTypes = new HashSet (App.StaticRegistrar.SkippedTypes.Select (v => v.Actual.Type.Resolve ()));
+
+ var copyAssemblyParametersFrom = abr.PlatformAssembly.MainModule;
+ var assemblyParameters = new ModuleParameters {
+ Kind = copyAssemblyParametersFrom.Kind,
+ Runtime = copyAssemblyParametersFrom.Runtime,
+ Architecture = copyAssemblyParametersFrom.Architecture,
+ AssemblyResolver = copyAssemblyParametersFrom.AssemblyResolver,
+ MetadataResolver = copyAssemblyParametersFrom.MetadataResolver,
+ };
+
+ var rootTypeMapAssembly = CreateTypeMapRootAssembly (assemblyParameters, typesByAssembly.Select (v => v.Key));
+
+ var categoryMethodsByType = App.StaticRegistrar.Types
+ .Where (v => v.Value.IsCategory)
+ .SelectMany (v => v.Value.Methods!.Select (m => (Type: v.Value.BaseType!.Type, Method: m)))
+ .GroupBy (v => v.Type)
+ .ToDictionary (v => v.Key, v => v.Select (m => m.Method).ToList ());
+
+ var trampolinesByMethod = Configuration.AssemblyTrampolineInfos
+ .SelectMany (v => v.Value.Select (t => (Assembly: v.Key, TrampolineInfo: t)))
+ .ToDictionary (v => v.TrampolineInfo.Target, v => v.TrampolineInfo);
+
+ var trampolinesByType = Configuration.AssemblyTrampolineInfos
+ .SelectMany (v => v.Value.Select (t => (Assembly: v.Key, TrampolineInfo: t)))
+ .GroupBy (v => v.TrampolineInfo.Target.DeclaringType)
+ .ToDictionary (v => v.Key, v => v.Select (t => t.TrampolineInfo).ToList ());
+
+
+ // If we need to modify an assembly that's not the typemap assembly, do it after we've finished writing the typemap assembly,
+ // to avoid having to switch between assemblies (we cache a lot of stuff, and those caches will have to be re-created for every switch).
+ var postActionsByAssembly = new Dictionary>> ();
+ void addPostAction (AssemblyDefinition assembly, Action action)
+ {
+ if (!postActionsByAssembly.TryGetValue (assembly, out var actions)) {
+ actions = new List> ();
+ postActionsByAssembly.Add (assembly, actions);
+ }
+ actions.Add (action);
+ }
+
+ foreach (var typesInAssembly in typesByAssembly.OrderBy (v => v.Key.FullName)) {
+ var assembly = typesInAssembly.Key;
+ var types = typesInAssembly.ToList ();
+
+ var typeMapAssemblyName = new AssemblyNameDefinition ("_" + assembly.Name.Name + ".TypeMap", new Version (1, 0, 0, 0));
+ var typeMapAssembly = AssemblyDefinition.CreateAssembly (typeMapAssemblyName, typeMapAssemblyName.Name, assemblyParameters);
+ var existingAction = Annotations.GetAction (assembly);
+ Annotations.SetAction (typeMapAssembly, existingAction);
+ addedAssemblies.Add (typeMapAssembly);
+
+ var accessesAssemblies = new HashSet ();
+ accessesAssemblies.Add (assembly);
+
+ abr.SetCurrentAssembly (typeMapAssembly);
+
+ /*
+ * [assembly: IgnoresAccessChecksTo ("...")]
+ */
+ var ignoredAccessChecks = new TypeDefinition ("System.Runtime.CompilerServices", "IgnoresAccessChecksToAttribute", TypeAttributes.NotPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, abr.System_Attribute);
+ var ignoredAccessChecksCtor = new MethodDefinition (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, abr.System_Void);
+ ignoredAccessChecksCtor.AddParameter ("assemblyName", abr.System_String);
+ il = ignoredAccessChecksCtor.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_0));
+ il.Append (il.Create (OpCodes.Call, abr.System_Attribute__ctor));
+ il.Append (il.Create (OpCodes.Ret));
+ ignoredAccessChecks.Methods.Add (ignoredAccessChecksCtor);
+ typeMapAssembly.MainModule.Types.Add (ignoredAccessChecks);
+
+ // INativeObject subclasses
+ var inativeObjectTypes = StaticRegistrar.GetAllTypes (assembly).Where (t => !t.IsInterface && !t.IsAbstract && t.IsNativeObject ());
+ foreach (var tr in inativeObjectTypes.OrderBy (v => v.FullName)) {
+ var inativeObjCtor = ManagedRegistrarLookupTablesStep.FindINativeObjectConstructor (tr);
+ if (inativeObjCtor is null)
+ continue;
+
+ var trImported = typeMapAssembly.MainModule.ImportReference (tr);
+ var trNamespace = GetNamespace (tr);
+
+ /*
+ * [..._Proxy]
+ * sealed class ..._Proxy : INativeObjectProxyAttribute {
+ * }
+ */
+ var proxyType = new TypeDefinition (trNamespace, tr.Name + "_Proxy", TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, abr.ObjCRuntime_INativeObjectProxyAttribute);
+ typeMapAssembly.MainModule.Types.Add (proxyType);
+
+ /* default ctor */
+ var ctor = proxyType.AddMethod (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, abr.System_Void);
+ il = ctor.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_0));
+ il.Append (il.Create (OpCodes.Call, abr.ObjCRuntime_INativeObjectProxyAttribute__ctor));
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override INativeObject? CreateObject (IntPtr handle, bool owns)
+ * {
+ * return new ... (handle, owns);
+ * }
+ */
+ var createObjectMethod = proxyType.AddMethod ("CreateObject", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.ObjCRuntime_INativeObject);
+ createObjectMethod.AddParameter ("handle", abr.System_IntPtr);
+ createObjectMethod.AddParameter ("owns", abr.System_Boolean);
+ il = createObjectMethod.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_1));
+ if (inativeObjCtor.Parameters [0].ParameterType.Is ("ObjCRuntime", "NativeHandle"))
+ il.Append (il.Create (OpCodes.Call, abr.NativeObject_op_Implicit_NativeHandle));
+ il.Append (il.Create (OpCodes.Ldarg_2));
+ il.Append (il.Create (OpCodes.Newobj, abr.CurrentAssembly.MainModule.ImportReference (inativeObjCtor)));
+ il.Append (il.Create (OpCodes.Ret));
+
+ // We add the proxy type as an attribute to itself
+ attribute = abr.CreateAttribute (ctor);
+ proxyType.CustomAttributes.Add (attribute);
+
+ /*
+ * Add the [TypeMapAssociation] attribute for the protocol wrapper type as well
+ *
+ * [assembly: TypeMapAssociation (typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssociationAttribute_1_Constructor_Type_Type, abr.ObjCRuntime_INativeObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, proxyType));
+ typeMapAssembly.CustomAttributes.Add (attribute);
+ }
+
+ foreach (var kvp in typesInAssembly.OrderBy (v => v.Key.FullName)) {
+ var tr = kvp.Key;
+ var trNamespace = GetNamespace (tr);
+ var trImported = typeMapAssembly.MainModule.ImportReference (tr);
+ var td = tr.Resolve ();
+ var objcType = kvp.Value;
+ var objcClassName = objcType.ExportedName;
+ var isCustomType = App.StaticRegistrar.IsCustomType (objcType);
+
+ if (!objcType.IsProtocol && !objcType.IsCategory) {
+ if (skippedActualTypes.Contains (td)) {
+ // Workaround for https://github.com/dotnet/runtime/issues/127504
+ // Tracking issue: https://github.com/dotnet/macios/issues/25275
+ // Use the 2-arg (unconditional) TypeMap constructor for types that are
+ // the target of a SkippedObjectiveCTypeUniverse association, because
+ // their conditional (3-arg) entries would be incorrectly trimmed.
+ // See the comment where skippedActualTypes is created for full details.
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAttribute_1_Constructor_String_Type, abr.Foundation_NSObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, objcClassName));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ } else {
+ /*
+ * [assembly: TypeMap ("Objective-C class name", typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAttribute_1_Constructor_String_Type_Type, abr.Foundation_NSObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, objcClassName));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ }
+ typeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * [..._Proxy]
+ * sealed class ..._Proxy : NSObjectProxy {
+ * }
+ */
+ var proxyType = new TypeDefinition (trNamespace, tr.Name + "_Proxy", TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, abr.ObjCRuntime_NSObjectProxyAttribute);
+ typeMapAssembly.MainModule.Types.Add (proxyType);
+
+ /* default ctor */
+ var ctor = proxyType.AddMethod (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, abr.System_Void);
+ il = ctor.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_0));
+ il.Append (il.Create (OpCodes.Call, abr.ObjCRuntime_NSObjectProxy__ctor));
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override NSObject? CreateObject (IntPtr handle)
+ * {
+ * return new ... (handle);
+ * }
+ */
+ var createObjectMethod = proxyType.AddMethod ("CreateObject", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.Foundation_NSObject);
+ createObjectMethod.AddParameter ("handle", abr.System_IntPtr);
+ il = createObjectMethod.Body.GetILProcessor ();
+ var nativeHandleCtor = ManagedRegistrarLookupTablesStep.FindNSObjectConstructor (td);
+ if (nativeHandleCtor is not null) {
+ il.Append (il.Create (OpCodes.Ldarg_1));
+ if (nativeHandleCtor.Parameters [0].ParameterType.Is ("ObjCRuntime", "NativeHandle"))
+ il.Append (il.Create (OpCodes.Call, abr.NativeObject_op_Implicit_NativeHandle));
+ il.Append (il.Create (OpCodes.Newobj, abr.CurrentAssembly.MainModule.ImportReference (nativeHandleCtor)));
+ } else {
+ il.Append (il.Create (OpCodes.Ldnull));
+ }
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override IntPtr GetClassHandle (out bool is_custom_type)
+ * {
+ * is_custom_type = ...;
+ * return Class.GetHandle ("...");
+ * }
+ */
+ var getClassHandleMethod = proxyType.AddMethod ("GetClassHandle", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.System_IntPtr);
+ getClassHandleMethod.AddParameter ("is_custom_type", abr.System_Boolean.MakeByReferenceType ());
+ il = getClassHandleMethod.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_1));
+ il.Append (il.Create (isCustomType ? OpCodes.Ldc_I4_1 : OpCodes.Ldc_I4_0));
+ il.Append (il.Create (OpCodes.Stind_I1));
+ il.Append (il.Create (OpCodes.Ldstr, objcClassName));
+ il.Append (il.Create (OpCodes.Call, abr.Class_GetHandle__System_String));
+ il.Append (il.Create (OpCodes.Call, abr.NativeObject_op_Implicit_IntPtr));
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override IntPtr LookupUnmanagedFunction (string name)
+ * {
+ * if (name == "funcA")
+ * return &funcA;
+ * if (name == "funcB")
+ * return &funcB;
+ * return IntPtr.Zero;
+ * }
+ */
+ var lookupUnmanagedFunctionMethod = proxyType.AddMethod ("LookupUnmanagedFunction", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.System_IntPtr);
+ lookupUnmanagedFunctionMethod.AddParameter ("name", abr.System_String);
+ il = lookupUnmanagedFunctionMethod.Body.GetILProcessor ();
+
+ // Get all the UnmanagedCallersOnly methods we need to be able to find for the current type, which includes:
+ // - methods from the type itself
+ // - methods from categories on the type
+ var uco = new List ();
+ if (categoryMethodsByType.Remove (td, out var categoryMethods)) {
+ foreach (var m in categoryMethods.OrderBy (v => v.FullName)) {
+ if (!trampolinesByMethod.Remove (m.Method!, out var info)) {
+ AddException (ErrorHelper.CreateWarning (4191, Errors.MX4191 /* Could not find the trampoline for the category method {0}. */, m.Method?.FullName));
+ continue;
+ }
+ trampolinesByType.Remove (m.CategoryType!.Type.Resolve ());
+ uco.Add (info);
+ accessesAssemblies.Add (info.Trampoline.Module.Assembly);
+ }
+ }
+ if (trampolinesByType.Remove (td, out var trampolines)) {
+ uco.AddRange (trampolines);
+ foreach (var info in trampolines) {
+ trampolinesByMethod.Remove (info.Target);
+ }
+ }
+
+ var ucos = uco.OrderBy (v => v.UnmanagedCallersOnlyEntryPoint).ToList ();
+ var ldcI4 = il.Create (OpCodes.Ldc_I4_0);
+ for (var i = 0; i < ucos.Count; i++) {
+ var info = ucos [i];
+ var isLast = i == ucos.Count - 1;
+ var falseTarget = isLast ? ldcI4 : il.Create (OpCodes.Nop);
+ il.Append (il.Create (OpCodes.Ldarg_1));
+ il.Append (il.Create (OpCodes.Ldstr, info.UnmanagedCallersOnlyEntryPoint));
+ il.Append (il.Create (OpCodes.Call, abr.System_String__op_Equality_String_String));
+ il.Append (il.Create (OpCodes.Brfalse_S, falseTarget));
+ // return &Method;
+ il.Append (il.Create (OpCodes.Ldftn, abr.CurrentAssembly.MainModule.ImportReference (info.Trampoline)));
+ il.Append (il.Create (OpCodes.Ret));
+ if (!isLast)
+ il.Append (falseTarget);
+ }
+ // CWL
+ // il.Append (il.Create (OpCodes.Ldstr, $"{proxyType.FullName}.LookupUnmanagedFunction ({{0}}): did not find this UCO method, among: {string.Join (", ", uco.Select (v => v.UnmanagedCallersOnlyEntryPoint))}"));
+ // il.Append (il.Create (OpCodes.Ldarg_1));
+ // il.Append (il.Create (OpCodes.Call, abr.System_Console__WriteLine_String_Object));
+ //
+ // return IntPtr.Zero
+ il.Append (ldcI4);
+ il.Append (il.Create (OpCodes.Conv_I));
+ il.Append (il.Create (OpCodes.Ret));
+
+ // We add the proxy type as an attribute to itself
+ attribute = abr.CreateAttribute (ctor);
+ proxyType.CustomAttributes.Add (attribute);
+
+ // We also add the proxy type as an attribute to the type, as a workaround for https://github.com/dotnet/runtime/issues/127004
+ // Tracking issue: https://github.com/dotnet/macios/issues/25276
+ addPostAction (td.Module.Assembly, assembly => {
+ var attribute = new CustomAttribute (assembly.MainModule.ImportReference (ctor)); // don't use abr.CreateAttribute here, because the ctor has already been marked
+ td.CustomAttributes.Add (attribute);
+ });
+
+ /*
+ * Add the [TypeMapAssociation] attribute for this type and its proxy
+ *
+ * [assembly: TypeMapAssociation (typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssociationAttribute_1_Constructor_Type_Type, abr.Foundation_NSObject));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, proxyType));
+ typeMapAssembly.CustomAttributes.Add (attribute);
+ }
+
+ if (objcType.IsProtocol && objcType.ProtocolWrapperType is not null) {
+ /*
+ * [..._Proxy]
+ * sealed class ..._Proxy : ProtocolProxyAttribute {
+ * }
+ */
+ var proxyType = new TypeDefinition (trNamespace, tr.Name + "_Proxy", TypeAttributes.Public | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, abr.ObjCRuntime_ProtocolProxyAttribute);
+ typeMapAssembly.MainModule.Types.Add (proxyType);
+
+ /* default ctor */
+ var ctor = proxyType.AddMethod (".ctor", MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName, abr.System_Void);
+ il = ctor.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldarg_0));
+ il.Append (il.Create (OpCodes.Call, abr.ObjCRuntime_ProtocolProxy__ctor));
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override INativeObject? CreateObject (IntPtr handle, bool owns)
+ * {
+ * return new ... (handle, owns);
+ * }
+ */
+ var createObjectMethod = proxyType.AddMethod ("CreateObject", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.ObjCRuntime_INativeObject);
+ createObjectMethod.AddParameter ("handle", abr.System_IntPtr);
+ createObjectMethod.AddParameter ("owns", abr.System_Boolean);
+ createObjectMethod.CreateBody (out il);
+ var nativeHandleCtor = ManagedRegistrarLookupTablesStep.FindINativeObjectConstructor (objcType.ProtocolWrapperType.Resolve ());
+ if (nativeHandleCtor is not null) {
+ il.Append (il.Create (OpCodes.Ldarg_1));
+ if (nativeHandleCtor.Parameters [0].ParameterType.Is ("ObjCRuntime", "NativeHandle"))
+ il.Append (il.Create (OpCodes.Call, abr.NativeObject_op_Implicit_NativeHandle));
+ il.Append (il.Create (OpCodes.Ldarg_2));
+ il.Append (il.Create (OpCodes.Newobj, abr.CurrentAssembly.MainModule.ImportReference (nativeHandleCtor)));
+ } else {
+ il.Append (il.Create (OpCodes.Ldnull));
+ }
+ il.Append (il.Create (OpCodes.Ret));
+
+ /*
+ * public override string GetName ()
+ * {
+ * return "";
+ * }
+ */
+ var getProtocolNameMethod = new MethodDefinition ("GetProtocolName", MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig, abr.System_String);
+ il = getProtocolNameMethod.Body.GetILProcessor ();
+ il.Append (il.Create (OpCodes.Ldstr, objcType.ProtocolName));
+ il.Append (il.Create (OpCodes.Ret));
+ proxyType.Methods.Add (getProtocolNameMethod);
+
+ // We add the proxy type as an attribute to itself
+ attribute = abr.CreateAttribute (ctor);
+ proxyType.CustomAttributes.Add (attribute);
+
+ /*
+ * Add the [TypeMapAssociation] attribute for the protocol wrapper type as well
+ *
+ * [assembly: TypeMapAssociation (typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssociationAttribute_1_Constructor_Type_Type, abr.ObjCRuntime_ProtocolProxyAttribute));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, proxyType));
+ typeMapAssembly.CustomAttributes.Add (attribute);
+
+ /*
+ * Add the [TypeMapAssociation] attribute for the protocol wrapper type as well
+ *
+ * [assembly: TypeMapAssociation (typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssociationAttribute_1_Constructor_Type_Type, abr.Foundation_ProtocolAttribute));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, trImported));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, abr.CurrentAssembly.MainModule.ImportReference (objcType.ProtocolWrapperType)));
+ typeMapAssembly.CustomAttributes.Add (attribute);
+
+ // We also add the proxy type as an attribute to the type, as a workaround for https://github.com/dotnet/runtime/issues/127004
+ // Tracking issue: https://github.com/dotnet/macios/issues/25276
+ addPostAction (td.Module.Assembly, assembly => {
+ var attribute = new CustomAttribute (assembly.MainModule.ImportReference (ctor)); // don't use abr.CreateAttribute here, because the ctor has already been marked
+ td.CustomAttributes.Add (attribute);
+ });
+ }
+ }
+
+ foreach (var accessesAssembly in accessesAssemblies.OrderBy (v => v.FullName)) {
+ var attrib = abr.CreateAttribute (ignoredAccessChecksCtor);
+ attrib.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_String, accessesAssembly.Name.Name));
+ typeMapAssembly.CustomAttributes.Add (attrib);
+ }
+
+ if (skippedTypesByAssembly.Remove (assembly, out var skippedTypes)) {
+ foreach (var skipped in skippedTypes.OrderBy (v => v.Skipped.FullName)) {
+ /*
+ * [assembly: TypeMapAssociation (typeof (...), typeof (...))]
+ */
+ attribute = abr.CreateAttribute (CreateMethodReference (abr.TypeMapAssociationAttribute_1_Constructor_Type_Type, abr.ObjCRuntime_SkippedObjectiveCTypeUniverse));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, typeMapAssembly.MainModule.ImportReference (skipped.Skipped)));
+ attribute.ConstructorArguments.Add (new CustomAttributeArgument (abr.System_Type, typeMapAssembly.MainModule.ImportReference (skipped.Actual.Type)));
+ typeMapAssembly.CustomAttributes.Add (attribute);
+ }
+ }
+
+ abr.ClearCurrentAssembly ();
+
+ // We write the assembly here even if it hasn't changed, because otherwise we'll just end up re-creating
+ // it again during the next incremental build.
+ typeMapAssembly.Write (Path.Combine (App.TypeMapOutputDirectory, typeMapAssembly.Name.Name + ".dll"));
+ }
+
+ foreach (var kvp in postActionsByAssembly) {
+ var assembly = kvp.Key;
+ var actions = kvp.Value;
+ abr.SetCurrentAssembly (assembly);
+ foreach (var action in actions) {
+ action (assembly);
+ }
+ abr.ClearCurrentAssembly ();
+ }
+
+ // Since we're running inside the trimmer, we need to make sure the trimmer knows about the assemblies we've created.
+ // This will go away once we're running outside of the trimmer.
+ var managedAssemblyToLinkItems = new List ();
+ var resolver = abr.PlatformAssembly.MainModule.AssemblyResolver;
+ var getAssembly = resolver.GetType ().GetMethod ("GetAssembly", new Type [] { typeof (string) })!;
+ var cacheAssembly = resolver.GetType ().GetMethod ("CacheAssembly", new Type [] { typeof (AssemblyDefinition) })!;
+ foreach (var asm in addedAssemblies) {
+ var fn = Path.Combine (App.TypeMapOutputDirectory, asm.Name.Name + ".dll");
+ var asmDef = (AssemblyDefinition) getAssembly.Invoke (resolver, [fn])!;
+ cacheAssembly.Invoke (resolver, [asmDef]);
+ var action = Annotations.GetAction (asm);
+ Annotations.SetAction (asmDef, action);
+
+ var linkedPath = Path.Combine (Configuration.IntermediateLinkDir, asm.Name.Name + ".dll");
+ managedAssemblyToLinkItems.Add (new MSBuildItem (linkedPath, new Dictionary {
+ { "TrimMode", "link" },
+ }));
+ }
+
+ Configuration.WriteOutputForMSBuild ("ManagedAssemblyToLink", managedAssemblyToLinkItems);
+
+ // Report back any exceptions that occurred during the processing.
+ exceptions = this.exceptions;
+ }
+ }
+}
diff --git a/tools/linker/MarkNSObjects.cs b/tools/linker/MarkNSObjects.cs
index a69aeb3239c9..02502154fd10 100644
--- a/tools/linker/MarkNSObjects.cs
+++ b/tools/linker/MarkNSObjects.cs
@@ -28,6 +28,8 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.Collections.Generic;
+
using Mono.Cecil;
using Mono.Linker;
using Mono.Tuner;
@@ -119,8 +121,11 @@ public static bool ProcessType (IMarkNSObjects marker, TypeDefinition type)
marker.PreserveType (type, allMembers: true);
} else if (type.HasMethods) {
modified |= PreserveIntPtrConstructor (marker, type);
- if (nsobject)
+ if (nsobject) {
modified |= PreserveExportedMethods (marker, type);
+ if (marker.App.Registrar == RegistrarMode.TrimmableStatic)
+ modified |= PreserveVirtualOverrides (marker, type);
+ }
}
return modified;
@@ -186,6 +191,29 @@ static bool PreserveIntPtrConstructor (IMarkNSObjects marker, TypeDefinition typ
return modified;
}
+ static bool PreserveVirtualOverrides (IMarkNSObjects marker, TypeDefinition type)
+ {
+ // Preserve all virtual method overrides for product NSObject types.
+ // When TrimMode=full, the trimmer may remove virtual overrides from
+ // product types (like ClassHandle, ToString, Dispose, etc.), causing
+ // incorrect base class behavior at runtime. These overrides are called
+ // through virtual dispatch and must be preserved.
+ // Collect first to avoid modifying the collection while iterating.
+ List? overrides = null;
+ foreach (var method in type.Methods) {
+ if (!method.IsVirtual || method.IsNewSlot || method.IsAbstract)
+ continue;
+ overrides ??= new List ();
+ overrides.Add (method);
+ }
+ if (overrides is null)
+ return false;
+ var modified = false;
+ foreach (var method in overrides)
+ modified |= marker.PreserveMethod (type, method);
+ return modified;
+ }
+
static bool IsProductMethod (IMarkNSObjects marker, MethodDefinition method)
{
return method.DeclaringType.Module.Assembly.Name.Name == marker.App.Configuration.PlatformAssembly;
diff --git a/tools/mtouch/Errors.designer.cs b/tools/mtouch/Errors.designer.cs
index d1f4533d4832..e2f24503e42d 100644
--- a/tools/mtouch/Errors.designer.cs
+++ b/tools/mtouch/Errors.designer.cs
@@ -3569,6 +3569,15 @@ public static string MX4189 {
}
}
+ ///
+ /// Looks up a localized string similar to Could not find the trampoline for the category method {0}..
+ ///
+ public static string MX4191 {
+ get {
+ return ResourceManager.GetString("MX4191", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to The native linker failed to execute: {0}. Please file a bug report at https://github.com/dotnet/macios/issues/new
/// .
@@ -3875,5 +3884,23 @@ public static string MX8060 {
return ResourceManager.GetString("MX8060", resourceCulture);
}
}
+
+ ///
+ /// Looks up a localized string similar to Unable to find the managed function with id {0} ({1}, {2}). Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new)..
+ ///
+ public static string MX8061 {
+ get {
+ return ResourceManager.GetString("MX8061", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Type '{0}' is expected to have a ProtocolProxyAttribute. Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new)..
+ ///
+ public static string MX8062 {
+ get {
+ return ResourceManager.GetString("MX8062", resourceCulture);
+ }
+ }
}
}
diff --git a/tools/mtouch/Errors.resx b/tools/mtouch/Errors.resx
index 5c5db81701a4..83c238026906 100644
--- a/tools/mtouch/Errors.resx
+++ b/tools/mtouch/Errors.resx
@@ -1592,6 +1592,10 @@
The class '{0}' will not be registered because the {1} framework has been deprecated from the {2} SDK.
+
+ Could not find the trampoline for the category method {0}.
+
+
Missing '{0}' compiler. Please install Xcode 'Command-Line Tools' component
@@ -1906,4 +1910,12 @@
Invalid DelegateProxyAttribute for the return value for the method {0}.{1}: No 'Invoke' method found. Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new).
+
+
+ Unable to find the managed function with id {0} ({1}, {2}). Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new).
+
+
+
+ Type '{0}' is expected to have a ProtocolProxyAttribute. Please file a bug report with a test case (https://github.com/dotnet/macios/issues/new).
+