Replace [DllImport] with [LibraryImport] for runtime P/Invokes#10763
Replace [DllImport] with [LibraryImport] for runtime P/Invokes#10763
Conversation
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
…sistently Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
…n to 12 Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
|
@copilot build failed: |
…ruct parameter Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Fixed in 34970c1. Added |
|
@copilot we need to update apk sizes. there is documentation how to do it in Documentation/project-docs/ApkSizeRegressionChecks.md, so I believe you should be able to follow it to update the baselines:
Also, propose how to turn Documentation/project-docs/ApkSizeRegressionChecks.md into a SKILL.md that we could add to this repo. Feel free to commit it to this PR branch if you know how to do it. |
Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
I've added a SKILL.md proposal in Regarding the baseline update: I cannot access the Azure Pipelines CI artifacts directly from this environment. The test results with the new
Would you be able to download the artifacts from the CI and either commit them or share them so I can update the baselines? |
Summary
Convert ALL
[DllImport]to[LibraryImport]for P/Invokes across the codebase.Changes
xa-internal-apiP/Invokesxamarin_app_init__android_log_print(liblog)exit(libc)libjnigraphics.sobitmap P/InvokesStringBuilder→string)LangVersion10 → 12 (required for LibraryImport source generator)[assembly: DisableRuntimeMarshalling](required for LibraryImport with ref struct parameter)Build Fixes
LangVersionto 12 forLibraryImportsource generator supportnew[] { typeof(...) })[assembly: DisableRuntimeMarshalling]for NativeAOT project (required when passing structs by reference with LibraryImport)Pending
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.